Learn R Programming

ivmodel (version 1.9.1)

TSLS.power: Power of TSLS Estimator

Description

TSLS.power computes the power of the asymptotic t-test of TSLS estimator.

Usage

TSLS.power(n, beta, rho_ZD, sigmau, sigmaDsq, alpha = 0.05)

Value

Power of the asymptotic t-test of TSLS estimator basd on given values of parameters.

Arguments

n

Sample size.

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.

Author

Yang Jiang, Hyunseung Kang, and Dylan Small

Details

The power formula is given in Freeman (2013).

References

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

See also ivmodel for details on the instrumental variables model.

Examples

Run this code
# Assume we calculate the power of 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). 

# Suppose the difference between the null hypothesis and true causal
# effect is 1 (beta=1).
# The sample size is 250 (n=250). 
# 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.

# power of asymptotic t-test of TSLS estimator
TSLS.power(n=250, beta=1, rho_ZD=.5, sigmau=1, sigmaDsq=1, alpha = 0.05)

Run the code above in your browser using DataLab