# How to correlate ordinal and nominal variables in SPSS?

I have imported an Excel document in SPSS which contains around 500 entries. Three columns are defined, using Likert scales. I have substituted textual labels of these scales with numerical values from 0 to 4 (so, the three numeric variables are ordinal). Two more columns are just text, e.g., location (home, commuting etc.); these are nominal variables.

Now, I want to correlate these variables with each other in order to find meaningful patterns. (In particular, I want to correlate my ordinal variables with my nominal variables, but I don't know how.) How do I do this in SPSS? Moreover, I would like to test the values of some variables against the whole number of entries.

-
SEE also related question stats.stackexchange.com/q/73065/3277 –  ttnphns Dec 27 '13 at 8:02

You should have a look at multiple correspondence analysis. This is a technique to uncover patterns and structures in categorical data. It is an example of what some people call "French Data Analysis"

In SPSS, you can use the CORRESPONDENCE command. If you prefer the Menu, it is available via "Analyze -> Data Reduction -> Correspondence Analysis".

However, before doing that, start with cross-tabulations between the variables. In SPSS the command is called CROSSTABS or click on "Analyze -> Descriptive Statistics -> Crosstabs"

-
This answer is qustionnable. And is mistaken in particuar respect. CORRESPONDENCE command in SPSS is simple, not multiple, correspondence analysis. And it is unclear what relation correspondence analysis (multiple or simple) may have to an ordinal variable. It analyzes only nominal variables. –  ttnphns Dec 27 '13 at 8:41
The MULTIPLE CORRESPONDENCE command does what the name says. However, it is intended for nominal variables. –  JKP Feb 27 at 20:28

You might want to look at the AUTORECODE command (Transform > Automatic Recode) if you are reading a lot of string data that needs to be converted to numeric.

Parametric and nonparametric correlations are available from the Analyze > Correlate menu for a first look. There are tools available as extensions for color coding significant and/or large correlations. There is also a user-posted tool for generating a graphical representation of a correlation table that you can find in the Graphics forum in the SPSS Community website.

-
A word of caution here: it's not clear if correlational analyses are appropriate for the OP's data. –  gung Nov 27 '12 at 14:40

Try Categorical Regression (Optimal Scaling).

Nominal variables don't have scale. How far is 'divorced' from 'married'? Does not make sense unless you have another measure to help put the nominal variable levels in order and distance from each other.

Ordinal variables don't have scale either. How far is 'fair' from 'good'? There is order but no distance in an ordinal ranking. You can put them on a scale with respect to some other, dependent, variable.

So there is no correlation with ordinal variables or nominal variables because correlation is a measure of association between scale variables.

However, the optimal scaling procedure creates a scale for nominal variables (and ordinal), based on the variable levels' association with a dependent variable. This syntax will produce a correlation matrix between a scale dependent variable and nominal independent variables.

GET
FILE='C:\Program Files\IBM\SPSS\Statistics\22\Samples\English\car_sales.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.

DATASET ACTIVATE DataSet1.
CATREG VARIABLES=sales manufact model type
/ANALYSIS=sales(LEVEL=SPORD,DEGREE=2,INKNOT=2) WITH manufact(LEVEL=NOMI) model(LEVEL=NOMI)
type(LEVEL=NOMI)
/DISCRETIZATION=sales(RANKING) manufact(RANKING) model(RANKING) type(RANKING)
/PRINT=CORR QUANT(manufact model type)
/PLOT=TRANS(manufact model type)(20).


Notice that I also included the Quantifications and plots for the transformed variables. You cannot make sense of the correlation coefficients unless you can also make sense of the new scales created for the nominal (or ordinal) variables.

CATREG is a very powerful and rich feature of SPSS. See also:

Another option to find the relationship between ordinal and nominal variables is to use Decision Trees. You will not get a correlation coefficient but the algorithm will group nominal variables and split ordinal variables based on association with another variable.

Using the CRT method and selecting Variable Importance (output>statistics), you can generate a ranking of each independent (predictor) variable's association with the dependent (target) variable. The importance is a measure of association like correlation.

If you are only interested in one factor level (e.g. [Marital status] = 'Married'), use a dummy coding for a new variable so that Married = 1 if Marital status = 'Married' else 0. With the dummy variable, you are creating two groups: Married and everything else. You can use the dummy variable as a scale variable because the groups you created are on a scale, one unit apart.

-
1. Use Transform > Automatic Recode to make two numeric variables that carry the information of your two string variables.
2. Run a frequency table of the new variables, and make sure the string attributes are correct. E.g. check for misspelling (commute vs communte), plural/singular confusion (cars vs car), and grammatical difference (drive vs driving). Tidy them up by aggregating them, or each of these variants will be treated as its only level.
3. Likert's scale with 5 levels can be safely treated as ordinal variables, and the other two variables generated from the string variables are probably nominal variables. To test the association of
• Ordinal vs. ordinal, you may consider Spearman's correlation coefficient. (Analyze > Bivariate) You'd need the check the box "Spearman" in order to get the statsitics.
• Nominal vs. nominal, probably a chi-square test. (Analyze > Descriptive statistics > Crosstab Put in the variables into row and column, and then click Statistics and check Chi-square).
• Nominal vs. ordinal, you may consider Kruskal-Wallis. (Analyze > Non-parametric > Legacy dialog > K-independent samples. Put the Likert variables into Test variable list and put the nominal variable into Grouping variable).

Now, I want to correlate these variables between them in order to find meaningful pattern. How do I do this in SPSS?

Be careful with the intention of finding a meaningful pattern. If you just run the test and make up a reason for anything that appears to be sensible, you're just being toyed by the statistics. Instead, I'd suggest you to draft some questions and have some hypotheses on how they should correlate/associated before you even touch the data. If you are just trying to explore potential relationship, then treat it strictly as a hypothesis-generating activity, and statistically test the association using some other data.

Moreover I would like to test the values of some variables against the whole number of entries.

Sorry, I don't understand what this means.

-