Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/powerMediation.R

Calculate p-value and confidence interval for testing mediation effect based on Sobel's test.

1 2 3 4 5 | ```
testMediation.Sobel(theta.1.hat,
lambda.hat,
sigma.theta1,
sigma.lambda,
alpha = 0.05)
``` |

`theta.1.hat` |
estimated regression coefficient for the predictor in the linear regression linking
the predictor |

`lambda.hat` |
estimated regression coefficient for the mediator in the linear regression linking
the predictor |

`sigma.theta1` |
standard deviation of |

`sigma.lambda` |
standard deviation of |

`alpha` |
significance level of a test. |

The test is for testing the null hypothesis *θ_1λ=0*
versus the alternative hypothesis *θ_{1a}λ_a\neq 0*
for the linear regressions:

*
m_i=θ_0+θ_1 x_i + e_i, e_i\sim N(0, σ^2_e)*

*
y_i=γ+λ m_i+ λ_2 x_i + ε_i, ε_i\sim N(0, σ^2_{ε})
*

Test statistic is based on Sobel's (1982) test:

*
Z=\frac{\hat{θ}_1\hat{λ}}{\hat{σ}_{θ_1λ}}
*

where *\hat{σ}_{θ_1λ}* is the estimated standard deviation
of the estimate *\hat{θ}_1\hat{λ}* using multivariate
delta method:

*
σ_{θ_1λ}=√{θ_1^2σ_{λ}^2+λ^2σ_{θ_1}^2}
*

and
*\hat{σ}_{θ_1}* is the estimated standard deviation
of the estimate *\hat{θ}_1*, and
*\hat{σ}_{λ}* is the estimated standard deviation
of the estimate *\hat{λ}*.

`pval ` |
p-value for testing the null hypothesis |

`CI.low ` |
Lower bound of the |

`CI.upp ` |
Upper bound of the |

The test is a two-sided test. For one-sided tests, please double the
significance level. For example, you can set `alpha=0.10`

to obtain one-sided test at 5% significance level.

Weiliang Qiu stwxq@channing.harvard.edu

Sobel, M. E.
Asymptotic confidence intervals for indirect effects in structural equation models.
*Sociological Methodology*. 1982;13:290-312.

`powerMediation.Sobel`

,
`ssMediation.Sobel`

1 2 | ```
testMediation.Sobel(theta.1.hat=0.1701, lambda.hat=0.1998,
sigma.theta1=0.01, sigma.lambda=0.02, alpha=0.05)
``` |

```
$pval
[1] 0
$CI.low
[1] 0.02625328
$CI.upp
[1] 0.04171868
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.