"I gather, young man, that youwish to be a Member of Parliament. The first lesson you must learnis, when I call for statistics about the rate of infant mortality,what I want is proof that fewer babies died when I was Prime Ministerthan when anyone else was prime minister. That is a politicalstatistic."

Winston Churchill

13.2 INFERENCE FOR TWO-WAY TABLES (Pages 717 - 738)

OVERVIEW: Sometimes one wants tocompare proportions from two or more groups. One can use thechi-square test to do this. Basically, the null hypothesis statesthat all the population proportions are equal. The alternatehypothesis is that they are not, which means that there appears to bea significant difference between at least two of the populationproportions.

If the null hypothesis is true, the expected countfor a cell in a two-way table is

expected count = (row total)(column total)/(table total).

The x2 statistic is

x2 = sum[(observed count -expected count)2/(expected count)].

The degrees offreedom is (number of rows - 1)(number ofcolumns - 1).

You can use x2 when all expected cell counts are at least 1, and no morethan 20% are less than 5.

Example:

The table displays the number of students passedand failed by each of three instructors who teach IntroductoryStatistics at a specific university.

 Instructor #1 Instructor #2 Instructor #3 TOTALS Passed 50 47 56 153 Failed 5 14 8 27 TOTALS 55 61 64 180

Suppose we wish to examine the null hypothesis,H0, that theproportions of students failed by the three instructors are the same.The expected frequencies under H0 are displayed in the lowerright of each observed count cell. Remember that expected count =(row total)(column total)/(table total). For instance,

46.75 = (55)(153)/180.

Note also that all expected counts are more than5, and that degrees of freedom = (2-1)(3-1) = 2.

 Instructor #1 Instructor #2 Instructor #3 TOTALS Passed 5046.75 4751.85 5654.40 153 Failed 58.25 149.15 89.60 27 TOTALS 55 61 64 180

The calculation of x2 yields

x2 = (50-46.75)2/46.75 +(47-51.85)2/51.85 + (56-54.40)2/54.40 +(5-8.25)2/8.25 + (14-9.15)2/9.15 +(8-9.60)2/9.60 = 4.84

Using the x2 table with 2 degrees of freedom, we cannot rejectH0 at the 5%level of significance, since the critical region is x2 > 5.99, and our calculated valueis not in this region. At the 10% level of significance, the criticalregion is x2 > 4.61. We wouldreject H0 atthis level.

Using the TI-83 to calculate a P-value, we havex2 cdf(4.84,1E99,2) = .0889216175, or about 8.9%. Note that this"jives" with rejection of H0 at the 10% level ofsignificance, and non-rejection at the 5% level.

===========================

On page 735, the authors note that the chi-squaretest and the z-test "agree" when you have a 2-by-2 table situation.In this situation, the chi-square statistic is the square of thez-statistic, and the P-value for x2 is the same for the two-sided P-value for z. What followsis an attempt to illustrate this fact using data from Example 12.13(page 683). Here is the data in tabular from with expected valuescalculated and displayed.

 Gemifibozoil Placebo TOTALS Heart attack 5670.36 8469.64 140 No heart attack 19951980.64 19461960.36 3941 TOTALS 2051 2030 4081

On page 685, the calculated z-statistics is shownto be z = -2.47.

The calculated x2 is

x2 = (56-70.36)2/70.36 +(84-69.64)2/69.64 + (1995-1980.64)2/1980.64 +(1946-1960.36)2/1960.36 = 6.101.

Note that (-2.47)2 = 6.101, illustrating that,in this situation, x2 = z2.

The degrees of freedom here is (2-1)(2-1) = 1. TheP-value for x2 is x2 cdf(6.101,1E99,1) = .0135105406, or about 1.35%.

On page 685, the authors give a 1-sided P-value(for the z-statistic) of .0068. Note that 2(.0068) = .0136, or about1.36%, further illustrating what the authors are saying in theircomparison of x2 and z on page 735.