powerMediation.VSMc(n, b2, sigma.m, sigma.e, corr.xm, alpha = 0.05,
verbose = TRUE)TRUE means printing power; FALSE means not printing power.Vittinghoff et al. (2009) showed that for the above linear regression, testing the mediation effect is equivalent to testing the null hypothesis $H_0: b_2=0$ versus the alternative hypothesis $H_a: b_2\neq 0$.
minEffect.VSMc,
ssMediation.VSMcpowerMediation.VSMc(n=100, b2=0.8, sigma.m=0.1, sigma.e=0.2, corr.xm=0.5,
alpha = 0.05, verbose = TRUE)Run the code above in your browser using DataLab