In: Statistics and Probability
Coding in R: There are two options of working in R: • install R on your personal computer from: https://www.r-project.org/ and you can do the assignment at home or wherever your computer is.
The Seatbelts data set contains the monthly totals of car drivers in Great Britain killed or seriously injured Jan 1969 to Dec 1984. Compulsory wearing of seat belts was introduced on 31 Jan 1983. The data dictionary for the Seatbelts data set can be found here: https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/UKDriverDeaths. html. Use the following two lines of code to load in the data: data(‘Seatbelts’) Seatbelts<-data.frame(Seatbelts) For each of the following tests find (and clearly identify) the null & alternate hypothesis, test statistic, p-value, and critical value. All tests should have a decision with respect to the null hypothesis, and a concluding sentence.
A) Use a rejection region to test if the number of passengers killed/injured in front seat accidents is larger than the number of passengers killed/injured in rear seat accidents. Use an 8% significance level. (Hint: Each year has measures of both front and rear so you can “PAIR” up these measurements by year).
B) For measurements where the law is 1, these are observations when seatbelt laws came into effect. We wish to test if the law helped reduce injuries from accidents. So, use a p-value to test if the mean number of killed/injured people in front seat accidents is larger when the law was not in effect than the number of killed/injured people in front seat accidents when the law was in effect. Use a 5% significance level. You may assume that the data is normally distributed, random and independent. (Hint: look at Lab 5 #2, #3, #4 for examples in sub-setting the data set).
C) For measurements where the law is 1, these are observations when seatbelt laws came into effect. We wish to test if the law helped reduce injuries from accidents. So, build a 95% CI for the difference in the mean number of killed/injured people in rear seat accidents when the law was not in effect (Group 1) against when the law was in effect (Group 2). So build a 95% interval for µNoLaw ? µLaw. You may assume that the data is normally distributed, random and independent. Comment on the interval.
It means that 95% of the times the difference in the mean number of killed/injured people in rear seat accidents when the law was not in effect against when the law was in effect will lie in between -39.98 and 25.14.