Why Simulate Power?
A closed-form sample-size calculation can be useful when the design, endpoint, and decision rule match its assumptions. But a planned bioequivalence study may include a replicate design, several variance components, correlated endpoints, incomplete profiles, or an individual-bioequivalence criterion based on fitted variance components. In those settings, a formula for a simpler design may answer the wrong question. Simulation instead asks: if this exact study were repeated many times under specified assumptions, how often would its planned analysis conclude bioequivalence?
Simulation does not remove assumptions. It makes them explicit: the data-generating model, parameter values, allocation, dropout process, analysis model, and decision rule all affect the result. A simulated power value is conditional on those choices, not a universal property of the sample size.
Specify the Model and the Decision Before Simulating
A mixed-effects model separates fixed effects, such as formulation and period effects, from random effects, such as subject-to-subject variation. A general form for a log-transformed pharmacokinetic endpoint is
Here, \(\mathbf{Y}\) contains the endpoint measurements; \(X\) and \(Z\) encode the fixed- and random-effect design; \(\boldsymbol{\beta}\) contains fixed-effect parameters; and \(G\) and \(R\) specify random-effect and residual covariance. The formulation contrast is a prespecified linear contrast of fixed effects, for example \(c^\mathsf{T}\boldsymbol{\beta}\). The design matrices must match the actual sequence, period, and formulation assignments. A replicate study may also require subject-by-formulation effects or formulation-specific residual variances.
This model requires assumptions appropriate to the chosen analysis: the specified mean structure is adequate; the random effects and residuals follow the assumed distributions and covariance structures; and the estimation and testing procedures used in the simulated analysis are the same as those intended for the study. If normality, constant variance, or a particular covariance structure is implausible, the simulation should represent a defensible alternative scenario rather than quietly relying on the convenient one.
The decision rule must also be operational. For average bioequivalence, a common rule on the log scale is that the 90% confidence interval for the test-minus-reference mean contrast lies wholly within \(\bigl(\log(0.80),\log(1.25)\bigr)\). This corresponds to the two one-sided tests procedure at \(\alpha=0.05\). A joint requirement for two endpoints passes only when both endpoint criteria pass. For population or individual bioequivalence, the decision rule can involve fitted variance components as well as the mean contrast; the exact metric, bounds, and uncertainty calculation must be the ones specified for the planned analysis. There is no single interchangeable rule for all bioequivalence questions.
From Repeated Studies to an Estimated Power
For each simulated study, record \(I_r=1\) if the planned decision rule declares bioequivalence and \(I_r=0\) otherwise. If \(M\) independent studies are simulated, the estimated power is the average of these indicators:
The justification is direct. Under the specified model, each \(I_r\) is a Bernoulli random variable with success probability \(\pi\), the power being sought. Therefore \(E(I_r)=\pi\), and \(E(\widehat{\text{Power}})=\pi\). The simulated fraction estimates that probability; it does not guarantee that a future study will pass.
Set the candidate sample size, randomization, sequence and period structure, number of measurements, and planned dropout or nonevaluable-profile rules.
Specify the true formulation contrast, variance components, correlations, and any parameters governing missingness. Use values justified for planning, and examine plausible alternatives when they are uncertain.
Draw random effects and residuals from the specified model, apply the planned missingness process, fit the planned mixed-effects model, and implement the prespecified pass rule.
Count successful analyses and divide by the number of simulated studies. Repeat the procedure for each candidate sample size and important parameter scenario.
Worked Examples
Worked Example: Simulated Power for One Endpoint
Suppose a hypothetical two-period crossover study uses a mixed-effects model for log AUC. Under the planning scenario, the true test-to-reference geometric mean ratio is 0.97, the within-subject standard deviation is 0.20, and 48 subjects are enrolled. Assume complete profiles for this example. In each replicate, power is counted only if the fitted 90% confidence interval for the log-scale contrast lies within the prespecified equivalence bounds.
The model and analysis are assumed correctly specified for this scenario, the planned sequence allocation is used, and the fitting procedure converges for the analyzed data. Generate \(M=1{,}000\) hypothetical studies, fit the model to each, and suppose 836 satisfy the criterion.
Calculation: \(\widehat{\text{Power}}=836/1{,}000=0.836\). The estimated power is 83.6% for this sample size and parameter scenario. This is not an 83.6% probability that the model assumptions are true; it is the estimated pass probability conditional on them.
Worked Example: Choosing Among Candidate Sample Sizes
Consider a hypothetical planning analysis with the same analysis rule at three candidate total sample sizes. Each scenario uses the intended randomization and the same assumed model parameters. Dropout is generated using a prespecified 10% probability per participant, and the planned analysis handles missing profiles as specified in the protocol. For each candidate, 1,000 studies are simulated.
| Total enrolled | Studies passing | Estimated power |
|---|---|---|
| 48 | 723 of 1,000 | 0.723 (72.3%) |
| 60 | 824 of 1,000 | 0.824 (82.4%) |
| 72 | 884 of 1,000 | 0.884 (88.4%) |
For 60 enrolled, the calculation is \(824/1{,}000=0.824\). If the planning target is at least 80% under this scenario, 48 does not meet it, while 60 and 72 do. The smallest candidate meeting the target is therefore 60. This conclusion is conditional on the assumed dropout and variance parameters; a different plausible scenario could change the selected size.
The dropout process must represent the planned study rather than merely subtracting 10% from the final sample size. In particular, the simulation should reflect whether missingness depends on observed characteristics, whether a participant remains analyzable, and how the planned mixed-effects analysis uses incomplete observations.
Worked Example: Joint Power for Two Endpoints
A hypothetical study must meet its bioequivalence criterion for both log AUC and log Cmax. The endpoints are correlated within participants, so they are generated jointly under a specified bivariate mixed-effects model. The analysis fits the planned model to each endpoint and declares overall success only if both 90% confidence intervals lie within their respective equivalence bounds. Assume the model structure, covariance assumptions, and fitting procedure are appropriate for this scenario.
Suppose 884 of 1,000 simulated studies pass the AUC criterion, 831 pass the Cmax criterion, and 746 pass both. The joint power estimate is \(746/1{,}000=0.746\), or 74.6%. The separate marginal estimates are 88.4% and 83.1%, but neither is the joint power.
Multiplying the marginal estimates would give \(0.884\times0.831=0.7346\), or about 73.5%, only under independence of the two pass indicators. The endpoints were simulated as correlated, so that independence assumption is not justified. Counting studies that pass both criteria directly estimates the relevant joint probability.
Diagnostics, Alternatives, and Limitations
A simulation can produce a precise-looking number while implementing the wrong design or rule. Check that each generated data set has the intended treatment assignments, periods, and repeated measurements; that variances and correlations are on the correct scale; and that the fitted model and success criterion match the protocol. Track convergence failures and singular fits. If they occur, determine whether they indicate an unrealistic scenario, an unstable fitting procedure, or a genuine feature of the planned analysis. Do not simply discard failed fits without deciding how such failures would be handled in the real study.
Useful checks include comparing simulated means and variances with their target values, confirming that the randomization and missingness rates are as specified, and testing the analysis code on small data sets whose results can be checked by hand. When feasible, examine behavior at a boundary scenario where the decision rule should rarely pass under the null. Unexpectedly frequent passes can reveal a coding error, a mismatched model, or an incorrect implementation of the test.
Closed-form power calculations remain valuable when their assumptions match the design: they can be faster, easier to audit, and useful as a benchmark. Simulation is more adaptable to complex covariance structures, joint criteria, and planned missingness, but it depends on correct code and credible parameter scenarios. It also estimates power only for the scenarios examined. A single favorable scenario should not be treated as robust evidence that the chosen size is adequate.
A simulation-based analysis is most useful when it is transparent and reproducible: preserve the parameter assumptions, model specification, decision-rule code, and candidate-size results. The simulated estimate is a planning quantity, not a substitute for evaluating whether the assumed model and parameter values are credible.
Check Your Understanding
Answer each question, then compare with the solutions below.
- In 2,000 simulated studies, 1,570 meet the study’s full bioequivalence rule. What is the estimated power?
- A protocol requires both AUC and Cmax to pass. Why is the fraction of studies passing AUC alone not the study’s power?
- Name two assumptions or design features that must be represented when simulating a replicate mixed-effects study with dropout.
- What should be done if a substantial fraction of simulated mixed-effects model fits fail to converge?
Solutions. (1) \(\widehat{\text{Power}}=1{,}570/2{,}000=0.785\), or 78.5%, conditional on the simulated scenario. (2) The study succeeds only when both criteria pass, so power is the proportion passing both; the AUC-only fraction is a marginal probability. (3) Examples include the replicate sequence and period structure, the subject-by-formulation and residual covariance assumptions, and the specified dropout process. (4) Investigate whether the failures reflect an unrealistic scenario, model instability, or an implementation problem; specify how failures would be handled in the planned analysis rather than silently omitting them.