mlr.power {MatchLinReg} | R Documentation |
Power analysis for causal inference using linear regression
Description
Monte Carlo based calculation of study power for treatment effect estimation using linear regression on treatment indicator and adjustment covariates.
Usage
mlr.power(tr, Z.i = NULL, d, sig.level = 0.05, niter = 1000
, verbose = FALSE, idx = 1:length(tr), rnd = FALSE)
Arguments
tr |
Binary treatment indicator vector (1=treatment, 0=control), whose coefficient in the linear regression model is TE. |
Z.i |
Matrix of adjustment covariates included in linear regression. We must have |
d |
Standardized effect size, equal to treatment effect divided by standard deviation of generative noise. |
sig.level |
Significance level for rejecting null hypothesis. |
niter |
Number of Monte Carlo simulations used for calculating power. |
verbose |
If |
idx |
Subset of observations to use for power calculation. |
rnd |
Boolean flag. If |
Details
In each Monte Carlo iteration, response variable is generated from a normal distribution whose mean is equal to d * tr
(other coefficients are assumed to be zero since their value does not affect power calculation), and whose standard deviation is 1.0
. Then OLS-based regression is performed on data, and p-value for treatment effect is compared to sig.level
, based on which null hypothesis (no effect) is rejected or accepted. The fraction of iterations where null hypothesis is rejected is taken to be power. Standard error is calculated using a binomial-distribution assumption.
Value
A numeric vector is returned. If rnd
is FALSE
, meand and standard error of calculated power is returned. If rnd
is TRUE
, mean and standard error of power calculated for random subsampling of observations is returned as well.
Author(s)
Alireza S. Mahani, Mansour T.A. Sharabiani