| power_ps | R Documentation |
The required sample size is
N = \bar{V}\,(z_{1-\alpha/2} + z_{\beta})^2 \,/\, \tilde{\tau}^2,
where \tilde{\tau} is the standardized effect size and
\bar{V} is the asymptotic variance of the Hajek estimator.
For the ATE estimand, \bar{V} has the closed form
\bar{V} = 2\!\left\{1 + \bigl(\rho^2\sigma_e^2+1\bigr)
\exp\!\bigl(\sigma_e^2/2\bigr)\cosh(\mu_e)\right\},
where (\mu_e,\,\sigma_e^2) are uniquely determined by (r,\phi).
For the ATT, ATC, and ATO estimands, \bar{V} is computed
by numerical integration of the same variance expression with the
corresponding tilting function h(e). A custom tilting function may
also be supplied.
For binary outcomes, the estimand is the risk difference; the same formula
applies with S^2 = \mathrm{Var}(Y(0)) estimated from a linear
probability model.
power_ps(
effect_size,
r,
phi,
rho2 = 0,
estimand = "ATE",
sig_level = 0.05,
power = NULL,
sample_size = NULL,
test = "two-sided"
)
effect_size |
Standardized effect size |
r |
Treatment proportion |
phi |
Overlap coefficient |
rho2 |
Confounding coefficient |
estimand |
Target estimand. One of |
sig_level |
Significance level |
power |
Target power |
sample_size |
Total sample size |
test |
|
Computes the required sample size or the achieved power for the propensity-score-weighted Hajek estimator of a weighted average treatment effect (WATE) with continuous or binary outcomes.
An object of class "power_ps", a list containing:
callThe matched call.
calculation"sample_size" or "power".
resultA data frame with one row per scenario (all
combinations of vector inputs) and columns for every design parameter
plus the computed sample_size or power.
settingsA list with sig_level, power,
sample_size, and test.
n_scenariosNumber of rows in result.
rho2_is_defaultLogical; TRUE when rho2
was left at its default value of 0.
Bo Liu, Chengxin Yang, and Fan Li. Sample size and power calculations for causal inference in observational studies. Annals of Statistics (2026), forthcoming.
power_cox, overlap_coef
# Sample size for ATE, scalar inputs
power_ps(effect_size = 0.2, r = 0.5, phi = 0.9, power = 0.8)
# Power at a fixed N
power_ps(effect_size = 0.2, r = 0.5, phi = 0.9, sample_size = 250)
# Sensitivity over r and estimand (vector inputs)
power_ps(effect_size = 0.2, r = c(0.3, 0.5, 0.7), phi = 0.9,
estimand = c("ATE", "ATO"), power = 0.8)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.