Skip to contents

Specify the world

Describe the data-generating process the study will sample from.

pa_var()
Declare a variable of the data-generating process
ape_dgp()
Specify the data-generating process for an APE/AIE power analysis
ape_dgp_empirical()
Specify a DGP with covariates resampled from pilot data
ape_dgp_from_fit()
Specify a DGP from a fitted pilot model
ape_dgp_panel()
Specify a panel DGP: correlated random effects probit
ape_dgp_iv()
Specify an IV DGP: endogenous focal, control-function probit

Pin the effect

Solve coefficients from targets in APE/AIE units.

set_ape()
Pin the true APE of a DGP (inversion step)
set_aie()
Pin the true AIE of a moderated DGP (inversion step)
true_ape()
Recompute the true APE implied by a pinned DGP
true_aie()
Recompute the true AIE implied by a pinned DGP

Power

Simulated power, curves, required sample sizes, detectable effects.

ape_power()
Simulated power for an APE/AIE claim at a given sample size
ape_curve() plot(<powerape_curve>)
Power curve over a grid of sample sizes
ape_n()
Required sample size for a target power
ape_mde()
Minimum detectable APE/AIE at a given sample size

Justified error rates

Alpha by sample-size rule or by error costs, from one stored simulation.

power_at()
Power at other error rates from one stored simulation
ape_alpha() plot(<powerape_alpha>)
Justify the error rate: minimize or balance weighted Type I and Type II errors
alpha_frontier()
Closed-form justified alpha at the detectability frontier

Robustness and reporting

ape_robust()
Robustness sweep over contextual assumptions (worst-case power and n_max)
power_statement()
Render a power analysis as a citable methods paragraph