{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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")
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern