This function takes the estimate of the effect of the independent variable on the mediator and the effect of the mediator on the effect as well as their variances and performs the S test. Alternative null hypothesis can be specified as well. Additionally, covariances of the parameters can be specified for cases involving missing data where the estimates may be correlated.
sTest_one(alpha, x1, s11, df1, x2, s22, df2, x10 = 0, x20 = 0, s12 = 0)Boolean True/False value of whether the test rejects the Null hypothesis
Significance level for the test of significance
Numeric value of the estimated first effect of interest
Numeric value of the estimated first effect variance
Degrees of freedom for estimate x1
Numeric value of estimated second effect of interest
Numeric value of the estimated second effect variance
Degrees of freedom for estimate x2. Often the same as x1
Optional numeric value of alternative null hypothesis value for the first effect
Optional numeric value of alternative null hypothesis value for the second effect
Specification of covariance between x1 and x2. Typically 0, but may be non-zero in the prescence of missing data
Berger, Roger L. Likelihood Ratio Tests and Intersection-Union Tests. Advances in Statistical Decision Theory and Applications, 2011.
sTest_one(0.05, .5, 1, 100, -.25, .1, 100)
Run the code above in your browser using DataLab