Chi-Square Test


Chi-square statistic () is a value that compares the size of the difference between the expected result and the actual result.

  • used to measure how the model compares to the actual data

Chi-square test is a test used to determine if a difference exists between groups.

  • produces a chi-square statistic
  • used to compare all sorts of variables:
    • scores on a test
    • responses to a medical test
    • answers to a survey question
    • and more
  • reasons to conduct chi-square analysis:
    • A chi-square test is used to compare actual results to what we expected the results would be
    • A chi-square test also allows us to rule out that the observations happened by chance
    • Chi-square testing identifies how confident we are that the results are (or are not) different from what we expected and that there is a relationship between the variables
    • Chi-square testing is useful when we are analyzing data from a random sample and working with a categorical variable, like education, race, or gender

Types of Chi-Square Tests

  • 2 common types of chi-square tests:
    • test of independence
    • goodness of fit
  • both tests compare actual results against an expectation

Test of independence is a chi-square test that tests against multiple variables to analyze the distribution of the data.

  • Used for the relationship between the variables
  • tests against multiple variables
  • evaluates whether there is a significant association between two categorical variables

Goodness of fit is a chi-square test that tests against a single variable to analyze the relationship between variables.

  • Used for the distribution of the data
  • tests against a single variable
  • tests the hypothesized distribution and then provides the significance value to make a conclusion about whether or not it met what we expected

Example Output of a Chi-Square Test

Student PreparednessFailPassTotal
Very Prepared9 (8.32) [0.06]17 (17.68) [0.03]26
Somewhat Prepared11 (16.32) [1.73]40 (34.68) [0.82]51
Not Prepared12 (7.36) [2.93]11 (15.64) [1.38]23
Total3268100
The chi-square statistic is6.9338
The p-value is0.031213
This result is significant p < .05
  • Reading the table:
    • First cell under Fail shows:
      • 9 is the number of students
      • number in parentheses (8.32) is the calculated expected results
      • the number in brackets [0.06] is the chi-square point for this data
    • the established p-value is < 0.05
      • means we can feel confident in our conclusions