Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In the last two movies we looked at ways to assess the relationships between two variables. We looked at correlations, which work for pretty much any kind of variable, and we looked at bivariate linear regression, a closely related procedure, but one that doesn't work with categorical outcome variables. If you do have a categorical outcome variable and a categorical predictor, you can still use correlations as long as those variables are coded as 01 indicator variables. But it's more common to use what's called a crosstabulation or crosstab for short.
This is simply a table with rows and columns that crosses, hence the name crosstabulation, the combinations of categories in the two variables. Each box or cell in the table simply indicates how many people have that particular combination of the two categories. To do this example, I'm going to use the GSS dataset and I'm going to show the relationship between marital status in this particular dataset and overall levels of happiness. To do this, I first come up to Analyze, to Descriptive Statistics.
Now this one right here, Tables, refers to Custom Tables, which is a separate add-in that you pay for in SPSS. But the one that comes standard in everything is right here under Descriptive Statistics, to Crosstabs. That's the one I'm going to use in this example. All I need to do is specify the variables that I want to depict the rows and the columns. In this particular example, I'm going to use Married to separate the rows, so those will be the ones going across. The columns, which I'll use for my outcome variable, is going to be the indicator of happiness, and that is near the bottom of the dataset.
It's this one called Self-rated Happiness. I'm going to drag that up to the columns. Now if I do this, it will simply give me the number of people who fall into each category. There are generally a couple of things I want to add. The first one is under Statistics. I want to add a measure of association for this with something called a Chi-square. I click on that. That's a statistic that shows changes in distribution to cross-categorical variables. Press Continue.
The next one is what numbers I actually want to have in the cells. Now sometimes the two groups, like for instance Married and Not Married, can be very different sizes in which case it's hard to compare the raw frequencies. Instead what I might want to do is break down the percentages so I know what percentage of people who say they're married, say they're not too happy, or pretty happy or very happy. And the easiest way to do that is with what's called a Row Percentage, because I want to get the percentage of people going across who fall into each column.
Now if I have my data organized differently, I might want column percentages, where I look at the percentage of people in each column who fall into particular rows. Either way. In this one I just want to use a row percentage. So I'm going to press Continue now and then I'll just press OK. And what I have here first is the Case Processing Summary. This tells me that we had complete data from 349 people. Now I actually have complete data on these particular variables. If any of my cases were missing a value on one or the other of these variables, they wouldn't be included.
So crosstabs only work with complete data. This next table is the crosstabulation itself and what we have on the left is that says whether people reported that they were married or not married, so it's married yes and no. Across the top we have self-rated happiness with not too happy, pretty happy, and very happy. And what we see at the end of that is the totals, so there is a 170 people who were married and 179 were not married. It's coincidental that we have very close numbers on these ones.
And what you can see as we go across is the percentage of people who were married, who said for instance they were very happy, was 44.7%. That's 76 people out of 170. On the other hand of the people in this dataset who were not married, 44 of them said that they were very happy, which is 24.6%, so it's a lower percentage. The percentages of people who said they were pretty happy are close to each other for the two groups, 51.2% for those who are married, and 55.3% for those who weren't.
And the percentage of people who are not too happy changes also. We have 4.1% of the people who are married so they weren't too happy and 20.1% of the people who weren't married and say they weren't too happy. The last table is called the Chi-Square Text. That's the inferential statistic here and we're looking at the top one that says Pearson Chi-Square. The actual value of the test statistic is 28.653. The next number is what's called the degrees of freedom and it has to go into the calculations of the probability levels.
It has 2 degrees of freedom in this case. And this third number is the asymptotic significance level of 2-sided. That's the probability level that goes into the hypothesis test. In this case, it shows up as .000. It's not actually 0 all the way through, but it's a number that is smaller than .001. And what this shows us is that the distribution of self-rated happiness is different for the two groups on the marital status variable. It's important to remember again, this is simply showing a correlation of self-reported variables.
And why there might be an apparent association between these two is a whole different issue, but that's true of any measure of association. And so a crosstabulation is a great way to show the relationship between two categorical variables. By selecting the row or column percentages, you can make it easier to compare the groups. And the chi-square inferential test lets you know whether any differences you see are large enough to become statistically significant. And again, it's worth remembering that if your categories are dichotomies with only two groups, like yes/no or male/female and if the variables are coded as 01 indicator variables, then you can also get a correlation coefficient for the association that will have the same result on the significance test.
That is, it'll have the same probability value and the same result in terms of rejecting or retaining the null hypothesis. However, the row and column percentages are a nice perk of the crosstabs procedure and in any case, if your variables have more than two categories, then you would want to do the crosstab and Chi-square anyhow. And with that in mind, the next several movies will address ways to investigate the mean scores on scale variables for different groups.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.