The following example will walk you though the process of performing a chi-square goodness-of-fit test manually.

Suppose you took a sample of 200 units and each response was classified as one of 4 categories; 54 were classified as category "A", 30 were classified as category "B", 38 as "C", and 78 as "D". You want to test if pA = pB = pC = pD = 1/4, where pA is the population proportion in category "A", pB is the population proportion in category "B", and so forth.

- Open a new Minitab worksheet.
- Name an empty column Observed and enter the following values in the column:
`54 30 38 78`. - Name a second empty column Expected that will 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.

- Type the following values in the column Expected:
`50 50 50 50`. - Choose .
- In Store result in variable, type
`Chisquare`. This puts the results in the next available blank column with the name Chisquare. - In Expression, type
`SUM((Observed - Expected)**2 / Expected)`. Click OK. - Choose .
- Choose Cumulative probability. In Degrees of freedom, type the number of categories minus one. For this example, type
`3`. - Choose Input column, and type
`Chisquare`. In Optional storage, type`CumProb`. This puts the result in the next available blank column with the name CumProb. Click OK.For this example, the cumulative probability is 0.99999. - Choose .
- In Store result in variable, type
`Pvalue`. This puts the result in the next available blank column with the name Pvalue. - In Expression, type
`1 - CumProb`. 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 of the units does not equal 1/4.