Anda di halaman 1dari 5

# Homework 4 STAT 3022 10/5/2012 Alex Blenkush - 3899339 Trevor Clayton - 4172617 Kelly Ebert - 4116316 Betsy Hagen

## - 3922343 Carl Johnson - 4732120

PROBLEM 1 Using data describing the weight of 35 male house sparrows that survived and 24 that perished in a severe winter storm, we are attempting to determine if the mean weight of the sparrows that perished is at least 2g larger than those that survived. > url = "http://users.stat.umn.edu/~chen2285/STAT3022/Data/Weight.csv" > weight=read.csv(url,header=T) > attach(weight) > scores <- tapply(weight\$WEIGHT, weight\$STATUS, list) > S <- scores\$survived > P <- scores\$perished t.test(P, S, alternative = greater, mu = 2) Welch Two Sample t-test data: P and S t = -3.2256, df = 44.305, p-value = 0.9988 alternative hypothesis: true difference in means is greater than 2 95 percent confidence interval: 0.1934764 Inf sample estimates: mean of x mean of y 26.27500 25.46286

We used the independent two-sample t-test to test the null hypothesis, Ho: 1-2=2 against the alternative hypothesis, Ha: 1-2>2 where 1 is the mean weight of the sparrows that survived and 2 is the mean weight of the sparrows that perished. With the p-value .9988>.05, we fail to reject the null hypothesis. We cannot conclude that the mean weight of those that perished is at least 2g larger than those that survived at a significance level of =.05.

PROBLEM 2 In this problem, we are trying to determine if raising the speed limit on highways increased fatalities by 15% or not. We are already aware that raising the speed limit increased fatalities, but in order to make the results look more significant we would like to determine if the number of fatalities increased by 15% or more. To do this, we can use a one-sample t-test. In this test, the null hypothesis is that the percentage increase of fatalities is 15%, and the alternate hypothesis is that the percentage increase is more than 15%. Ho: mu=15 Ha: mu>15 The results of the one-sided t-test are as follows: One Sample t-test data: INCREASe t = -0.3306, df = 31, p-value = 0.7431 alternative hypothesis: true mean is not equal to 15 89 percent confidence interval: 7.548241 19.958009 sample estimates: mean of x 13.75312 This tells us that at a confidence level of 89 percent, the true mean percentage increase of fatalities lies within approximately 7.55 and 19.96. With a p value of .7431, we would conclude that we would not reject the null hypothesis, and that we would stick with the conclusion that the percentage increase in fatalities is not greater than 15%. To make sure that our test results are credible, we check to see if the normality assumption is satisfied. The graphs below indicate that the normality assumption is satisfied, and that we are able to use our test results.

PROBLEM 3 In problem 3 we are attempting to determine the effect of preschool on two different factors: whether or not one is arrested at least 5 or more times by age 40, and whether or not one makes an annual income of at least \$20K by age 40. The following R-code tests the null hypothesis Ho:p1=p2 against the alternative hypothesis Ha:p1>p2 where p1 is the population that went to pre-school and p2 is the population that went to pre-school and was also arrested 5 or more times by age 40. > prop.test(x = c(58, 20), n=c(123, 119), alternative = "greater") 2-sample test for equality of proportions with continuity correction data: c(58, 20) out of c(123, 119) X-squared = 24.132, df = 1, p-value = 4.498e-07 alternative hypothesis: greater 95 percent confidence interval: 0.2021507 1.0000000

sample estimates: prop 1 prop 2 0.4715447 0.1680672 With the p-value 4.498e-07<.05, we reject the null hypothesis and cannot conclude at a significance level of =.05 that the amount which attended pre-school is equal to that which attended pre-school and was also arrested by age 40.

The following R-code tests the null hypothesis Ho:p1=p2 against the alternative hypothesis Ha:p1<p2 where p1 is the population that went to pre-school and p2 is the population that went to pre-school and also made an annual income of at least 20k by age 40. > prop.test(x = c(58, 34), n=c(123, 119), alternative="less") 2-sample test for equality of proportions with continuity correction data: c(58, 34) out of c(123, 119) X-squared = 8.0928, df = 1, p-value = 0.9978 alternative hypothesis: less 95 percent confidence interval: -1.0000000 0.2947013 sample estimates: prop 1 prop 2 0.4715447 0.2857143 With the p-value .9978>.05, we fail to reject the null hypothesis that the population which attended preschool is equal to that which attended preschool and also made an annual income of at least 20k by age 40. PROBLEM 4 In problem 4 we are trying to determine what the true population proportion is for people who think Kevin McHale should return as coach. We are also testing to see if the true population proportion is .37. Second, we are determining the 94.6% confidence interval for the true proportion, and finally we are obtaining the minimum sample size required to have a confidence interval no longer than .01. Our main conclusions to these questions are as follows: the true proportion is approximately .30, we reject the null hypothesis that the true proportion is .37, the 94.6% confidence interval for the true proportion is [.275, .327], and the minimum sample size is 1248. ## True Proportion

x = 356 n = 1187 phat = x/n se = sqrt((phat*(1-phat))/1187) prop.test(356, 1187, alternative = two.sided, p = .37) p value = 6.65 * 10^-7 ## 94.6% confidence interval phat + 1.93 * se(phat) phat - 1.93 * se(phat) prop.test(356, 1187, alternative = two.sided, p = .37, conf.level = .946) [.275, .327] ## Least sample size z.star = qnorm((1-.946) / 2, lower.tail = FALSE) phat = 356/1187 (2^2 * z.star^2 * phat * (1-phat)) / .05^2 n = 1248 Due to the p-value of nearly 0, I chose to reject the null hypothesis that the true proportion is .37.