TSLS.size | R Documentation |
TSLS.size
computes the minimum sample size required for achieving certain power of asymptotic t-test of TSLS estimator.
TSLS.size(power, beta, rho_ZD, sigmau, sigmaDsq, alpha = 0.05)
power |
The desired power over a constant. |
beta |
True causal effect minus null hypothesis causal effect. |
rho_ZD |
Correlation between the IV Z and the exposure D. |
sigmau |
Standard deviation of potential outcome under control. (structural error for y) |
sigmaDsq |
The variance of the exposure D. |
alpha |
Significance level. |
The calculation is based on inverting the power formula given in Freeman (2013).
Minimum sample size required for achieving certain power of asymptotic t-test of TSLS estimator.
Yang Jiang, Hyunseung Kang, and Dylan Small
Freeman G, Cowling BJ, Schooling CM (2013). Power and Sample Size Calculations for Mendelian Randomization Studies Using One Genetic Instrument. International journal of epidemiology, 42(4), 1157-1163.
See also ivmodel
for details on the instrumental variables model.
# Assume we performed an asymptotic t-test of TSLS estimator in a study
# with one IV (l=1) and the only one exogenous variable is the intercept
# (k=1). We want to calculate the minimum sample size needed for this
# test to have an at least 0.8 power.
# Suppose the null hypothesis causal effect is 0 and the true causal
# effect is 1 (beta=1-0=1).
# The correlation between the IV and exposure is .5 (rho_ZD= .5).
# The standard deviation of potential outcome is 1(sigmau= 1).
# The variance of the exposure is 1 (sigmaDsq=1).
# The significance level for the study is alpha = .05.
### minimum sample size required for aysmptotic t-test
TSLS.size(power=.8, beta=1, rho_ZD=.5, sigmau=1, sigmaDsq=1, alpha =.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.