CHISQGOF (c2 Goodness of Fit) Program for TI-83 or TI-83 PLUS
Written by Mr. Hansen and the Class of 1999
(with two 2008 suggestions from an Internet contributor)
Rev. 4/15/2001, 2/27/2008

Purpose: As you may know, your calculator handles two types of c2 tests with a built-in function, namely STAT TESTS C, which covers the tests for independence and for homogeneity of proportions. However, there is a third type of c2 test, the "goodness of fit" test, which TI apparently felt was too elementary to include as a separate function. Here is a short program that fills this gap. Be sure to enter your expected counts (not proportions!) in list L2 and your observed counts in list L3 before you run the program.

Note: You can learn a lot about how the test works by reading the program. Do you understand what each step is doing?

 

Program Listing:

:Disp "L2=EXP./L3=OBS."
:sum((L
3-L2)2/L2)®C
:((L
3-L2)2/L2)®L4
:dim(L
2)-1®D
:Disp "
c2="
:Disp C
:Disp "df="
:Disp D
:
c2cdf(C,99999,D)®P
:Disp "p="
:Disp P:Pause

When the program ends, list L4 holds the contributions to c2, variable C holds the value of the c2 statistic, variable D holds the degrees of freedom (i.e., number of categories minus 1), and variable P holds the P-value of the test. You can then use these in other computations if you wish.

As you are entering the program above, you may find the following hints to be helpful: