Chi Square: One Way
Chi square: one way
What is it?
The chi square is used to determine whether there is a relationship between two nominal variables. Nominal data, by definition, cannot be averaged meaningfully because the numbers are meaningless by themselves. Instead, they tell us the number of participants in each category. A one-way (goodness of fit) chi square classifies participants on only one dimension such as soda preference – do soda drinkers prefer Pepsi or Coke.
The chi square test examines whether people are distributed across the categories as would be expected by chance (which would mean there is no relationship between the independent and dependent variables), when taking sampling errors into account. If there is no relationship, the frequencies should be equal across the categories. If there is a relationship, then people won’t be distributed as expected by chance (e.g., more people pick Pepsi, or more males pick the incumbent candidate)
The null hypothesis states there is no true relationship between the treatment (or experimental condition) and the frequency, which is why the null hypothesis expects that frequencies are distributed evenly across the categories. The alternative hypothesis states that there is a true relationship in the target population and expects the frequencies to be unequal across categories, or different from chance. The chi square tests this hypothesis by essentially calculating whether the difference between the observed and expected frequencies in each category could have occurred because of chance sampling errors or instead because the treatment (or experimental condition) had an effect on the outcome.
Calculation:
First, set up a table:
| Milk w/ Red dye | White milk | Milk w/ Yellow dye | |
| Observed (O) | 32 | 27 | 4 |
| Expected (E) | 21 | 21 | 21 |
Heading the columns are the categories.
The “observed” row contains data collected: Taste preference in consideration of milk color
1. The “expected” row is theoretical, used to consider the null hypothesis. Because all the milk tastes the same, there shouldn’t be a difference in preference unless color has a factor. To find expected, simply divide the number of participants (N = 63) by the number of categories (3).
2. Second, apply the chi square formula.
![]()
3. You do this for each category:
= (O-E)² / E
= 3.85, 1.71, and 13.76, respectively.
4. Add these values together: = 19.32
5. Compute degrees of freedom:
6. Df = number of categories = 1 = 2
7. Look up the critical value of chi square in a table.
8. At the .05 level, the critical value is 5.991. If the observed value of chi square is greater than the critical value, reject the null hypothesis. If not, do not reject it.
We can conclude that there is a significant difference between perceived taste of milk based on its color.
Computer:
Excel:
1. Enter data into cells
2. In an empty cell, type “=CHITEST(actual_range, expected_range). Your actual range would be (for this example) b2:d2 and your expected range would be b3:d3.
a. OR: click on the f(x) button in the tool bar.
b. Select “statistical” function from the pull down window
c. Select CHITEST
d. Click OK
e. Select your actual and expected ranges

3. The p will appear in the cell. If it is less than .05, you can reject the null hypothesis. If it is greater than .05, you should accept the null hypothesis.
SPSS:
1. Go to ANALYZE > DESCRIPTIVE STATISTICS > CROSS TABS
2. Select independent and dependent variables (a good rule of thumb is to enter the variable with more measurement levels in “rows.”)
3. Go to STATISTICS > CHI-SQUARED (BOX) > CONTINUE > OK
4. Look at your output window.
o The first table shows the number of participants in each cell.
o The second table is the outcome of the test. The “Pearson Chi-Square” is the result you want to look at.
o “Value” is the value of the chi square test statistic
o “df” is the degrees of freedom
o “Asymp. Sig. (2-sided) is the alpha (the probability value) of the test statistic. If it is smaller than .05, you can reject the null hypothesis. If it is greater than .05, you shold accept the null hypothesis.
Back to Inferential Statistics
To Two-way chi-square
References:
Patten, Mildred L. (2002). Understanding research methods: An Overview of the essentials (3rd ed.). Los Angeles: Pyrczak Publishing.
Pavkov, Thomas W., & Pierce, Kent A. (2003). Ready, set, go! A Student guide to SPSS(R) 11.0 for Windows. Boston: McGraw-Hill.
Pyrczak, Fred. (2002). Success at statistics: A Worktext with humor (2nd ed.). Los Angeles: Pyrczak Publishing.
Solso, Robert L., Johnson, Homer H., & Beal, M. Kimberly. (1998). Experimental psychology: a case approach (6th ed.). New York: Longman.

