Professional Documents
Culture Documents
Assignment 2
Assignment 2
We want to test if fatality of accidents depends on its size, i.e., is size of a car and fatality of
accident independent. Since we have small sample, we can use Fisher’s exact test
H0: no difference
H1: large automobiles are more likely to have fatal accidents
Under H0, it is a randomization model. That is, we consider the 9 fatal and 9 non-fatal
accidents are randomly divided into groups of 8 and 10.
9 9 9 9
( )( ) ( )( )
8 2 9 1
𝑃(𝑛12 = 8) = 18 = 0.067 ; 𝑃(𝑛12 = 9) = 18 = 0.0019
( ) ( )
10 10
Problem 2
a)
Since the data are both ordinal, we can use gamma measure of association.
C = 187*(684+442+225+252) + 138*(442+252) + 507*(225+252) + 684*252 = 809740
D = 180*(507+684+183+225) + 138*(507+183) + 442*(183+225) + 684*183 = 688548
𝐶−𝐷
𝛾̂ = 𝐶+𝐷 = 0.081, it shows that there is very weak tendency of fundamentalism of subjects’
religious beliefs by their highest degree of education.
b)
We will test for correlation using Pearson’s p
H0: Degree and fundamentalism of belief are independent
H1: p != 0
𝑢̅ = 2.055, 𝑣̅ = 2, 𝑟 = 0.054, 𝑀2 = 8.013 and p-value = 0.005 < 0.05. We reject null
hypothesis of independence.
c)
There is no obvious advantage here since counts are not extreme in the data and total
sample size also appropriate to use X2 and G2 tests. Indeed, when we calculate we find
X2 = 54.84 and G2 = 55.45, while p-value < 0.00001. It means we reject null hypothesis of
independence in all three tests.
Problem 3
We find X2 = 80.81 for which p-value < 0.00001. Our test was that taking aspirin have same
effect on heart attack as taking placebo, which we reject.
Problem 4
a)
𝑛 𝑛 1598 520
MLE for 𝛿 𝑖𝑠 𝛿̂ = 𝑛 11 − 𝑛 21 = 164250 − 421826 = 0.0085
1+ 2+
b)
We have CI for 𝛿
𝛿̂ = 0.0085
1598∗162652 520∗421306
=√ − = 0.00024
1642503 4218263
95% CI is 0.0085 ± 1.96 ∗ 0.00024 = [0.0008, 0.0009]. Since interval contain only positive
values, we conclude that taking seat belt associated with less fatal injuries.
We have CI for log(RR)
̂ ) = log(7.892) = 2.066
log(𝑅𝑅
1 1 1 1
= √1598 − 164250 + 520 − 421826 = 0.05
1 1 1 1
= + + + = 0.0026
1598 162652 520 421306
Problem 5
Clinic data we saw in the lecture can be given as an example for this. Given the clinic,
response and treatment is conditionally independent. But marginal table give us
odds ratio = 2, thus treatment and response are marginally associated.
Here X: Treatment, Y: Response, Z: Clinic
Problem 6
13∗104
𝜃̂𝑋𝑌(1) = 35∗22 = 1.756, Estimated odds of wife with abnormal heart rate is 75.6% higher
for husband with abnormal heart rate for Z = 1
21∗109
𝜃̂𝑋𝑌(2) = 10∗18 = 12.715, Large odds ratio means, association between wife’s and
husband’s heart ratio is strong, If wife have normal heart ratio, husband also tend to have
normal heart ratio and vice versa.
34∗213
𝜃̂𝑋𝑌 = 32∗53 = 4.27, Here marginal odds ratio also confirms our intuition, so there is no
Simpson’s paradox in the data. One thing to note, as we saw odds ratio for Z=1 and Z=2 have
large difference, it might suggest that years of marriage increase the tendency of having
same (normal or abnormal) heart ratio, i.e. more years pass, tendency increase.