Docsity

Gender & Party Identification: Testing Independence & Analyzing Relationship, Lecture notes of Statistics

Toggle sidebar
bg1
Handout 7
More on tests for independence
The following example is taken from your textbook ’An Introduction to Categorical Data Analysis’. It
is a 23table of counts on gender and party identi…cation.
Example 1 (Table in the textbook).
The following table lists the counts as well as the estimated expected counts (under independence) and
standardized residuals in the brackets. The standardized residuals are de…ned as
rij =nij ^ij
q^ij(1 ni+=n)(1 n+j=n)
, where ^ij =ni+n+j=n.
Table 1
Party Identi…cation
Gender Democrat Independent Republican
Female 762 (703.7, 4.50) 327 (319.6, 0.70) 468 (533.7, -5.32)
Male 484 (542.3, -4.50) 239 (246.4, -0.70) 477 (411.3, 5.32)
When testing for independence of gender and party identi…cation, the values of Pearson chi-square and
the LR statistics are X2= 30:1and G2= 30:0, with df= (I1)(J1) = (2 1)(3 1) = 2. The p-value
for both the statistics are smaller than 0:0001. Thus the null hypothesis of independence can be rejected, ie,
gender and party identi…cation seems to related.
Let us take at the standardized residuals. For Democrats and Republicans, they are all larger than 4.5 in
magnitude. For instance, there are far more democrats among women in the sample than would be expected
under the hypothesis of independence. Similarly, there are more republicans among men in the sample than
would be expected under the hypothesis of independence. Let us look at this table more closely.
Three 22sub-tables for race and party identi…cation.
We now look at three 22sub-tables obtained from the table in Example 1. In each case, we test for
independence, obtain the p-value, and write down the estimate of the appropriate odds ratio.
Table 2
Party Identi…cation
Gender Democrat Independent
Female 762 327
Male 484 239
Here df=1, X2= 1:856 and G2= 1:850 (p-value=0.174). The odds ratio of being a democrat when
comparing female to male is ^
= 1:151, which is substantially higher than 1.
Table 3
Party Identi…cation
Gender Democrat Republican
Female 762 468
Male 484 477
1
pf3

Partial preview of the text

Download Gender & Party Identification: Testing Independence & Analyzing Relationship and more Lecture notes Statistics in PDF only on Docsity!

Handout 7

More on tests for independence

The following example is taken from your textbook íAn Introduction to Categorical Data Analysisí. It is a 2  3 table of counts on gender and party identiÖcation.

Example 1 (Table in the textbook). The following table lists the counts as well as the estimated expected counts (under independence) and standardized residuals in the brackets. The standardized residuals are deÖned as

rij = nij ^ij q ^ij (1 ni+=n)(1 n+j =n)

, where ^ij = ni+n+j =n.

Table 1 Party IdentiÖcation Gender Democrat Independent Republican Female 762 (703.7, 4.50) 327 (319.6, 0.70) 468 (533.7, -5.32) Male 484 (542.3, -4.50) 239 (246.4, -0.70) 477 (411.3, 5.32)

When testing for independence of gender and party identiÖcation, the values of Pearson chi-square and the LR statistics are X^2 = 30: 1 and G^2 = 30: 0 , with df= (I 1)(J 1) = (2 1)(3 1) = 2. The p-value for both the statistics are smaller than 0 : 0001. Thus the null hypothesis of independence can be rejected, ie, gender and party identiÖcation seems to related. Let us take at the standardized residuals. For Democrats and Republicans, they are all larger than 4.5 in magnitude. For instance, there are far more democrats among women in the sample than would be expected under the hypothesis of independence. Similarly, there are more republicans among men in the sample than would be expected under the hypothesis of independence. Let us look at this table more closely.

Three 2  2 sub-tables for race and party identiÖcation. We now look at three 2  2 sub-tables obtained from the table in Example 1. In each case, we test for independence, obtain the p-value, and write down the estimate of the appropriate odds ratio. Table 2 Party IdentiÖcation Gender Democrat Independent Female 762 327 Male 484 239 Here df=1, X^2 = 1: 856 and G^2 = 1: 850 (p-value=0.174). The odds ratio of being a democrat when comparing female to male is ^ = 1: 151 , which is substantially higher than 1. Table 3 Party IdentiÖcation Gender Democrat Republican Female 762 468 Male 484 477

Here, df=1, X^2 = 29: 529 and G^2 = 29: 526 (p-value<0.0001) with df=1. It seems that the null hypothesis of independence cannot be rejected. The odds ratio for being a democrat when comparing females to males is 1. Table 4 Party IdentiÖcation Gender Independent Republican Female 327 468 Male 239 477

Here, df=1, X^2 = 9: 661 and G^2 = 9: 689 (p-value=0.002). The odds ratio for independent when comparing females to males is 1. Partitioning of G^2. Table 2 indicates that we can merge Democrats and Independents since the proportions of democrats among females seem to be nearly the same as the proportion of democrats among the males. Thus we can merge the Örst two columns of Table 1 and create a new 2  2 table with Democrats+Independents and Republicans. Table 5 Party IdentiÖcation Gender Democrat+Independent Republican Female 1089 468 Male 723 477 Here, df=1, X^2 = 28: 256 and G^2 = 28: 164 (p-value<0.0001). The p-value for G^2. The odds ratio for democrat+Independent which compares females to males is1.536. Note that G^2 for Table 1 is the sum of G^2 values from Tables 2 and 5. This is an example of partitioning of G^2. Table 2 contains the Örst two columns of Table 1, and Table 5 is obtained from Table 1 by merging the Örst two columns. Note that X^2 of Table 1 is not the sum of X^2 values of Tables 2 and 5.

Remark 1 For any I  J table, one can partition G^2 as sum of G^2 of 2  2 tables. There are explicit rules for such partitioning, and they can be found in the book íCategorical Data Analysisíby Agresti. It should be noted that X^2 for the I  J table is not equal to the sum of partitioned X^2 of 2  2 tables. Still it may be worthwhile to examine the values of X^2 for the 2  2 tables.

Tests for independence with ordinal data.

This data is taken from the textbook, and it is a 5  2 contingency table. The independent variable (X) is alcohol consumption (average number of drinks per day), and the dependent variable (Y ) is infant malfunction.