You are on page 1of 5

One-Way Chi-Square Goodness of Fit Test: SPSS

Suppose we wish to test the null hypothesis that Karl Wuensch gives equal
numbers of As, Bs, Cs, Ds, and Fs as final grades in his undergraduate statistics
classes. The observed frequencies are: A: 6, B: 24, C: 50, D: 10, F: 10.
The data are entered into SPSS like this:

Do not enter the values of the categorical variable as alphanumeric data. If you
so, SPSS will refuse to do the analysis. Code the categories numerically and then label
those values like this:

Now tell SPSS to weight the cases by Count. Click Data, Weight Cases, Weight
Cases By Count.

OK.
Click Analyze, Nonparametric Tests, Chi-square. Scoot Grade into the Test
Variable List. By default SPSS will use all categories and will test the hypothesis that
the counts are, in the population, uniformly distributed across categories.

Copyright 2005, Karl L. Wuensch - All rights reserved.

OK.
Grade
F
D
C
B
A
Total

Observed N
10
10
50
24
6
100

Expected N
20.0
20.0
20.0
20.0
20.0

Residual
-10.0
-10.0
30.0
4.0
-14.0

Test Statistics
Chi-Square a
df
Asymp. Sig.

Grade
65.600
4
.000

a. 0 cells (.0%) have expected frequencies less than


5. The minimum expected cell frequency is 20.0.

We reject the hypothesis that the counts are uniformly distributed across the
categories, 2(4, N = 100) = 65.60 p < .001.
If you wanted to restrict the range of the categories tested (for example, testing
the hypothesis that Bs, Cs, and Ds are equally likely), you would do so by specifying
the lowest and highest category values to be tested in the Expected Range box.

OK.
Frequencies

1
2
3
Total

Category
D
C
B

Grade
Observed N Expected N
10
28.0
50
28.0
24
28.0
84

Residual
-18.0
22.0
-4.0

Test Statistics
Chi-Square a
df
Asymp. Sig.

Grade
29.429
2
.000

a. 0 cells (.0%) have expected frequencies less than


5. The minimum expected cell frequency is 28.0.

Suppose you wish to test the null hypothesis that Karl Wuensch gives twice as
many Cs as Bs, twice as many Bs as As, just as many Ds as Bs, and just as many
Fs as As and the observed frequencies are as before. Under this null hypothesis,
given a total N of 100, the expected frequencies are: 10, 20, 40, 20, and 10. I enter
these expected frequencies in the Expected Values box:

OK.

Grade
F
D
C
B
A
Total

Observed N
10
10
50
24
6
100

Expected N
10.0
20.0
40.0
20.0
10.0

Residual
.0
-10.0
10.0
4.0
-4.0

Test Statistics
Chi-Square a
df
Asymp. Sig.

Grade
9.900
4
.042

a. 0 cells (.0%) have expected frequencies less than


5. The minimum expected cell frequency is 10.0.

We reject the stated hypothesis, , 2(4, N = 100) = 9.90 p = .042.


Please note that there are a lot of Internet stats programs that will do such a chisquare goodness of fit test. For example, you could use the program at Vassar:

Return to my SPSS Lessons page


More Lessons on the Binomial and Chi-Square Distributions
Letters From Former Students -- some continue to use my online lessons when they go
on to doctoral programs
Copyright 2005, Karl L. Wuensch - All rights reserved.

You might also like