Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In the last two movies we've looked at the most basic inferential statistics, the ones where we analyzed one variable at a time. We looked at the proportion for a nominal variable, with only two outcomes, that is, a dichotomous variable, and we looked at the mean for a scale variable. In both cases, we looked at both null hypothesis tests and confidence intervals. In this movie, we will expand things slightly by looking at how to do a hypothesis test for a nominal variable, or a categorical variable, that has more than two categories, something like occupation or a favorite sport.
Although it's possible to do confidence intervals for the number of people in each category, it's a complicated procedure, and it's not particularly helpful for most purposes. Instead, we'll just do a hypothesis test that looks at whether people are evenly distributed across all the categories in the variable. The test statistics that we'll use is called the One Sample Chi-Square Test in SPSS. It's also known as the Goodness-of- fit Test, and with SPSS's new automatic features, this is very easy to create and interpret.
I am going to be using the same data set as before, GSS.sav from the General Social Survey, and I thought it might be interesting to look at the variable that is second from the last, about people feeling happy. Specifically the question is self-rated happiness. Well, we have three possible answers: Not Too Happy, Pretty Happy, and Very Happy. And we can use this test to see if people fall evenly into those three different categories. To do this, we'd go to the Analyze menu, and then down to Nonparametric Tests, and again to One Sample.
This is the same one that we used for the single proportion. We're just going to be doing it a little bit differently this time. I need to go to the Fields tab, and then I have all of the variables that it can test in the Test Field thing. I don't want all of them there. It will be too much output. So what I am going to do is I am going to select all of these and put all of them back, and then I'll bring back over the only one that I want, which is near the bottom of the list, and it's Self-Rated Happiness. I can double-click on that to move it over.
Then I can go with the default test. All I need to do now is press Run, and I get the same kind of table I got before. It lets me know that the null hypothesis, or that the categories of Self-Rated Happiness, would occur with equal probabilities. That is that we would have the same percentage of people who said that they were Not Too Happy and Pretty Happy and Very Happy. All I can tell from this one is that those three are not evenly distributed. But this is an interactive model viewer, so I double-click on it and I will maximize that window.
And what I see is the hypothesized value is the green bars over here, and what it is, you see all three of them are the same size. The blue is how many I actually have. The green is how many I would have expected if things were distributed evenly. And it tells me that I have an observed 43 people who said they were not too happy. That's this blue bar right here, that's the Observed. The hypothesized was 116. So the difference between the two, the residual, is 73. In fact, what you can see is that in the first set, the Not Too Happy, I have fewer people than I would expect if people were evenly distributed.
On the other hand, I have a lot more people in the middle set, Pretty Happy, than I would expect. The Very Happy is actually right around one third of the group. Down below that, I have a table that gives me the total sample size, 349. The Test Statistic there is called the Chi-Square Test, and it's got a value of 88.06. It has what's called 2 Degrees of Freedom, and a Probability value, that's the Asymptotic Significance 2-sided test of less than 000. Again, it's not exactly 0, but it's going to be a small number.
Anyhow, this is the easiest possible hypothesis test for a categorical variable that has several categories in it. The One Sample Chi-Square Test, it's a quick and easy way to tell if your observations are distributed evenly across categories, or you can also specify some other expected way. It shows how important it can be to check whether the variation you see could be reasonably attributed to random, meaning less chance, or whether you might start to see something important that deserves further analysis.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 70047 Viewers
80 Video lessons · 127437 Viewers
52 Video lessons · 62372 Viewers
59 Video lessons · 48076 Viewers
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.
Your file was successfully uploaded.