We are having a difficult time understanding when to use two different types of hypothesis tests - Goodness-of-fit and Test for Independence. Both of them calculate a Chi Square statistic and compare it to a condfidence level in order to accept or reject a null hypothesis.
I will use a textbook example which I adapted for this inquiry.
Let’s say we are trying to determine whether exercise relates to illness. We look at 100 people in each of 3 categories:
A - Exercise at an organized fitness center
B - Exercise on their own
C - Do not exercise
We look at illness in a given year.
In case 1 we know only how many people in each group did or did not get sick in the year. Say 12 people got sick in A, 15 in B, and 23 in C. The rest in each group were healthy all year.
In case 2 we know only the number of illnesses in each group during the year (any person could have more than one illness during the year). Say 15 illnesses in A, 18 in B, and 33 in C.
We want to test the null hypothesis:
Ho: Exercise has no effect on illness.
Which test, Goodness of Fit or Independence, is correct to use in each case and why? Would the choice of test in each case be different if we had unequal sample sizes; instead of 100 people in each group we have, say 80 people in A, 95 in B and 120 in C?
Some of us claim that the same test should be used in both cases, and others say one test should be used for case 1 and the other test for case 2. We realize that the final acceptance or rejection of the null hypothesis might well be the same whichever test we choose; we are really interested in the proper test to use and how to make that choice.
Can you give us a clear general rule for deciding when to use each type of test?
(Note: We’re not interested in the details of the calculations, just how to decide the correct test.)