Stat3022 hw3

Stat3022 hw3 - Stat3022 Hw3 Yutong Gao 2.23 > dat <-

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Stat3022 Yutong Gao Hw3 2.23 > dat <- read.csv("http://www.stat.umn.edu/~graalum/data/ch2/ex0223.csv",header=T) > attach(dat) Looking at the R output given below, we can confirm that there is strong evidence that the percentage change was greater in states that increased their speed limits since the mean of change in fatalities in the states increased speed limites (x=13.753125) is much greater than the mean of the change in fatalities in the states that retained(y=-8.563158). And the p-value indicated that there is a significant difference in means that is not equal to 0. (two-sided p-value = 0.009747 from a two-sample t-test). > names(dat) [1] "STATE" "INCREASe" "FATALITIESCHANGE" > increase<-FATALITIESCHANGE[INCREASe=="Yes"] > remain<-FATALITIESCHANGE[INCREASe=="No"] > t.test(increase,remain,alternative="two.sided",varequal=F) Welch Two Sample t-test data: increase and remain t = 2.7722, df = 28.248, p-value = 0.009747 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 5.833028 38.799538 sample estimates: mean of x mean of y 13.753125 -8.563158 > mean(increase)-mean(remain) [1] 22.31628 We also confirm that the estimated difference between these two group is 13.753125+8.563158= 22.31628. A 95% condence interval is between (5.833028, 38.799538 ). 3.28(a) > dat <- read.csv("http://www.stat.umn.edu/~graalum/data/ch3/ex0328.csv",header=T) > attach(dat) > names(dat) [1] "REMOVED" "DURATION" "BEE" > boxplot(REMOVED~BEE,ylab="proportion of pollen removed",xlab="BEE")
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
> dat$logP<- with(dat,log(REMOVED/(1-REMOVED))) > attach(dat) The following object(s) are masked from 'dat (position 3)':
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

Stat3022 hw3 - Stat3022 Hw3 Yutong Gao 2.23 &gt; dat &lt;-

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online