Education Technology

Testing Goodness-of-Fit and Two-Way Table Chi-Square

Published on 06/09/2008

Activity Overview

Students perform chi-square tests to see if data follows a hypothesized distribution. They also study the two-way table analysis.

Before the Activity

  • See the attached PDF file for detailed instructions for this activity
  • Print pages 101 - 105 from the attached PDF file for your class
  • During the Activity

    Distribute the pages to the class.

    Follow the Activity procedures:

    Chi-Square Test:

  • Generate 100 random values between numbers 0 and 10
  • Enter the expected and observed values of each class as lists
  • Calculate the degrees of freedom
  • Perform a chi-square test and determine the p-value
  • Evaluate the hypothesis based on the p-value


  • Simulate a binomial experiment using the randBin program
  • Plot the observed frequencies
  • Enter as lists number of successes, observed frequency of each number of successes, and the theoretical probabilities
  • Calculate the chi-square statistic after condensing
  • Calculate the p value and determine if they match the hypothesis of expected binomial distribution


  • Two Way Table Chi-Square Test:
  • Obtain a random sample of grades of students taking a test to test the hypothesis that the grade on the exam is independent of the sex of the test-taker
  • Store the data in a matrix
  • Perform a chi-square test and determine the p-value
  • Evaluate the hypothesis
  • After the Activity

    Review student results:

  • As a class, discuss questions that appeared to be more challenging
  • Re-teach concepts as necessary