Tutorials › Optimal Design and Model-Informed Dosing › A Simulation Workflow for Comparing Study Designs

Simulation Studies of Designs · Tutorial 435 of 497

A Simulation Workflow for Comparing Study Designs

You will learn to turn candidate study designs into a consistent simulation-and-analysis workflow and interpret the resulting comparisons cautiously.

Intermediate 12 min read

What You'll Learn

  • Specify what distinguishes each candidate study design.
  • Separate the data-generating assumptions from the analysis applied to simulated trials.
  • Keep the analysis pipeline and performance measures consistent across designs.
  • Work through simulated trial outputs and compare their performance.
  • Diagnose implementation problems and recognize the limits of simulation evidence.

Why Compare Designs by Simulation?

A study design is more than a sample size. It can specify who is enrolled, when observations are planned, which measurements are collected, and how treatment or dose is assigned. Two designs may also lead to different amounts of usable data or different opportunities to estimate a model parameter. Simulation provides a way to compare such designs under stated assumptions: repeatedly create trial data as if each design had been used, analyze those data using the intended method, and summarize prespecified measures of performance.

The central discipline is consistency. The design determines how data are collected; a data-generating model represents the process that produces them; and an analysis method is applied to each simulated trial. These are related but distinct parts of the workflow. A design comparison is not persuasive if one design is analyzed with a more favorable method, if the simulated data do not reflect the intended trial, or if the comparison measure is chosen only after results are seen.

Definition: A simulation workflow for comparing study designs is a prespecified sequence that (1) defines candidate designs, (2) generates trial data under stated assumptions for each design, (3) applies a specified analysis method to each simulated trial, and (4) summarizes the resulting analysis outputs using prespecified performance measures.

The workflow answers a conditional question: given the assumptions used to generate data and the analysis method used, how do the candidate designs perform on the measures selected for comparison? It does not establish which design will perform best in every possible real-world setting. Conclusions are only as credible as the assumptions, implementation, and scope of the comparison.

Specify the Workflow Before Running It

Begin by writing down the decision the comparison is meant to inform. Then define candidate designs in terms that can be implemented, rather than relying on labels such as “sparse” or “intensive.” For example, state the planned number of participants, allocation, measurement times, and any other feature that differs. Keep features that are intended to be the same fixed across candidates.

Next, state how data will be generated for each candidate. The generating assumptions should describe the trial process relevant to the question, including the quantities treated as known for the simulation and the sources of variation represented. They are not automatically the same as the assumptions in the analysis model. Indeed, comparing performance under a difference between the generating model and the analysis model may be intentional, but the difference must be explicit.

Specify the analysis pipeline before generating results. It includes data preparation, the model or estimator to be used, and the rule for recording an analysis that does not return a usable result. Apply the same pipeline across designs unless a difference is itself part of the planned comparison. If each candidate receives a different analysis method, the comparison is of design-and-analysis strategies, not designs alone.

Finally, define the performance measures in advance. Examples include estimation error relative to a known simulated value, the proportion of trials meeting a prespecified accuracy criterion, and computational time. The measure should reflect the decision at hand. A design that produces more precise estimates may also cost more or be harder to implement; no single measure necessarily captures every trade-off.

1
State the decision question.
Identify the parameter, decision, or operational concern that the design comparison is meant to address.
2
Define candidate designs.
Record what differs between candidates and what is held fixed, using implementable details.
3
Specify data generation and analysis.
State the assumptions that produce each trial data set and the analysis pipeline that will be applied to it.
4
Choose performance measures.
Define in advance which outputs will be compared and how analysis failures will be represented.
5
Run, check, and summarize.
Verify that the simulation and analysis behave as specified, then compare the prespecified measures across candidates.

A Simple Justification for Simulation-Based Precision Comparisons

A simple model helps show why design details can affect performance. Suppose each participant contributes one measurement \(Y_i\), with independent observations from a normal distribution with mean \(\theta\) and variance \(\sigma^2\). If the analysis estimates \(\theta\) by the sample mean, then the sample mean has expected value \(\theta\), and its variance is \(\sigma^2/n\). Thus, under these assumptions, increasing the number of independent observations reduces the sampling variance of the estimator.

$$ \bar{Y}=\frac{1}{n}\sum_{i=1}^{n}Y_i,\qquad E(\bar{Y})=\theta,\qquad \operatorname{Var}(\bar{Y})=\frac{\sigma^2}{n} $$

The variance result follows from independence: the variance of a sum is the sum of the variances, so \(\operatorname{Var}(\sum_iY_i)=n\sigma^2\). Dividing that sum by \(n\) divides its variance by \(n^2\), giving \(n\sigma^2/n^2=\sigma^2/n\). This justification depends on the stated model and estimator; it is not a general guarantee that every design with more observations will be better on every measure. Simulation is useful when the design, data structure, or analysis is too complicated for such a simple calculation.

Worked Example: Define Two Candidate Sample Sizes

Hypothetical setup. A team wants to compare two designs for estimating a mean exposure-related endpoint. Under the chosen generating assumptions, each participant contributes one independent measurement \(Y_i\sim N(10,4^2)\), where the target mean is 10 endpoint units and the between-participant standard deviation is 4 endpoint units. Candidate A enrolls \(n=16\) participants; Candidate B enrolls \(n=25\). Both use the sample mean as the estimator.

The model is normal, observations are independent with common variance \(4^2=16\), and the analysis estimator is the mean. These assumptions justify the variance calculation above. The standard error under Candidate A is \(4/\sqrt{16}=4/4=1.00\) endpoint unit. Under Candidate B it is \(4/\sqrt{25}=4/5=0.800\) endpoint units.

For one illustrative simulated trial, suppose the generated measurements sum to 176 units under A and 265 units under B. The estimated means are \(176/16=11.0\) units and \(265/25=10.6\) units, respectively. Their absolute errors relative to the generating value of 10 units are 1.0 and 0.6 units. These are outcomes from two single hypothetical trials, not sufficient evidence that B will always be more accurate. The theoretical standard errors describe repeated sampling under the stated model; a full comparison would repeat the workflow and summarize prespecified performance measures.

This example isolates sample size. A more realistic comparison might also vary measurement timing, participant allocation, or the number of samples per participant. Those changes can alter the data structure and may require a richer generating model and an analysis method that respects that structure.

Apply the Analysis to Every Simulated Trial

A simulation replicate represents one possible trial under a candidate design. The analysis pipeline should produce the planned output for each replicate, such as a parameter estimate, an interval, or a decision. It should also record whether the analysis completed and whether its output met any prespecified usability rule. A failed fit is part of the design’s simulated performance; silently discarding it can make a design appear more successful than it is.

Before interpreting summaries, check that the implementation matches the plan. Confirm that each candidate has the intended number of participants and measurements, that generated values have plausible units and ranges under the assumptions, and that the analysis is receiving the correct data. Review a small number of simulated trials by hand. If the program gives surprising results, first check the data and code rather than treating the output as a scientific finding.

Worked Example: Analyze One Hypothetical Trial

Hypothetical setup. A two-arm study compares a mean endpoint between treatment and control. The candidate design enrolls two participants per arm. The generating assumptions for this illustration are independent normal measurements with a common variance; the analysis estimates the treatment-minus-control difference by subtracting the two sample means and uses the pooled-variance standard error.

Suppose one simulated trial produces treatment measurements 12 and 14 units, and control measurements 9 and 11 units. The treatment mean is \((12+14)/2=13\) units; the control mean is \((9+11)/2=10\) units. Thus the estimated treatment-minus-control difference is \(13-10=3\) units.

Within each arm, the deviations from its mean are \(-1\) and \(1\), so each arm has a sum of squared deviations of \(1+1=2\). The pooled variance estimate is \((2+2)/(2+2-2)=4/2=2\) square units. The standard error of the difference is \(\sqrt{2(1/2+1/2)}=\sqrt{2}=1.414\) units.

This is one complete pass through the analysis for one simulated trial. The result is a difference estimate of 3 units with standard error 1.414 units. The calculation relies on independent observations and a common variance for the pooled-variance formula. It does not show that the generating assumptions hold in a real study, nor does it establish the average performance of the candidate design. Those questions require checking assumptions and summarizing results over repeated simulated trials.

Compare Prespecified Measures, Not Just Appealing Outputs

For a parameter with known generating value \(\theta\), an estimate \(\hat{\theta}_r\) from replicate \(r\) can be compared with that value. Across \(R\) replicates, one simple summary is the average signed error, \(\sum_{r=1}^{R}(\hat{\theta}_r-\theta)/R\). Another is the root mean squared error, the square root of the average squared error. A team may also define a practical criterion, such as an estimate within a specified distance of \(\theta\). These summaries answer different questions and should not be interchanged.

For each measure, keep the direction of preference clear. Smaller estimation error may be desirable, while a larger proportion meeting a practical criterion may be desirable. If computational burden or feasibility matters, include an appropriate measure rather than assuming statistical performance alone decides the design. Report the number of simulated trials and describe how unusable analyses are handled so that readers can understand what the summaries represent.

Worked Example: Compare Replicate-Level Estimation Errors

Hypothetical setup. Two candidate designs are assessed using five simulated trials each. The target parameter is \(\theta=10\) units. The estimates from Candidate A are 8, 9, 10, 11, and 12 units; those from Candidate B are 9, 10, 10, 11, and 10 units. For illustration, compare average signed error, root mean squared error, and the proportion of estimates no more than 1 unit from the target.

For A, the errors are \(-2,-1,0,1,2\) units. Their sum is zero, so average signed error is \(0/5=0\) units. The squared errors sum to \(4+1+0+1+4=10\) square units, giving root mean squared error \(\sqrt{10/5}=\sqrt{2}=1.414\) units. Three of the five estimates (9, 10, and 11) are within 1 unit of the target, so the proportion is \(3/5=0.600\), or 60.0%.

For B, the errors are \(-1,0,0,1,0\) units. Their sum is also zero, so average signed error is \(0/5=0\) units. The squared errors sum to \(1+0+0+1+0=2\) square units, giving root mean squared error \(\sqrt{2/5}=\sqrt{0.4}=0.6325\) units. All five estimates are within 1 unit of the target, so the proportion is \(5/5=1.00\), or 100%.

On these three illustrative measures, B has lower root mean squared error and a higher proportion within 1 unit, while the average signed errors are equal. But five replicates are far too few for a dependable general comparison: these figures demonstrate the calculation, not a recommendation. A real study should use enough replicates for summaries to be stable and should consider the practical importance of each measure.

Diagnostics, Alternatives, and Limitations

Warning signs include results that are identical across designs despite meaningful design differences, implausible simulated values, analysis failures that are omitted from summaries, and conclusions that change when the implementation is checked. Examine distributions of outputs as well as averages: a favorable average can hide a substantial number of extreme estimates or failed analyses. Keep a record of the assumptions and code settings needed to reproduce the comparison.

Simulation is not the only design tool. Analytical calculations can be more efficient and transparent when a simple model yields a relevant exact or approximate result, as in the standard-error calculation above. Pilot data can help inform plausible ranges of inputs, although a pilot does not remove uncertainty about those inputs. Simulation is most useful when features of the design or analysis make a direct calculation difficult, or when several outcomes and operational constraints must be examined together. These approaches can complement one another.

A simulation study cannot compensate for a poorly chosen generating model. If important sources of variation, design constraints, or analysis failures are absent, a large number of replicates only makes the results more precise for the incomplete assumptions. It is also possible to overinterpret a ranking: a candidate that performs better under one set of assumptions may not do so under another. State the scope of the conclusions, and avoid treating simulated performance as an empirical guarantee.

Common Pitfall

Common mistake: “Candidate B had a better average estimate in the first few simulations, so B is the better design.”

Correction: A few simulated trials are noisy examples, not a stable design comparison. Use the same prespecified generating assumptions, analysis pipeline, and performance measures for each candidate; repeat the workflow sufficiently, check failures, and interpret the results as conditional on those assumptions.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. In a design comparison, what is the difference between the data-generating model and the analysis method?
  2. Under independent observations with variance \(16\) square units, what is the standard error of a sample mean for \(n=25\)?
  3. A simulated analysis fails to return an estimate. Should the replicate be silently removed from the comparison? Explain.
  4. For estimates 8, 10, and 12 of a target value 10, calculate the average signed error and the root mean squared error.
  5. Why is a simulation result not a guarantee of performance in a real trial?

Solutions. (1) The generating model specifies how simulated trial data arise; the analysis method specifies how those data are processed to produce the planned result. They can differ, but any difference should be intentional and stated. (2) The standard error is \(4/\sqrt{25}=0.800\) units, since the standard deviation is \(\sqrt{16}=4\) units. (3) No. The failure should be recorded and handled according to a rule specified before comparing results; silently removing it can conceal poor performance. (4) The errors are \(-2,0,2\) units, so average signed error is \((-2+0+2)/3=0\) units. The squared errors average \((4+0+4)/3=8/3\) square units, so root mean squared error is \(\sqrt{8/3}=1.633\) units. (5) The result is conditional on the generating assumptions and implementation. Real data may arise under conditions the simulation did not represent.

Clinical Biostats