Calculate p-value and confidence interval for testing mediation effect based on Sobel's test.
testMediation.Sobel(theta.1.hat,
lambda.hat,
sigma.theta1,
sigma.lambda,
alpha = 0.05)
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)\)).
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})\)).
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)\)).
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})\)).
significance level of a test.
p-value for testing the null hypothesis \(\theta_1\lambda=0\) versus the alternative hypothesis \(\theta_{1a}\lambda_a\neq 0\).
Lower bound of the \(100 (1-\alpha)\%\) confidence interval for the parameter \(\theta_1\lambda\).
Upper bound of the \(100 (1-\alpha)\%\) confidence interval for the parameter \(\theta_1\lambda\).
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}\).
Sobel, M. E. Asymptotic confidence intervals for indirect effects in structural equation models. Sociological Methodology. 1982;13:290-312.
# NOT RUN {
testMediation.Sobel(theta.1.hat=0.1701, lambda.hat=0.1998,
sigma.theta1=0.01, sigma.lambda=0.02, alpha=0.05)
# }
Run the code above in your browser using DataLab