Documentation

30.24 Worked hand calculation: 44 subjects

Worked hand calculation: 44 subjects
Supporting Chapter 30 calculation or executed result

A short hand calculation is an essential QC companion to automated output. The executed reduced FIM evaluated CL~WT=0.75 versus zero at N=40. Its SE was 0.2780846, giving variance 0.077331 and lambda=(0.75/0.2780846)^2=7.273923. The target noncentrality for 80% power at alpha 0.05 is approximately 7.8489.

Concepts to keep separate

  • Step 1: calculate current lambda using effect difference squared divided by variance.
  • Step 2: obtain target lambda from the noncentral chi-square distribution at the specified alpha, power, and degrees of freedom.
  • Step 3: scale N: 40×7.8489/7.273923=43.16.
  • Step 4: round upward to 44, construct the feasible allocation, and recompute the design.

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

The grid confirms the direction: powers were 0.479 at N=20, 0.769 at N=40, 0.968 at N=80, and 0.9997 at N=160. Because 40 is slightly below target and 80 far above it, the scaled answer near 44 is plausible.

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

A second approximation uses the two-sided normal rule N proportional to \(z_0.975+z_0.80\)^2/effect^2. It should agree closely for a regular one-df Wald test, providing an independent arithmetic check.

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

  • Can lambda be reproduced from the printed effect and SE?
  • Does target lambda match alpha and df?
  • Does scaled N lie between sensible grid points?
  • Was final power recomputed after allocation?

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

  • Using 0.278 as variance rather than SE
  • Forgetting to square the effect
  • Reporting 43.16 subjects as an operational design

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.

See the previous page, next page, and formula and decision index.