Jason T. Newsom PhD

Professor, Department of Psychology, Portland State University

 

 

 

 

Main Page

 

Current Courses

Categorical Data Analysis

Structural Equation Modeling

Multilevel Regression

Psychological Measurement

Adult Development and Aging

 

Past Courses

Stats Notes

 

Resources

SEM References

SEM Books

 

Other

LSEM Book

LDA Book

Department of Psychology

 

 

 

 

 

 

Macros

 

 

Simple1.sps (SPSS for Windows, now works for all versions through SPSS 27) SPSS macro for testing the interaction between two continuous variables and calculating simple slopes. The macro centers two predictors for a two-way interaction, computes the product term, runs a regression analysis to test the interaction, calculates the correct standardized coefficient for the interaction, calculates simple slopes at -1 SD, the mean, and +1SD, tests them for significance, and plots them. Instructions on how to use it are contained in a comment box at the beginning of the macro.

 

Instructions:

1. Download the SPSS syntax file simple1.sps containing the macro and store it on your hard drive. (You may open this file like any other syntax file and read the instructions. The macro does not need to be open to use it, however). Do not alter it.

2. Start a syntax file or add to an existing one.

4. Open your data file or add a get file command to access your data.

3. Create three variables, x, z, and y from your existing variables via menus or syntax as in the example below. The macro will test and plot simple slopes for x predicting y at three values of z (-1 SD below its mean, its mean, +1 SD above its mean).

 

COMPUTE X=independent variable name.

COMPUTE Z=moderator variable name.

COMPUTE Y=dependent variable name.

 

4. Add the following three lines of syntax, filling in the desired locations on your computer. Include covariates if desired. If not, just put a period after the equal sign.

 

CD 'file path for saving temporary files/'.

INCLUDE 'file path for macro/simple1.sps'.

SIMPLE1 VARS=covariate variable names if desired.

 

5. Highlight and run.

 

Problems? See trouble shooting notes before emailing me.  This macro was designed for SPSS for Windows operating systems but according to reports often works on Mac versions as well. On Mac, path file locations usually look like: /Users/yourusername/spssfiles/. An example can be found at http://web.pdx.edu/~newsomj/mvclass/ho_moderation.pdf.

 

Simple2.sps. (SPSS for Windows only, now works for all versions through SPSS 27) An SPSS macro for testing the interaction between a continuous and a dichotomous variable and calculating simple slopes. This macro can be accessed with two simple lines in any syntax file. It centers the continuous predictor for a two-way interaction, computes the product term, runs a regression analysis to test the interaction, calculates the correct standardized coefficient for the interaction, calculates simple slopes at 0 and 1 of the moderator, tests them for significance, plots them, and calculates DeShon and Alexander's homogeneity ratio. Instructions on how to use it are below and contained in a comment box at the beginning of the macro. A few lines of syntax are needed to call the macro and execute it.

 

Instructions:

1. Download the SPSS syntax file simple2.sps containing the macro and store it on your hard drive. (You may open this file like any other syntax file and read the instructions. The macro does not need to be open to use it, however). Do not alter it.

2. Start a syntax file or add to an existing one.

4. Open your data file or add a get file command to access your data.

3. Create three variables, x, z, and y from your existing variables via menus or syntax as in the example below. The macro will test and plot simple slopes for x predicting y at two values of z. The moderated z must be coded 0 and 1.

 

COMPUTE X=independent variable name.

COMPUTE Z=moderator variable name.

COMPUTE Y=dependent variable name.

 

4. Add the following three lines of syntax, filling in the desired locations on your computer. Include covariates if desired. If not, just put a period after the equal sign.  Note that file path for saving temporary files/ must be a location you are authorized to save to on your computer.

 

CD 'file path for saving temporary files/'.

INCLUDE 'file path for macro/simple1.sps'.

SIMPLE2 VARS=covariate variable names if desired.