PSpower | R Documentation |
Calculate sample size needed to achieve a prespecified power
PSpower(
tau,
sig.level = 0.05,
power = NULL,
sample.size = NULL,
r,
phi,
rho_sq,
test = "two-sided",
estimand = "ATE"
)
tau |
the anticipated standardized treatment effect |
sig.level |
the significance level, or the type-I error rate (default 0.05) |
power |
the desired power to achieve (only specify for sample size calculation) |
sample.size |
the total sample size (only specify for power calculation) |
r |
the proportion of treated units |
phi |
the overlap coefficient (usually between 0.8 and 1); use function plot_overlap(r, phi) for visual aid |
rho_sq |
the squared correlation between propensity score and outcome; recommend treating as a sensitivity parameter: a grid of values between 0 and the R-squared statistic of predicting the outcomes with covariates. |
test |
whether one-sided or two-sided test is considered |
estimand |
the estimand (ATE, ATT, ATC or ATO), or a customized tilting function h(e(x)) |
an object with the calculated sample size
PSpower(tau = 1/sqrt(20), sig.level = 0.05, power = 0.956, r = 0.5, phi = 0.99, rho_sq = 0.02)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.