30.8 Constructing a simulated trial
A model equation alone does not define a trial. SSE also needs subject covariates, treatment allocation, dose and observation event records, schedules, censoring, attrition, and any trial-level structure. nlmx begins from the reference dataset’s subject design skeletons, resamples within the declared arm design, and applies scenario transformations before simulation.
Concepts to keep separate
- Resampling preserves executable event semantics such as AMT, CMT, EVID, RATE, ADDL, II, MDV, and observation timing.
- Arm allocation determines how many subject skeletons are drawn from each design pool. Small arms can be especially sensitive to integer rounding.
- Repeatable schedules should be deterministic transformations of observation times; random missingness and dropout belong to separately described mechanisms.
- Covariate distributions and correlations influence the information for covariate effects as strongly as record count.
Terminology matters because a single scenario can contain several denominators and several sources of randomness. Truth is the parameter vector used to generate a replicate. Estimate is the value recovered from that replicate. Design is the planned arrangement of subjects, arms, doses, and observations. Method is the approximation or simulation–estimation procedure used to predict performance. A credible report labels all four.
Mathematical or operational walkthrough
A nominal N=80 design with two equal arms needs a feasible 40/40 allocation. If dropout is 20%, clarify whether 80 means randomised before attrition or evaluable after attrition; SSE can otherwise answer a different denominator question.
For novices, read every expression from the inside out: identify the scientific effect, identify the null value, put both on the same parameter scale, identify the variance or information that belongs to the actual design, and only then calculate a test statistic or sample size. Units and parameterisation should cancel in a way that leaves a dimensionless statistic.
How this maps to nlmx
Inspect one generated dataset from every distinct scenario before trusting hundreds of replicates. Verify subject count, arm count, event order, dose history, observation count, covariate ranges, and transformed schedule.
Chapter 30 explains the statistical and implementation concepts. Chapter 31 gives the complete nlmx power command, every CLI and settings control, precedence, output schema, and production workflow. This separation is deliberate: choosing an option correctly requires understanding which estimand and assumption it changes.
Quality-control checklist
- Do generated event records obey the planned protocol?
- Are arm counts and integer rounding correct?
- Are covariate correlations preserved?
- Does total N mean the same thing in protocol and simulation?
The graph is explanatory; the CSV, JSON, resolved settings, model inputs, and replicate rows are the authoritative evidence. When a plotted point looks surprising, diagnose the underlying rows before changing the design.
Common mistakes
- Simulating only DV values on the original subjects
- Applying dropout by simply reducing N without timing
- Assuming equal allocation when integer counts differ
Also avoid copying a sample size from a nearby project. Power is conditional on the model, tested effect, covariate distribution, schedule, residual and random variability, attrition, test, estimator, and success criteria. Similar-looking studies can have very different information.
Evidence to retain
- scientific question, estimand, hypothesis, alpha, target, and criteria;
- model/data/design inputs, parameter source and uncertainty distribution;
- software version, method, approximation, seed, threads, command, and resolved settings;
- scenario grid, row-level results, failures, denominators, intervals, diagnostics, and checksums;
- scripts that calculate derived tables and figures, plus the interpretation and limitations.
Navigation
See the previous page, next page, and formula and decision index.