power_ps: Sample size and power for PS-weighted average treatment...

View source: R/power_ps.R

power_psR Documentation

Sample size and power for PS-weighted average treatment effect estimators

Description

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.

Usage

power_ps(
  effect_size,
  r,
  phi,
  rho2 = 0,
  estimand = "ATE",
  sig_level = 0.05,
  power = NULL,
  sample_size = NULL,
  test = "two-sided"
)

Arguments

effect_size

Standardized effect size \tilde{\tau} = \tau / S, where \tau is the treatment effect and S = \sqrt{\mathrm{Var}(Y(0))}. Scalar or vector.

r

Treatment proportion r = \Pr(Z = 1), in (0, 1). Scalar or vector.

phi

Overlap coefficient \phi \in (0, 1), measuring covariate similarity between groups. Rule of thumb: < 0.80 very poor, [0.80, 0.90) poor, [0.90, 0.95) moderate, \ge 0.95 good. Scalar or vector.

rho2

Confounding coefficient \rho^2 \in [0, 1), the squared correlation between the potential outcome and the propensity score linear predictor. Bounded above by the R^2 of regressing the outcome on covariates. Sensitivity analysis over \rho^2 \in [0, 0.05) is recommended. Default 0. Scalar or vector.

estimand

Target estimand. One of "ATE" (average treatment effect), "ATT" (average treatment effect for group 1), "ATC" (average treatment effect for group 0), "ATO" (average treatment effect for the overlap population), or a custom tilting function h(e) (must be a scalar function, not vectorized with other parameters). Scalar or character vector.

sig_level

Significance level \alpha. Default 0.05.

power

Target power \beta. Provide for sample size calculation; mutually exclusive with sample_size.

sample_size

Total sample size N. Provide for power calculation; mutually exclusive with power.

test

"two-sided" (default) or "one-sided".

Details

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.

Value

An object of class "power_ps", a list containing:

call

The matched call.

calculation

"sample_size" or "power".

result

A 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.

settings

A list with sig_level, power, sample_size, and test.

n_scenarios

Number of rows in result.

rho2_is_default

Logical; TRUE when rho2 was left at its default value of 0.

References

Bo Liu, Chengxin Yang, and Fan Li. Sample size and power calculations for causal inference in observational studies. Annals of Statistics (2026), forthcoming.

See Also

power_cox, overlap_coef

Examples

# 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)


PSpower documentation built on May 14, 2026, 9:07 a.m.