We are now going to learn how to calculate a one-way chi-square goodness-of-fit test in SPSS.
Now for this example
we are going to assume that the observed values in one group
do not differ from the values in a comparison population, or that there is no difference between the groups.
This is the Pig and Bear Chi-Square
We are using the data set BuildingPermit.sav. You will need to open this data set in SPSS.
This data set contains the results of building permits for 70 little pigs.
A house inspector randomly samples building permits pulled by 70 little pigs who were building houses
to determine whether a pattern exists in the materials that the little pigs chose for housing construction.
The permits are categorized based upon whether the little pigs apply to build their houses out of straw,
sticks, or bricks and mortar.
The house inspector already knows the pattern of a random sample of 70 bear permits
in which Straw = 20, Sticks = 20, and Brick & Mortar = 30.
Our research question is:
Do the building permit patterns differ statistically significantly?
Now before we begin using SPSS, I would like to point out a few things about this data set.
Go to Variable View.
Notice that we have one
nominal and one scale variable, and the scale variable is actually a number of counts
So we will need to address that before we run the chi-square in SPSS.
Now go to "Data View".
You will notice that this is a very small data set.
The nominal variable called Material contains the values 1, 2, 3
And you can click on this icon to toggle the variable labels on and off.
The numbers represent the categories of building material where 1 = Straw,
2 = Sticks, and 3 = Brick and Mortar.
We cannot run any kind of test with these values because we do not have the raw data. All we have here are counts,
so we have to let SPSS know how to handle these data.
What we will do is to weight each category by its respective count.
So, go to "Data"
"Weight Cases"
We will weight the cases by the number of permits.
It is not necessary to do this a second time if you've already done it from the previous example.
If you have not done it yet, click on "Weight cases by" and
then move Permits into the frequency variables box.
Click OK
From now on any analysis that we run will be weighted by the actual number of cases.
So now we are ready to conduct the chi-square, and there's actually more than one way to run a chi-square in SPSS.
I am going to show you the way it was originally done in SPSS because the menus will be more familiar.
Let's go to the "Analyze"menu.
Choose "Analyze"
"Nonparametric Tests"
"Legacy Dialog"
"Chi-Square"
Begin by moving the variable Materials into the Test Variable List.
These are the observed values, but we will need to enter the expected values.
Under "Expected Values", instead of "All categories equal", select "Values".
Now enter the expected values in the same order as the categories 1, 2, and 3. Type 20. "Add"
20. "Add"
30. "Add"
Having done that, click on "Options."
Select "Descriptives" and now click "Continue" and "OK"
The output window will pop up.
Let me show you how to interpret these data.
Your goal here is to make sure that the data look right.
We thought we would have 70 permits, and there were so that is okay.
The minimum was 1, and the maximum was 3, so we do not have any data entry errors.
The Mean and Standard Deviation, however, are worthless.
Because we are analyzing nominal data, the mean of the three categories does not tell us anything at all.
Here we see the observed values from our data set and the expected values.
Each expected value is what we entered from its respective category.
The residual value here is the same as the O - E column that we saw when we did this test by hand.
The largest residual value is a -4 for Straw, but these residuals are pretty small.
And over here in the Test Statistics, we see that the chi-square value is a 1.15,
and the probability of getting a chi-square of this size if the null hypothesis is true is
0.563, which is >.05.
So these observed data from the little pigs are not
statistically significantly different than the expected values from the bears.
There is no difference in the pattern of choices of the building materials.
Notice, too, that none of the cells have expected frequencies <5.
That's good news, and it meets the assumptions for the chi-square test.
Here is a sample APA write-up for the one way chi-square goodness-of-fit test.
Notice that I included the observed values for each group, and
concluded the pattern of permits pulled by the pigs did not differ
statistically significantly from the pattern of permits pulled by the bears.
Chi-square with two degrees of freedom, N=70, = 1.15.
probability = 0.563. Cramer's V = 0.13.
Cramer's V]is an effect size which I will cover in the next video about effect size for chi-square.