Calculate a Chi-square Test Statistic for a One-Way Table

# Calculate a Chi-square Test Statistic for a One-Way Table

How to Calculate a Chi-square Test Statistic for a One-Way Table in Google Sheets

Written by Michael Mancuso

Updated over a week ago

- Compute the value of the test statistic using the expected frequencies for a chi-square goodness-of-fit test
- Conduct and interpret a chi-square goodness-of-fit test

- Paste the table into cell A1 of Google Sheets so the variable is in row 1, the Expected values are in row 2, and the Observed values are in row 3.
- Enter “=((B3-B2)^2)/B2” in cell B4 to calculate the first column’s contribution to the test statistic. (If the Expected values are in row 3 and the Observed values are in row 2, enter “=((B2-B3)^2)/B3” instead.)
- Use the fill down feature to extend the formula from B4 across to calculate the other columns’ contribution to the test statistic.
- Highlight the values in row 4 and check the sum to determine the chi-square test statistic.

- Paste the table into cell A1 of Google Sheets so the variable is in column A, the Expected values are in column B, and the Observed values are in column C.
- Enter “=((C2-B2)^2)/B2” in cell D2 to calculate the first row’s contribution to the test statistic. (If the Expected values are in column C and the Observed values are in column C, enter “=((B2-C2)^2)/C2” instead.)
- Use the fill down feature to extend the formula from D2 down to calculate the other rows’ contribution to the test statistic.
- Highlight the values in column D and check the sum to determine the chi-square test statistic.