IBM Support

Testing the equality of regression slopes among groups

Troubleshooting


Problem

How can I test whether the regression slopes for different groups are equal?

Resolving The Problem

To see how this is done, let's consider an example, in which we model the effects of GPA on starting salary for graduates from three different colleges within a university (i.e., business, engineering, and liberal arts).

You can build the basic command syntax using the menus, paste the syntax into an SPSS Syntax Editor Window, make a few modifications to the pasted syntax, and then run the commands from the syntax window.

1. From the menus, go to Analyze>General Linear Model>Univariate.

2. In the Univariate dialog box, move Salary into the box labeled Dependent Variable.

3. Move the grouping variable College into the box labeled Fixed Factor(s).

4. Move the continuous predictor GPA into the box labeled Covariate(s).

5. Click on the Model button. Specify Custom, then add College, GPA, and COLLEGE*GPA to the model. Click Continue.

6. Now, instead of clicking OK, click PASTE. The contents of your syntax window should appear as follows:

UNIANOVA
salary BY college WITH gpa
/METHOD = SSTYPE(3)
/INTERCEPT = INCLUDE
/CRITERIA = ALPHA(.05)
/DESIGN = college gpa college*gpa.

7. Next, insert three blank lines immediately before the line which begins /DESIGN. We will be typing in LMATRIX subcommands to pick off pairwise comparisons between the coefficients for GPA for each college. We'll explain what these commands mean shortly. For now, complete the command syntax in your command window so that it appears as follows.

UNIANOVA
salary BY college WITH gpa
/METHOD = SSTYPE(3)
/INTERCEPT = INCLUDE
/CRITERIA = ALPHA(.05)
/LMATRIX 'Business vs. Engineering' college*gpa 1 -1 0
/LMATRIX 'Business vs. Liberal Arts' college*gpa 1 0 -1
/LMATRIX 'Engineering vs. Liberal Arts' college*gpa 0 1 -1
/DESIGN = gpa college college*gpa .

8. In the above command syntax, the labels, which are enclosed in single quotes (e.g., 'Business vs. Engineering'), are optional descriptions supplied by the user to identify what's being contrasted. The three LMATRIX contrast columns are based on the alphabetical ordering of the levels of the grouping variable College (i.e., Business, Engineering, and Liberal Arts). Hence, the first contrast (1 -1 0) contrasts Business, which comes first alphabetically, with Engineering, which comes second. If your grouping or treatment variable is numerical, then the ordering should follow ascending numerical order.

9. Finally, run the commands by going to the menu of the SPSS Syntax Editor Window and selecting Run->All.

The overall test for whether the groups have different slopes is given by the p-value associated with the fixed factor-by-covariate interaction term in the table entitled Tests of Between Subject Effects (i.e., college*gpa, in this example). The F-tests for each pairwise LMATRIX contrast are given at the end of each Custom Hypothesis Test in the tables entitled Test Results.

If there were only two levels of the factor, the omnibus test would be equal to the one slope comparison we could make using LMATRIX, so we would not need to do that, unless we wanted to see the difference in slopes and its standard error, confidence interval, etc

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

20841

Document Information

Modified date:
16 April 2020

UID

swg21476883