TC3 → Stan Brown → TI-83/84/89 → Goodness of Fit (TI-83/84)
revised 31 Jul 2013 (What’s New?)

Testing Goodness of Fit on TI-83/84

Copyright © 2012–2014 by Stan Brown, Oak Road Systems

Summary: You can use your TI-83/84 to calculate a goodness-of-fit test, also known as a multinomial experiment.

Alternative: MATH200A Program part 6 does the calculations and graphs the χ² curve automatically for you. This is significantly easier than using native TI-83/84 commands, so I recommend you get the program if possible.

See also: Testing Goodness of Fit on TI-89

Example: Fruit Flies

 Model
ratio
Observed
Green-eyed winged9120
Green-eyed wingless349
Red-eyed winged336
Red-eyed wingless112
  Total16217

An example in Dabes & Janik’s Statistics Manual (1999) had to do with the offspring of hybrid fruit flies; see figures at right. The null hypothesis H0 is that the 9:3:3:1 model is good, and the alternative H1 is that the model is bad. Use α=0.05.

The test statistic χ² is a standardized measure of how far the observations differ from the model. You’ll compute that first, by using some list operations, and then you’ll use χ²cdf to compute the p-value.

Computing the Expected Counts

The model goes in L1. It can be percentages, ratios, or whole numbers. Enter the model numbers for each category, but don’t enter the total even if you have it. TI-83 screen showing model in L1 and observed in L2 Press [STAT] [ENTER]. Cursor to L1, the actual column head and not the first number under L1, and press [CLEAR] [ENTER]. Enter the numbers.
The observed counts go in L2. Even if the model is in percentages, the observed numbers must be the actual counts. Don’t enter the total. Cursor to L2, the actual column head and not the first number under L2, and press [CLEAR] [ENTER]. Enter the numbers.
Next, fill L3 with the expected counts. Each expected count equals the corresponding percent in the model, times the sample size. Symbolically,

L3 = L1/sum(L1)*sum(L2)

(There’s no need to clear L3 before entering the formula.)

TI-83 screen showing formula entry in L3 Cursor to the L3 column head and press [2nd 1 makes L1] [÷].
 
Press [2nd STAT makes LIST] [] [5] to paste sum(. Continue with [2nd 1 makes L1] [)] [*].
 
Again press [2nd STAT makes LIST] [] [5] to paste sum(. Finish with [2nd 2 makes L2] [)] [ENTER].

TI-83 screen showing expected values 122.06, 40.688, 40.688, 13.563

L3 now contains the expected counts (expected for this sample size if H0 is true and the model is correct). Before you continue, verify that the requirements are met for a GoF hypothesis test:

The requirements are met. If you have a TI-84 Plus or Silver, skip down to Computing Goodness of Fit (TI-84s).

Computing the χ² Contributions (TI-83s)

Next, fill L4 with the χ² contributions. These are (observed−expected) squared, the divided by expected, (O-E)²/E. Symbolically,

L4 = (L2−L3)²/L3

(There’s no need to clear L4 before entering the formula.)

TI-83 screen showing formula entry in L4 Cursor to the L4 column head and press [(] [2nd 2 makes L2] [] [2nd 3 makes L3] [)] [] [÷] [2nd 3 makes L3] [ENTER].
TI-83 screen showing caclulated results in L4 After you press [ENTER], the screen will look like this.

L4 now contains the χ² contributions.

Computing the Test Statistic and p-Value (TI-83s)

Get back to the home screen for the remaining calculations. Press [2nd MODE makes QUIT].
Sum up the χ² contributions that you computed in L4. This is your χ² test statistic. TI-83 screen showing sum of L4 Press [2nd STAT makes LIST] [] [5] to paste sum(. Finish with [2nd 4 makes L4] [)] [ENTER].
The p-value is the probability of getting this χ² statistic or greater. You have to specify degrees of freedom, which is (number of categories) minus 1. TI-83 screen showing computation of p-value Press [2nd VARS makes DISTR]. Scroll down to χ²cdf (not χ²pdf) and press [ENTER] then [2nd (-) makes ANS], which will use the previous answer. (This is faster and more accurate than retyping the number yourself.)
 
Continue with [,] [1] [0] [^] [9] [9] [,] and the number of degrees of freedom, then finish with [)] [ENTER].

The χ² test statistic is 2.45 and the p-value is 0.4838. p>α; fail to reject H0.

Computing Goodness of Fit (TI-84s)

TI-84s can compute the χ² contributions and p-value for you, although you still have to compute expected counts yourself.

Select the χ² Goodness-of-Fit Test. Press [STAT] [] and scroll up to χ²GOF-Test.
Enter L2 for Observed and L3 for Expected. For degrees of freedom df enter number of categories minus 1. In this problem, that’s 4−1 = 3. TI-84 input screen for GoF test
Select Calculate and read off the results: the χ² test statistic is 2.45 and the p-value is 0.4838.

p > α; fail to reject H0.

TI-84 output screen for GoF test

What’s New


This page is used in instruction at Tompkins Cortland Community College in Dryden, New York; it’s not an official statement of the College. Please visit www.tc3.edu/instruct/sbrown/ to report errors or ask to copy it.

For updates and new info, go to http://www.tc3.edu/instruct/sbrown/ti83/