IBM Support

Can I get pairwise comparisons among all levels of a predictor in a Kx2 crosstabulation in SPSS?

Troubleshooting


Problem

I've used CROSSTABS to show that a categorical variable is related to a binary variable of interest, and now I want to see where the proportions of the binary variable are different. CROSSTABS doesn't seem to allow me to do this very easily. Can I do it elsewhere in SPSS more easily?

Resolving The Problem

A relatively easy way to obtain all pairwise comparisons of binomial proportions among categories of a variable is to use the NOMREG procedure (Analyze->Regression->Multinomial Logistic in the menus) to estimate a logistic regression model, and use the TEST subcommand to specify all pairwise comparisons among the levels of the variable of interest. The command syntax would be of the following form (assuming a four level predictor):

NOMREG two (BASE=FIRST ORDER=ASCENDING) BY four
/TEST = '1 vs. 2' ALL 0 1 -1 0 0
/TEST = '1 vs. 3' ALL 0 1 0 -1 0
/TEST = '1 vs. 4' ALL 0 1 0 0 -1
/TEST = '2 vs. 3' ALL 0 0 1 -1 0
/TEST = '2 vs. 4' ALL 0 0 1 0 -1
/TEST = '3 vs. 4' ALL 0 0 0 1 -1 .

You would of course substitute the name of your two level dependent variable for "two" and the name of your four level predictor variable "four" in this command. You would need to adjust the number of TEST subcommands and the number of coefficients on each one for a different number of levels of the predictor. The specification "ALL" indicates that a coefficient will be given for each parameter in the model, including the intercept. (It is possible to simplify the specifications some on the TEST subcommand by not explicitly specifying the 0 value for the intercept that's required when using ALL, but doing this requires naming the predictor on each TEST subcommand, necessitating more changes to adapt these commands to real data, so these approach was chosen.)

Beginning with Release 15, the GENLIN procedure (Generalized Linear Models in the menus) can be used to obtain all pairwise comparisons among the levels of a factor using the menus. Select Analyze>Generalized Linear Models>Generalized Linear Models from the menus. Specify the dependent variable and specify that it's binary. Choose the logit link function. Click on the Predictors tab and select the categorical predictor variable. Click on the Model tab and move it into the model. Click on the EM Means tab and select the factor name, then choose Pairwise from the Contrast dropdown. If desired, use the Adjustment for Multiple Comparisons dropdown to correct for multiple comparisons.

A CIN(%) subcommand could be added, with the percentage changed from the default 95, to obtain confidence intervals appropriate for Bonferroni or other similar adjusted comparisons (note that the standard errors and test statistics will not be adjusted; only the confidence intervals).

[{"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

48011

Document Information

Modified date:
16 April 2020

UID

swg21480476