## Associated Learning Objectives:

• Compute the value of the test statistic using the expected frequencies for a chi-square homogeneity test
• Compute the value of the test statistic using the expected frequencies for a chi-square independence test
• Conduct and interpret a test for homogeneity with the chi-square distribution
• Conduct and interpret a test of independence with the chi-square distribution

## Step-by-Step Instruction:

1. Paste the table into cell A1 of Google Sheets so the variables are in row 1 (starting in column B) and column A (starting in row 2). If the table already contains a column labeled “Row Total” and a row labeled “Column Total,” skip steps 2 through 7 and go to step 8.
2. In the first blank cell in row 1, enter “Row Total”.
3. In the row 2 cell in the “Row Total” column, enter “=SUM(B2:{Col}2)”, where {Col} is the final column of the pasted table. For example, if the pasted table extends to column D, enter “=SUM(B2:D2)”.
4. Use the fill down feature to extend the formula from step 3 down to calculate all of the row totals.
5. In the first blank cell in column A, enter “Column Total”.
6. In the column B cell in the “Column Total” column, enter “=SUM(B2:B{Row})”, where {Row} is the final pasted row of the pasted table. For example, if the pasted table extends to row 3, enter “=SUM(B2:B3)”.
7. Use the fill right feature to extend the formula from step 6 across to calculate all of the column totals, including the “Row Total” column.
8. In a blank cell, enter “=\${Col}2*B\${Row}/\${Col}\${Row}”, where {Row} is the row of the table labeled “Column Total” and {Col} is the column of the table labeled “Row Total.” For example, if row 4 is the “Column Total” row and column E is the “Row Total” column, enter “=\$E2*B\$4/\$E\$4”.
9. Use the fill down feature to extend the formula from step 8 down to fill cells to match the height of the original table (not including any Total rows) to calculate the expected values for the first column of the original table. For example, if the values in the original table went from cell B2 to cell D3, and the formula from step 8 is in cell G2, use the fill down feature to extend this formula to cell G3.
10. Use the fill right feature to extend the formula from step 8 across to fill cells to match the size of the original table (not including any Total columns) to calculate the expected values for each original table cell. For example, if the values in the original table went from cell B2 to cell D3 and the formula from step 8 is in cell G2, use the fill down feature to extend this formula to cell I3.
11. In another blank cell, enter “=((B2-{Col}{Row})^2)/{Col}{Row}”, where {Row} and {Col} are the row and column, respectively, of the cell from step 8. For example, if the step 8 cell was G2, enter “=((B2-G2)^2)/G2”.
12. Use the fill down feature to extend the formula from step 10 down to fill cells to match the height of the original table (not including any Total rows). For example, if the values in the original table went from cell B2 to cell D3 and the formula from step 10 is in cell B6, use the fill down feature to extend this formula to cell B7.
13. Use the fill right feature to extend the formula from step 10 across to fill cells to match the size of the original table (not including any Total columns). For example, if the values in the original table went from cell B2 to cell D3 and the formula from step 10 is in cell B6, use the fill down feature to extend this formula to cell D7.
14. Highlight the values calculated in steps 10 and 11 and check the sum to determine the chi-square test statistic.