Reproducible analysis template
Purpose
Public preview: This page shows the analysis output,
figures, diagnostics, and reporting guidance without exposing the R
code. The paid version includes the complete editable R Markdown
source, reusable functions, all analysis code, synthetic data,
documentation, and exported results.
This workflow turns a dissertation question into a transparent
sample-size and recruitment plan. It combines prospective power, minimum
detectable effects, precision, attrition adjustment, clustered and
longitudinal designs, and simulation-based planning. The goal is not one
authoritative number. The goal is a defensible set of scenarios whose
assumptions can be examined, revised, and reported.
Plan the analysis you will run. A power calculation is
only as relevant as the estimand, model, decision rule, outcome scale,
dependence structure, missing-data process, and effect assumptions it
represents. Generic conventions and software defaults are not
substitutes for design reasoning.
Learning outcomes
After completing the workflow, users should be able to:
- distinguish prospective power, design sensitivity, and precision
planning;
- express a smallest effect of interest in original and standardized
units;
- document evidence and uncertainty for every planning
assumption;
- translate analyzable sample size into a staged recruitment
target;
- plan individual-level, clustered, longitudinal, and indirect-effect
analyses;
- create power, precision, and sensitivity displays rather than report
one number;
- quantify Monte Carlo uncertainty in simulation-based power; and
- generate dissertation-ready planning language with explicit
limitations.
User settings
Planning intake and assumptions
register
Define the target
Before calculating sample size, complete
Templates/planning-intake.csv. The focal parameter should
match the planned dissertation claim. An omnibus test does not plan a
specific interaction, indirect effect, simple contrast, or subgroup
comparison.
Assumptions register for the worked examples
| Primary effect |
3.00 |
NA |
NA |
User supplied |
Define in original outcome units before
standardizing |
Required |
| Outcome SD |
10.00 |
NA |
NA |
Prior study or pilot |
Use a range when the estimate is uncertain |
Required |
| Alpha |
0.05 |
0.01 |
0.05 |
Analysis plan |
Allocate across confirmatory tests if needed |
Required |
| Target power |
0.80 |
0.80 |
0.90 |
Analysis plan |
Not a universal adequacy threshold |
Required |
| Attrition rate |
0.15 |
0.05 |
0.30 |
Feasibility evidence |
Model stages separately where possible |
Required |
| Intraclass correlation |
0.08 |
NA |
NA |
Comparable studies |
Required for clustered designs |
Conditional |
Choose a planning mode
| Prospective power |
Effect, alpha, design |
Sample size or power |
Probability of the prespecified decision under the assumed
alternative |
| Sensitivity |
Feasible sample, alpha, power |
Minimum detectable effect |
Effects the proposed design is calibrated to detect |
| Precision |
Variability and target interval width |
Sample size |
Expected estimation precision |
| Simulation |
Full data-generating and analysis process |
Power, bias, failures |
Operating characteristics under explicit scenarios |
| Recruitment |
Analyzable requirement and loss stages |
Invitations or clusters |
Operational target under staged retention assumptions |
Do not calculate “observed power” from the final sample estimate.
Once results exist, report estimates and confidence intervals. A
completed design can be described using a prespecified sensitivity
analysis, but the result should not be used to rescue a nonsignificant
finding.
Basic-design reference scenarios
Illustrative basic-design calculations
| Correlation |
r = .20 |
194 |
Two-sided test |
| Two independent proportions |
60% versus 50% |
776 |
Equal group sizes |
| Balanced four-group ANOVA |
Cohen f = .25 |
180 |
Omnibus effect; plan focal contrasts separately |
These reference scenarios demonstrate the common analytic
calculators. Replace their conventional-looking values with a smallest
effect of interest and plausible nuisance parameters. For ANOVA, a focal
contrast or interaction normally deserves its own calculation or
simulation.
Example 1: Two-group intervention
Primary calculation
The first example plans a continuous posttest comparison adjusted for
baseline. The baseline-outcome correlation reduces residual variance
only when the planned analysis actually includes baseline appropriately
and the assumed relationship is realistic.
Two-group analyzable sample-size plan
| Two-group ANCOVA approximation |
Adjusted mean difference |
3 |
Outcome units |
0.05 |
0.8 |
123 |
123 |
246 |
Residual SD=8.352; standardized effect=0.359 |
Sensitivity curve

Precision comparison
Precision-based comparison
| Mean in outcome units |
10.0 |
1.50 |
171 |
| Proportion near .50 |
0.5 |
0.05 |
385 |
| Correlation near .30 |
0.3 |
0.10 |
320 |
Power and precision answer different questions. When both a
hypothesis test and an estimate must be useful, plan for the larger
requirement or explain the compromise.
Recruitment waterfall

Recruitment assumptions and expected counts
| Invited |
539 |
NA |
1.000 |
| Eligible |
458 |
0.85 |
0.850 |
| Consented |
321 |
0.70 |
0.595 |
| Baseline complete |
305 |
0.95 |
0.565 |
| Retained |
259 |
0.85 |
0.480 |
| Analytically usable |
246 |
0.95 |
0.456 |
A single unexplained attrition inflation hides important operational
assumptions. Eligibility, consent, baseline completion, retention, and
analytic usability should be supported separately.
Example 2: Incremental regression
Focal change in explained variance
Power plan for a focal predictor added after
covariates
| Multiple regression |
Incremental R-squared |
0.035 |
Delta R-squared |
0.05 |
0.8 |
178 |
Total R2=0.25; f2=0.047; predictors=8 |
Detectable-effect curve

Collinearity, measurement reliability, missing predictors, nonlinear
terms, interactions, and data-dependent variable selection can all
reduce effective information. A coefficient-level simulation is
preferable when the predictor distribution and covariance structure are
central.
Factorial interaction planning

Simulation-based factorial interaction power
| 20 |
80 |
0.070 |
0.018 |
200 |
| 40 |
160 |
0.145 |
0.025 |
200 |
| 60 |
240 |
0.160 |
0.026 |
200 |
| 80 |
320 |
0.305 |
0.033 |
200 |
| 100 |
400 |
0.325 |
0.033 |
200 |
Factorial plans should use plausible cell means or contrasts,
within-person correlations for repeated factors, allocation ratios,
multiplicity rules, and the exact interaction or planned contrast that
supports the dissertation claim.
Example 3: Students nested within
schools
Primary clustered plan
Clustered design plan
| Two-arm cluster trial |
Marginal mean difference |
3 |
Outcome units |
0.05 |
0.8 |
16 |
32 |
24 |
768 |
3.013 |
ICC=0.08; cluster-size CV=0.3 |
Cluster and student tradeoff

The design-effect approximation is a transparent starting point, not
the final word for few clusters, random slopes, binary outcomes,
treatment-by-context effects, informative cluster sizes, or complex
small-sample corrections. Those designs require a model-matched
simulation and a credible minimum number of clusters.
Example 4: Longitudinal and daily-diary
planning
Repeated change
Approximate longitudinal change plan
| Two-group longitudinal change |
Difference in change |
2.5 |
Outcome units |
0.05 |
0.8 |
328 |
4 |
SD change=8.05; within-person r=0.6 |
Correlation and attrition sensitivity

For daily diary studies, total records are not independent sample
size. The full simulation should vary people, planned days, compliance,
time-varying predictor variance, random slopes, serial dependence,
missing lags, and the exact mixed model. The included module is a
planning bridge to the existing Daily Diary product.
Daily-diary demonstration

Daily-diary simulation with Monte Carlo uncertainty
| 50 |
14 |
0.983 |
0.017 |
60 |
0 |
| 80 |
14 |
1.000 |
0.000 |
60 |
0 |
| 110 |
14 |
1.000 |
0.000 |
60 |
0 |
| 140 |
14 |
1.000 |
0.000 |
60 |
0 |
Example 5: Indirect effect by
simulation
Simulation power curve
Simulation-based indirect-effect power
| 100 |
0.184 |
0.025 |
250 |
0 |
| 200 |
0.748 |
0.027 |
250 |
0 |
| 300 |
0.948 |
0.014 |
250 |
0 |
| 400 |
0.992 |
0.006 |
250 |
0 |
| 500 |
1.000 |
0.000 |
250 |
0 |

This runnable demonstration uses a normal-theory indirect-effect
decision rule to keep rendering time practical. A final study-specific
plan should simulate the intended estimator and confidence interval,
measurement reliability, covariates, nonnormality, missingness, and
temporal design. The report must include replications, Monte Carlo
uncertainty, convergence failures, and the seed.
SEM global-fit planning
Illustrative SEM RMSEA-based planning scenarios
| 12 |
0.05 |
579 |
0.800 |
| 24 |
0.05 |
375 |
0.799 |
| 48 |
0.05 |
249 |
0.801 |
Global-fit power is not coefficient power. A dissertation whose claim
concerns a path, indirect effect, factor loading, invariance
restriction, or latent mean difference should plan that focal parameter
directly. SEM simulations should report convergence, improper solutions,
estimator, nonnormality, missingness, reliability, and model
misspecification.
Combined scenario summary
Primary planning scenarios
| S001 |
Two-group ANCOVA approximation |
Adjusted mean difference |
3.000 |
Outcome units |
0.05 |
0.8 |
246 |
2026-09-25 14:55:56.589281 |
123 |
123 |
Residual SD=8.352; standardized effect=0.359 |
NA |
NA |
NA |
NA |
NA |
| S002 |
Multiple regression |
Incremental R-squared |
0.035 |
Delta R-squared |
0.05 |
0.8 |
178 |
2026-09-25 14:55:56.589281 |
NA |
NA |
Total R2=0.25; f2=0.047; predictors=8 |
NA |
NA |
NA |
NA |
NA |
| S003 |
Two-arm cluster trial |
Marginal mean difference |
3.000 |
Outcome units |
0.05 |
0.8 |
768 |
2026-09-25 14:55:56.589281 |
NA |
NA |
ICC=0.08; cluster-size CV=0.3 |
16 |
32 |
24 |
3.013 |
NA |
| S004 |
Two-group longitudinal change |
Difference in change |
2.500 |
Outcome units |
0.05 |
0.8 |
328 |
2026-09-25 14:55:56.589281 |
NA |
NA |
SD change=8.05; within-person r=0.6 |
NA |
NA |
NA |
NA |
4 |
Dynamic dissertation-ready text
The planned two-group analysis tests an adjusted mean difference of 3
outcome points. Assuming an outcome standard deviation of 10, a
baseline-outcome correlation of 0.55, a two-sided alpha of 0.05, equal
allocation, and target power of 0.8, the analytic approximation requires
246 analyzable participants (123 per group). Under the
staged eligibility, consent, baseline-completion, retention, and
usability assumptions, the operational target is approximately
539 invitations. The sensitivity analysis shows that
this recommendation depends most strongly on the smallest effect of
interest and the baseline-adjusted residual variance.
For the clustered education example, a mean difference of 3 points,
outcome standard deviation of 12, ICC of 0.08, average cluster size of
24, and cluster-size coefficient of variation of 0.3 produced a planning
requirement of 32 schools and 768
students. This approximation should be replaced by a
model-specific simulation when the final cluster structure and analysis
are known.
Reporting checklist
- Identify the focal estimand, model, decision rule, alpha, sidedness,
and confirmatory status.
- Define the smallest effect of interest in original units before
translating it to a standardized effect.
- Cite or document the source and plausible range for every effect and
nuisance parameter.
- Present low, expected, and high scenarios rather than one exact
sample size.
- Separate analyzable sample size from invitations, consent,
retention, and usable-data targets.
- Respect clustering, repeated observations, allocation imbalance,
missingness, and multiplicity.
- Report simulation replications, seed, Monte Carlo uncertainty,
convergence failures, and inadmissible solutions.
- Explain whether the plan targets hypothesis-test power, effect
precision, or both.
- Recalculate the plan if the design, primary outcome, analysis model,
or decision rule changes.
- After data collection, report estimates and confidence intervals
rather than observed power.
When this workflow is not enough
Seek design-specific support for adaptive, sequential,
noninferiority, equivalence, diagnostic-accuracy, high-stakes
regulatory, rare-event, complex-survey, network, spatial,
intensive-time-series, mixture, or highly parameterized latent-variable
designs. Statistical power does not repair poor measurement,
confounding, selection bias, treatment contamination, weak manipulation,
or an analysis that does not answer the research question.
Export reusable outputs