This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: STAT 3022 TA: Jinghan Meng Homework 9 Solutions 14.10. (a) £11 2 i—gg é 0.7606 for exclusiveterritory ﬁrms. (1)) f7; = g 2 0.5357 for other
ﬁrms. (c)odd51 = 2 3.1765 and odds;; = TEE]: i 1.1538. (d) log(oddsl) : 1.1558 and 171 A
log(oddsz) : 0.1431. (Be sure to use the natural logarithm for this computanon.) 14.11. (a) n... = $6 = 0.2123 for women and ,0,“ = g 4 0.1076 for men. (b) odds... = 7% i 0.2704 and oddslrn = Tihﬁ; é 0.1205. (c) log(oddsw) 211.3079 and log(oddsm) a —2.1158. 14.12. (a) 170 = log(oddsz) : 0.1431 and b] = log(oddsl) — log(odd52) é 1.0127. (b) The ﬁtted
model is log(odds) = 0.1431 + 1.0127x. (c) The odds ratio is odds. /oddsz = eh 5 2.7529. 14.13, (a) b0 2 log(oddsm) & —2.1158 and b; = l.og(oddsw) — log(oddsm) : 0.8079.
(b) The ﬁtted model is log(odds) = —2.1158 + 0.807%. (c) The odds ratio is
oddsw/oddsm = ab: 2 2.2432. 14.35. For women, the preponioni odds, and logodds for testing'positive are ,6. = % 2 0.1414, oddsr = A1“; e 0.1646, and log(odd5f) 2 —1.8040. For men, these numbers are ﬁm = % é 0.3388, oddsl.l1 = TE: é 0.5124. and log(oddsm) : —0.6686.
The ﬁtted logistic regression model depends on whether we use x = 1 to indicate male or
female (the exercise does not specify which to use). If x = 1 for males, we have:
log(odds) = —1.8040 + 1.13551: and odds ratio 3.1126
If x = 1 for females, we have:
log(odds) = —0.6686 — 1.1355: and odds ratio 0.3213
The odds of teSILing positive for alcohol are about 3 times higher for men than for women. (0r, those odds are about onethird as high for women as for men.) 15.9. (a) See table. (1)) For Story 2, W = 1—St0ry 1 r Story 2 3 + 9 + 4 + 7 + 10 = 38 Under H03 Child Progress LScore Rank Licorc Rank
2 (5)111) = 27 5 high 055 4.5 0.80
W 2 ' high 0.57 6 0.82 p.
h' h 0.72 3.5 0.54
O‘w = ./——u(5)(f;(l]) : 4.7371 ‘3 high 0.70 7 0.79
(c) z = a 2.19; with the continuity high 0.84 10 0.89
low 0.40 3 0.77
low 0.72 8.5 0.49
low 0.00 1 0.66
low 0.36 2 0.28
low J_ 0.55 4.5 ]_0.38 correction, we compute W i 2.09, which gives P = P(Z > 2.09) = 0.0183.
(d) See the table. osoooaaciumeia
MumehOﬂPNDOD H STAT 3022 TA: Jinghan Meng EX 15.13(b) Hg: There is no difference in the number of species on logged and
unlogged plots vs. Ha: Unlogged plots have a greater variety of species. First,
I conduct the test by hand. Unlogged 22 22 15 13 19 19 18 20 21 13 13 15
Rank 20.5 20.5 9.5 5 10.5 16.5 14 18 19 5 5 9.5 Logged 17 18 18 15 12 4 14 15 10
Rank 12 14 14 9.5 3 1 7 9.5 2 Sum of ranks for unlogged group is W : 159. m = 12, 112 = 9, N = 21,
so W has the mean my = nﬁN + 1)/2 = 132, and standard deviation 0w = ,xn1n2(N+ 1)/12 = 1407. So the pvalue is
159 — 132
14.07 The W'ilcoxon test using R has P = 0.029. We conclude that the observed dif—
ference is signiﬁcant, unlogged plots really do have a greater number of species. P(W > 159) = P(.~. > )= 0.027 9x15.13 <— read.table("D:/ch15/ex15_013.txt", header=T)
attach(ex15.13) speciesl <— species[group==1] species2 <— speciesEgroup==2J
wilcox.test(speciesl,species2,alternative="greater") VVVVV Wilcoxon rank sum test with continuity correction data: speciesl and species2
W = 81, pvalue = 0.02900
alternative hypothesis: true location shift is greater than 0 Warning message:
In wilcox.test.defau1t(speciesl, speciesE, alternative = "greater")
cannot compute exact pvalue with ties EX 15.29 (a) The stemandleaf plot is given below by R.
(b) First, I conduct the Wileoxon signed rank test to the differences between
observations and 105 by hand. The. differences between observations and 105
are: 13.17.2 6.4 17.3 0.4 10.0 1.2 5.4 8.4 14.3 0.2 3.3. Then the Wilcoxon
signed rank statistic is the sum of the ranks of the positive differences ‘er+ = 31.
n. = 12, and W has the mean pw+ = n(n + 1}/4 = 39, and standard deviation aw+ = ,/n(n +1)(2n + 1)/24 = 12.75. So the p—value is 31 — 39
+ w =
2P(W < 31) — 2P(z < 12.75 ) 0.53
There is no evidence that the median is other than 105. Below are R codes to do this test. ST¥¥T 3022 TVX:Jinghan hdeng > ex15.29 <— read.table("D:/ch15/ex15_029.txt", header=T)
> attach(ex15 29)
> stem(radon,scale=2) The decimal point is 1 digit(s) to the right of the  9 l 2
9 l 578
10  024
10 l 55
11 l 1
11  9
12  2 > wilcox.test(radon105)
Wilcoxon signed rank test data: radon  105
V = 31, pvalue = 0.5693
alternative hypothesis: true location is not equal to 0 EX 15.30 If we compute Haiti content minus factory content (so that a negative
difference means that the amount of vitamin C decreased), we ﬁnd that the
mean change is 5.33 and the median is 6. The stem—andleaf plot is right—
skewed. The Wilcoxon test given by R has P = 9.28 x 10—06. The differences
are systematically negative, so vitamin C content is lower in Haiti. > ex15 30 < read.table{"D:/ch15/ex15_030.txt", header=T) > attachCex15.30)
> stemChaitifactory)
The decimal point is at the I 14  0
—12 I 0000
—10  8 I 0000
6 I 0000000
4  0000
2  0 0 I 0 0  0 2  00 4  0 6  8 I 0 STAT 3022 TA: Jinghan Meng > vilcox.test(haiti,factory,alternative="less")
Wilcoxon rank sum test with continuity correction data: haiti and factory
w = 117.5, pvalue = 9 28e06
alternative hypothesis: true location shift is less than 0 Warning message:
In wilcox.test.default(haiti, factory, alternative = "less") :
cannot compute exact pvalue with ties EX 15.34 (a) We test Ho : a1 = a; = #3 = #4 vs. Ha: Not all n, are equal.
For Kruskal—Wallis, He says that the distribution of the trapped insect count is
the same for all board colors; the alternative is that the count is systematically
higher for some colors. (b) In the order given, the median are 46.4, 15.5, 34.5 and 15 insects; it appears
that yellow is most effective, green is in the middle, and white and blue are least
effective. First, I conduct the Kruskal—Wallis test by hand. Lemon Yellow 45 59 48 46 38 47
20 24 23 21 17 22
White 21 12 14 17 13 17
12.5 3 5.5 9.5 4 9.5 21 14 7
2 11 12.5 5.5 1 Green 37 32 15 25 39 41
16 15 7 14 18 19
16 11 20 8 Blue Rank
Then the sum of ranks for each group: Lemon Yellow, R] = 127; White, R2 =
44; Green, R3 = 89; Blue, R4 = 40. 111 = n; = r13 = T14 = 6 and N = 24. So
the Kruskal—Wallis statistic is 12 1272 «.142 892 402
ff== ——————— ————  + w~ —— 3 25 ==1 .95 (24)(25)( 6 + 6 5 + a) “(l 6 H has chisquare distribution with 3 degrees of freedom. So the p—value is PW2 > 16.95) = 0000?. So we have strong evidence that color affects the
insect count [that is, the difference we observed is statistically signiﬁcant). > ex15.34 <— read.table("D:/ch15/ex15_034.txt", header=T)
> attach(ex15.34) > beetlesl <— beetles[color=="Lemon"] > beetles2 < beetles[color=="White"] STYyT 3022 TUK:Jinghan hieng > beetleSB <— beetlesEcolor=="Green"]
> beetles4 <— beetles[color=="Blue"]
> kruskal.test(list(beetlesl,beetles2,beetle53,beetles4)) KruskalWallis rank sum test data: list(beetle31, beetlesZ, beetles3, beetles4)
KruskalWallis chi—squared = 16.9755, df = 3, pvalue = 0.000715 ...
View
Full Document
 Spring '08
 Staff

Click to edit the document details