Perform a chi-square goodness-of-fit test manually

The following example will show you how to perform a chi-square goodness-of-fit test manually.

Suppose you take a sample of 200 units and classify each response as one of 4 categories: 54 as category "A", 30 as category "B", 38 as category "C", and 78 as category "D". You want to test whether pA = pB = pC = pD = 0.25, where pA is the population proportion in category "A", pB is the population proportion in category "B", and so on.

  1. Open a new Minitab project.
  2. Name an empty column Observed and enter the following values in the column: 54 30 38 78.
  3. Name a second empty column Expected to contain the expected values. Because there are 200 units, if the null hypothesis were true (that is, if there were no difference between the proportions of each category), you would expect 50 units in each category (that is, 50 classified as "A", 50 as "B", 50 as "C", and 50 as "D").
    Note

    A chi-square test compares the observed counts to what you would expect to see if the null hypothesis were true in order to determine whether the differences between the observed and expected counts are "too large" to occur by chance.

  4. Type the following values in the Expected column: 50 50 50 50.
  5. Open the Formula dialog box.
    • Mac: Data > Formula
    • PC: DATA > Formula
  6. In Expression, type SUM((Observed - Expected)**2 / Expected). Click OK.
  7. In Name for result, type Chisquare. This step puts the results in the next available blank column with the name Chisquare.
  8. Open the Cumulative Distribution Function (CDF) dialog box.
    • Mac: Statistics > Probability Distributions > Cumulative Distribution Function
    • PC: STATISTICS > CDF/PDF > Cumulative Distribution Function
  9. In Form of input, select A column of values.
  10. In Values in, enter Chisquare.
  11. In Distribution, select Chi-Square.
  12. In Degrees of freedom, type 3.
    The degrees of freedom is the number of categories minus one.
  13. In Output, select Store cumulative probabilities in a column. Click OK.
    For this example, the cumulative probability is 0.99999.
  14. Open the Formula dialog box.
    • Mac: Data > Formula
    • PC: DATA > Formula
  15. In Store result in variable, type Pvalue. This step puts the result in the next available blank column with the name Pvalue.
  16. In Expression, type 1 - Chi-Square CDF for Chisquare. Click OK.
    For this example, the p-value is 0.0000062. Therefore, you can reject the null hypothesis and conclude that at least one proportion does not equal 0.25.
By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy