Sunteți pe pagina 1din 4

STAT 166: STATISTICS FOR SOCIAL SCIENCES Exercise: Contingency Tables

Contingency Tables Sex of Pigs Barrow (M) Gilt (F) Total Tail biting No evidence Lesions to Loss 231 868 72 645 303 1513 Total 1099 717 1816

1. Compute for the conditional distribution wherein the conditioning event is the sex of the pig. 2. Test whether sex of the pigs is independent with tail biting at =5%. 3. Compute for Chi-square based measure of association, if appropriate. 4. Compute for the odds of a gilt having no evidence of tail biting over lesions to loss. Interpret. 5. Compute for the odds of a barrow having no evidence of tail biting over gilt having no evidence of tail biting. Interpret.

STAT166 Statistics for Social Sciences First Semester 2012-2013 JCYnion

STAT 166: STATISTICS FOR SOCIAL SCIENCES Exercise: Contingency Tables

Contingency Tables 1. Compute for the conditional distribution wherein the conditioning event is the sex of the pig. a. For a randomly selected barrow, the probability of having no evidence: P(NE|barrow) = 231/1099 = 0.2102 b. For a randomly selected barrow, the probability of having no evidence: P(NE|gilt) = 72/717 = 0.1004 c. For a randomly selected barrow, the probability of having no evidence: P(LL|barrow) = 868/1099 = 0.7898 d. For a randomly selected barrow, the probability of having no evidence: P(LL|gilt) = 645/717 = 0.8996 Using STATA:
. tabulate sex tail [fweight=count], all exact | tail sex | lesions no eviden | Total -----------+----------------------+---------barrow | 868 231 | 1,099 gilt | 645 72 | 717 -----------+----------------------+---------Total | 1,513 303 | 1,816 Pearson chi2(1) likelihood-ratio chi2(1) Cramr's V gamma Kendall's tau-b Fisher's exact 1-sided Fisher's exact = = = = = = = 37.6131 39.7919 -0.1439 -0.4090 -0.1439 Pr = 0.000 Pr = 0.000 ASE = 0.060 ASE = 0.021 0.000 0.000

STAT166 Statistics for Social Sciences First Semester 2012-2013 JCYnion

STAT 166: STATISTICS FOR SOCIAL SCIENCES Exercise: Contingency Tables

2. Test whether sex of the pigs is independent with tail biting at =5%. Ho: the sex of the pig is independent with tail biting. Ha: the sex of the pig is not independent with tail biting. Test Procedure: Chi-Square test for independence Test Statistic:
=
i =1 j =1 2 c r c 2

(O

ij

Eij

Eij )

ith row total*jthcolumn total ; Eij = n

2 2 c > 0.05 21 * 21 = 3.84 ( )( ) Decision Rule: Reject Ho if

p-value < =0.05, Otherwise, fail to reject Ho. Computation:


X2 = c

231-183.37 183.37

) +(
2

868-915.63 915.63 597.37

72-119.63 119.63

) +(

645-597.37

=37.61

see STATA output: P-value=0.000 Decision: since 37.61 > 3.84 or p-value=0.000<0.05, we reject H0 Conclusion: At =5%, we have sufficient evidence to say that sex of pigs and tail biting are associated.
STAT166 Statistics for Social Sciences First Semester 2012-2013 JCYnion

STAT 166: STATISTICS FOR SOCIAL SCIENCES Exercise: Contingency Tables

3. Compute for Chi-square based measure of association, if appropriate. Cramr's V = 0.1439 4. Compute for the odds of a gilt having no evidence of tail biting over lesions to loss. Interpret. Odds = (72/717) (645/717) = 0.1116 For a gilt, the odds of having no evidence of tail biting is 0.1116 times more likely than lesions to loss. 5. Compute for the odds of a barrow having no evidence of tail biting over gilt having no evidence of tail biting. Interpret. Odds ratio = (231*645)/(72*868) = 2.38 The odds of a barrow having no evidence of tail biting is 2.38 times more likely than a gilt having no evidence of tail biting.

STAT166 Statistics for Social Sciences First Semester 2012-2013 JCYnion

S-ar putea să vă placă și