This function takes the parameter estimates and covariances and performs the Sobel test for one mediator, or a single mediator path for multiple unordered mediators.
sobelTest_one(
mu1,
sig1,
mu2,
sig2,
sig12,
indL = 1,
mu3 = 0L,
sig3 = 0L,
sig13 = 0L,
sig23 = 0L,
mu1_0 = 0,
mu2_0 = 0,
mu3_0 = 0
)A p-value for the test for the indirect effect.
Value of the estimate of the independent variable on the mediator.
Value of the variance of the estimate of the independent variable on the mediator.
Value of the estimate of the mediator on the response.
Value of the variance of the estimate of the mediator on the response.
Value of the covariance between mu1 and mu2.
Value indicating the value of the independent variable used for the interaction. Typically 1.
Value of the estimate of the effect of the interaction of the independent and mediator variable on the response.
Value of the variance of the estimate of the effect of the interaction of the independent and mediator variable on the response.
Value of the covariance between mu1 and mu3.
Value of the covariance between mu2 and mu3.
Null value for mu1.
Null value for mu2.
Null value for mu3.
sobelTest_one(1, .1, .25, .01, .05)
Run the code above in your browser using DataLab