Simple Slope Calculation for Linear Regression
sslope varlist [if exp] [in range] , [i(x z xz)] [i(x z w xz xw zw xzw)] [i(x x-squared)] [i(x z x-squared xz)] [i(z x x-squared xz)] [sd(#)] [Graph] or [go(graph options)] [Fits]
varlist = regression equation with centered variables including all interactions
option i must include either (x z xz) (2-way interaction), gives slope of criterion variable on x at levels of z (x z xz are variable names)
OR
(x z w xz xw zw xzw) (3-way interaction), gives slope of criterion variable on x at levels of z and w
OR
(x x-squared) (quadratic), gives slope of criterion variable on x at levels of x. Also calculates the minimum or maximum of the curve.
OR
(x z x-squared xz) (quadratic plus linear interaction), gives slope of criterion variable on x at levels of x and z. Also calculates the minumum or maximum of the curves.
OR
(z x x-squared xz) (quadratic plus linear interaction), gives slope of criterion variable on z at levels of x.
Description
This calculates simple slopes for interactions between continuous variables in linear regression analysis. For example, the slope of the criterion on x conditional upon z. All continuous variables in the regression must be centered at the mean. The simple slope of interest must be specified in i. This must be of the form x(slope of interest) z(moderating variable) xz(the interaction between the two). Hence, i(x z xz) provides a different result than i(z x xz). Both are correct, one is the slope of y on x conditional upon z and the other, the slope of y on z conditional upon x. However, i(x xz z) will produce incorrect results. Similarly, for a three-way interaction, i must be in the form of (x z w xz xw zw xzw) for the slope of x conditional upon z and w. Important, the order i(x z w xz wz xw xzw) will not produce the correct results. The order is x (slope of interest) z w (first order terms of the moderators) x^2 (x quadratic term) xz xw (2-way interactions with x) zw (the 2-way interaction of the moderators without x) xzw (the three way interaction). The order of variables in varlist does not matter but calculations of the simple slopes depend upon the specified order in i. Simple slopes associated with both an interaction and a quadratic term (i.e., y on x when there are both xz and x-squared terms) are not supported at this time. The calculations are based upon the formulas provided in Aiken & West (1991).
Options
sd(#) specifies the conditional levels of interest of z and/or w, in sd units, default = 1.0.
Graph requests a graph of the conditional slopes. Continuous variables not included in the interaction are held constant at mean=0, if there are dichotomous variables in the model, this option creates graphs for a category=0, if there is not a category=0, the intercepts will be invalid.
go requests a graph as above, but accepts all standard graph options for scatter. Choose either Graph for the default graph OR go and define graph options.
Fits requests the conditional fitted values be saved. This is included to facilitate making additional graphs.
Examples
sslope y x z xz, i(x z xz) sslope y x z xz, i(x z xz) sd(2) sslope y x z w xz xw zw xzw, i(x z w xz xw zw xzw) sslope y q x z w xz, i(x z xz) sslope y x x-squared, i(x x-squared) graph sslope y x z x-squared, i(x x-squared) graph fits sslope y x q z xz x-squared, i(x z x-squared xz) go(sort c(. l l l) m(o i i i) > mlabel(id)) fits
sslope dialog box
Author
Jeffrey S. Simons - jsimons@usd.edu
Also see
mcenter