Description Usage Arguments Details Value Author(s) References Examples
pwr.mdn
Compute power of tests related to mediation analysis or sample size to achieve desired power.
1 |
a |
specified value for coefficient a |
b |
specified value for coefficient b |
c.p |
specified value for coefficient c' |
tau1 |
specified value of the ratio of residual variance of mediator M to the variance of the treatment X |
tau2 |
specified value of the ratio of residual variance of outcome Y to the variance of the treatment X |
n |
the sample size available. Either |
power |
a value specifying the desired power. Either |
alpha |
specified significance level |
This model is for the basic three-factor model. If coefficients are standardized, then τ_1=1-a^2 and τ_2=1-(c')^2-b^2-2abc'.
A 2\times 5 matrix
Kai Wang <kai-wang@uiowa.edu>
Wang, K. (2018) Understanding power anomalies in mediation analysis. Psychometrika 83 (2), 387-406.
1 2 3 4 5 6 7 8 9 10 11 12 13 | n = 100
X = rnorm(n)
s2X = mean((X-mean(X))^2)
a=0.3
b=0.3
c.p = a*b
pwr.mdn(a, b, c.p, 1/s2X, 1/s2X, alpha=0.05, power=0.8)
pwr.mdn(a, b, c.p, 1/s2X, 1/s2X, alpha=0.05, n=200)
## Using standardized coefficients
pwr.mdn(a, b, c.p, 1-a^2, 1-c.p^2-b^2-2*a*b*c.p, alpha=0.05, power=0.8)
pwr.mdn(a, b, c.p, 1-a^2, 1-c.p^2-b^2-2*a*b*c.p, alpha=0.05, n=200)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.