Quiz 3 - Vanderbilt Universitybiostat.mc.vanderbilt.edu/.../Bios311Syllabus2014/Quiz_3.pdf · Quiz...
Transcript of Quiz 3 - Vanderbilt Universitybiostat.mc.vanderbilt.edu/.../Bios311Syllabus2014/Quiz_3.pdf · Quiz...
-
Quiz 3Lucy D’Agostino McGowan
September 9, 2014
Q1 Rosner’s Ch 5 Nutrition set of problems, 5.6 - 5.9.
5.6140−124
20 =1620 = .8
1-pnorm(.8)
## [1] 0.2119
21.2%
5.790−124
20 = −1.7
1-pnorm(1.7)
## [1] 0.04457
4.46%
5.8140−121
19 = 1
1-pnorm(1)
## [1] 0.1587
15.9%
5.990−121
19 = −1.63158
1-pnorm(1.63158)
## [1] 0.05138
5.2%
Q2 Rosner’s Ch 5 Nutrition set of problems, 5.21 - 5.24.
5.212.5−3.5
0.6 =−10.6 = -1.667
1
-
pnorm(-1.66667)
## [1] 0.04779
#orpnorm(2.5,3.5,0.6)
## [1] 0.04779
5.222.5−4
0.5 =−1.50.5 = -3
pnorm(-3)
## [1] 0.00135
#orpnorm(2.5,4,0.5)
## [1] 0.00135
5.232.5−(4−0.03∗(30))
0.02∗30 =2.5−3.1
0.6 = -1
pnorm(-1)
## [1] 0.1587
#orpnorm(2.5,4-0.03*30,0.02*30)
## [1] 0.1587
5.245.232.5−(4−0.03∗(50))
0.02∗50 =2.5−2.5
0.6 = 0
pnorm(0)
## [1] 0.5
#orpnorm(2.5,4-0.03*50,0.02*50)
## [1] 0.5
Q3a Let X ~ Binom(20, 0.17). Let Y ~ N( mu=E[X], sigma=sqrt(V[X]) ), i.e. Y is Normal with mean andvariance equal to that of the Binomial X. Take a large sample from each of X and Y and sort them fromsmallest to largest. Plot Y by X. By large, I mean try getting samples of 10ˆ6. If that crashes your laptop,go with 10ˆ5.
2
-
x
-
sum(y > q3b1)/10^6
## [1] 0.1587
• P( X > E[X] + 2*sqrt(V[X]) )
sum(x > q3b2)/10^6
## [1] 0.04073
• P( Y > E[X] + 2*sqrt(V[X]) )
sum(y > q3b2)/10^6
## [1] 0.02286
• P( X > E[X] + 2.5*sqrt(V[X]) )
sum(x > q3b2.5)/10^6
## [1] 0.01251
• P( Y > E[X] + 2.5*sqrt(V[X]) )
sum(y > q3b2.5)/10^6
## [1] 0.006184
• P( X > E[X] + 3*sqrt(V[X]) )
sum(x > q3b3)/10^6
## [1] 0.003214
• P( Y > E[X] + 3*sqrt(V[X]) )
sum(y > q3b3)/10^6
## [1] 0.001302
Q4a Repeat Q3a for Binom(100, 0.17).
x
-
5 10 15 20 25 30 35
010
2030
x
y
Q4b Repeat Q3b for Binom(100, 0.17).
q3b1 q3b1)/10^6
## [1] 0.1587
• P( X > E[X] + 2*sqrt(V[X]) )
sum(x > q3b2)/10^6
5
-
## [1] 0.02712
• P( Y > E[X] + 2*sqrt(V[X]) )
sum(y > q3b2)/10^6
## [1] 0.02262
• P( X > E[X] + 2.5*sqrt(V[X]) )
sum(x > q3b2.5)/10^6
## [1] 0.008045
• P( Y > E[X] + 2.5*sqrt(V[X]) )
sum(y > q3b2.5)/10^6
## [1] 0.006088
• P( X > E[X] + 3*sqrt(V[X]) )
sum(x > q3b3)/10^6
## [1] 0.00205
• P( Y > E[X] + 3*sqrt(V[X]) )
sum(y > q3b3)/10^6
## [1] 0.001265
Q5a Repeat Q3a for Binom(1000, 0.17).
x
-
120 140 160 180 200 220
120
160
200
x
y
Q5b Repeat Q3b for Binom(1000, 0.17).
q3b1 q3b1)/10^6
## [1] 0.1586
• P( X > E[X] + 2*sqrt(V[X]) )
sum(x > q3b2)/10^6
7
-
## [1] 0.02538
• P( Y > E[X] + 2*sqrt(V[X]) )
sum(y > q3b2)/10^6
## [1] 0.02263
• P( X > E[X] + 2.5*sqrt(V[X]) )
sum(x > q3b2.5)/10^6
## [1] 0.007375
• P( Y > E[X] + 2.5*sqrt(V[X]) )
sum(y > q3b2.5)/10^6
## [1] 0.006216
• P( X > E[X] + 3*sqrt(V[X]) )
sum(x > q3b3)/10^6
## [1] 0.001711
• P( Y > E[X] + 3*sqrt(V[X]) )
sum(y > q3b3)/10^6
## [1] 0.00131
Q6 Discuss what Q3 - Q5 teaches us. A bullet point discussion is fine.As we increase the number of trials, we see that the binomial distribution better approximates the normaldistribution
8