Stat 3011 Midterm 2 (Computer Part)
Rweb:> pt(-5, df=5) [1] 0.002052358
Rweb:> 1 - pt(1.5, df=5) [1] 0.09695184
Rweb:> 2 *(1 - pt(2.0, df=5)) [1] 0.1019395
Rweb:> -qt(0.05, df=5) [1] 2.015048If , then there is probability 0.05 in the lower tail below , probability 0.05 in the upper tail above , and probability 0.90 between and . Thus is the 0.05 quantile and is the 0.95 quantile, and either
- qt(0.05, df=5)or
qt(0.95, df=5)gives the answer.
Rweb:> t.test(x, y, conf.level = 0.99) Welch Two Sample t-test data: x and y t = -0.1572, df = 4.569, p-value = 0.8818 alternative hypothesis: true difference in means is not equal to 0 99 percent confidence interval: -0.04819463 0.04474463 sample estimates: mean of x mean of y 1.097425 1.099150The confidence interval calculated by R, should according to the rules in Section 7.4.3 in Wild and Seber be rounded to one more significant figure than the width of the interval. That's the fourth decimal place here, giving for the rounded interval.
Use of Studen't distribution always requires the assumption of normal population distributions.
The formula for the standard error is
An alternative solution that is not exactly what was asked, but is acceptable is
Rweb:> prop.test(1067 * 0.71, 1067) 1-sample proportions test with continuity correction data: 1067 * 0.71 out of 1067, null probability 0.5 X-squared = 187.3797, df = 1, p-value = < 2.2e-16 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.6815786 0.7368888 sample estimates: p 0.71
Everything is the same as in part (a) except now and . So
An alternative solution that is not exactly what was asked, but is acceptable is
Rweb:> prop.test(67 * 0.91, 67) 1-sample proportions test with continuity correction data: 67 * 0.91 out of 67, null probability 0.5 X-squared = 43.4257, df = 1, p-value = 4.404e-11 alternative hypothesis: true p is not equal to 0.5 95 percent confidence interval: 0.8082773 0.9627865 sample estimates: p 0.91
This is a ``type (c)'' problem in Wild and Seber's classification. The formula for the standard error is
Rweb:> p1 <- 0.77 Rweb:> p2 <- 0.68 Rweb:> n <- 1067 Rweb:> (p1 - p2) + c(-1, 1) * 2 * + sqrt((min(p1 + p2, 2 - p1 - p2) - (p1 - p2)^2) / n) [1] 0.04492794 0.13507206Rounding to three significant figures we get . If you did do it by hand, the plus-or-minus form is or (rounded) .
(Note: prop.test doesn't understand this kind of problem, so is useless here.)
Everything is the same as in part (c) except now , , and . So
Rweb:> p1 <- 0.95 Rweb:> p2 <- 0.80 Rweb:> n <- 67 Rweb:> (p1 - p2) + c(-1, 1) * 2 * + sqrt((min(p1 + p2, 2 - p1 - p2) - (p1 - p2)^2) / n) [1] 0.03345778 0.26654222Rounding to three significant figures we get . If you did do it by hand, the plus-or-minus form is or (rounded) .
(Note: prop.test doesn't understand this kind of problem, so is useless here.)