testMediation.Sobel {powerMediation}R Documentation

P-value and confidence interval for testing mediation effect (Sobel's test)

Description

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

Usage

testMediation.Sobel(theta.1.hat, lambda.hat, 
  sigma.theta1, sigma.lambda, alpha=0.05)

Arguments

theta.1.hat estimated regression coefficient for the predictor in the linear regression linking the predictor x to the mediator m (m_i=\theta_0+\theta_1 x_i + e_i, e_i\sim N(0, \sigma^2_e)).
lambda.hat estimated regression coefficient for the mediator in the linear regression linking the predictor x and the mediator m to the outcome y (y_i=\gamma+\lambda m_i+ \lambda_2 x_i + \epsilon_i, \epsilon_i\sim N(0, \sigma^2_{\epsilon})).
sigma.theta1 standard deviation of \hat{\theta}_1 in the linear regression linking the predictor x to the mediator m (m_i=\theta_0+\theta_1 x_i + e_i, e_i\sim N(0, \sigma^2_e)).
sigma.lambda standard deviation of \hat{\lambda} in the linear regression linking the predictor x and the mediator m to the outcome y (y_i=\gamma+\lambda m_i+ \lambda_2 x_i + \epsilon_i, \epsilon_i\sim N(0, \sigma^2_{\epsilon})).
alpha significance level of a test.

Details

The test is for testing the null hypothesis \theta_1\lambda=0 versus the alternative hypothesis \theta_{1a}\lambda_a\neq 0 for the linear regressions:

m_i=\theta_0+\theta_1 x_i + e_i, e_i\sim N(0, \sigma^2_e)

y_i=\gamma+\lambda m_i+ \lambda_2 x_i + \epsilon_i, \epsilon_i\sim N(0, \sigma^2_{\epsilon})

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

Z=\frac{\hat{\theta}_1\hat{\lambda}}{\hat{\sigma}_{\theta_1\lambda}}

where \hat{\sigma}_{\theta_1\lambda} is the estimated standard deviation of the estimate \hat{\theta}_1\hat{\lambda} using multivariate delta method:

\sigma_{\theta_1\lambda}=\sqrt{\theta_1^2\sigma_{\lambda}^2+\lambda^2\sigma_{\theta_1}^2}

and \hat{\sigma}_{\theta_1} is the estimated standard deviation of the estimate \hat{\theta}_1, and \hat{\sigma}_{\lambda} is the estimated standard deviation of the estimate \hat{\lambda}.

Value

pval p-value for testing the null hypothesis \theta_1\lambda=0 versus the alternative hypothesis \theta_{1a}\lambda_a\neq 0.
CI.low Lower bound of the 100 (1-\alpha)\% confidence interval for the parameter \theta_1\lambda.
CI.upp Upper bound of the 100 (1-\alpha)\% confidence interval for the parameter \theta_1\lambda.

Note

The test is a two-sided test. Code for one-sided tests will be added later.

Author(s)

Weiliang Qiu stwxq@channing.harvard.edu

References

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

See Also

powerMediation.Sobel, ssMediation.Sobel

Examples

  testMediation.Sobel(theta.1.hat=0.1701, lambda.hat=0.1998, 
    sigma.theta1=0.05, sigma.lambda=0.05, alpha=0.05)

[Package powerMediation version 0.0.6 Index]