R/statpsych2.R
ci.condslope.Rd
Computes confidence intervals and test statistics for population conditional slopes (simple slopes) in a general linear model that includes a predictor variable (x1), a moderator variable (x2), and a product predictor variable (x1*x2). Conditional slopes are computed at specified low and high values of the moderator variable.
ci.condslope(alpha, b1, b2, se1, se2, cov, lo, hi, dfe)
alpha level for 1-alpha confidence
estimated slope coefficient for predictor variable
estimated slope coefficient for product variable
standard error for predictor coefficient
standard error for product coefficient
estimated covariance between predictor and product coefficients
low value of moderator variable
high value of moderator variable
error degrees of freedom
Returns a 2-row matrix. The columns are:
Estimate - estimated conditional slope
t - t test statistic
p - p-value
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
ci.condslope(.05, .132, .154, .031, .021, .015, 5.2, 10.6, 122)
#> Estimate SE t df p LL
#> At low moderator 0.9328 0.4109570 2.269824 122 0.024973618 0.1192696
#> At high moderator 1.7644 0.6070517 2.906507 122 0.004342076 0.5626805
#> UL
#> At low moderator 1.746330
#> At high moderator 2.966119
# Should return:
# Estimate SE t df p
# At low moderator 0.9328 0.4109570 2.269824 122 0.024973618
# At high moderator 1.7644 0.6070517 2.906507 122 0.004342076
# LL UL
# At low moderator 0.1192696 1.746330
# At high moderator 0.5626805 2.966119