Question

In: Statistics and Probability

Coding in R: There are two options of working in R: • install R on your...

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.

Solutions

Expert Solution

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.


Related Solutions

You are working on a project to install 200 new computers for your department. Your sponsor...
You are working on a project to install 200 new computers for your department. Your sponsor is the CTO (Chief Technology Officer). Although the CTO is your key stakeholder, you know that many other individuals will affect the success or failure of your project. This is the first time you have worked with this CTO, and you have heard that he often changes his mind about the requirements and due date. In fact, you heard that a PM who failed...
USE R CODING! Pleaseee I need the code With R coding Obs: it supposed to use...
USE R CODING! Pleaseee I need the code With R coding Obs: it supposed to use probability density function like X ~ Binomial( n ,p ) dbinom(X=?, n, prob) pbinom(X=?, n, prob) rbinmo(幾個符合二項分配的X, n, prob) X~Poisson (lamda) dpois(X=?, lamda) ppois (X=?, lamda) rpois (X, lamda) **Suppose the random variable X obeys the binomial allocation B (n=100, p=0.1) (a) Use X as the binomial allocation to calculate P(12≤X≤14) (b) In practice, when np ≥ 5 and n(1-p) ≥ 5, X will...
Coding in R Im trying to plot a histogram in R, and i know the basic...
Coding in R Im trying to plot a histogram in R, and i know the basic code for that, however, the code requires 2 plots coming from the same data set. for example, the voltage of an old process vs. a new process. is there any ways to seperate the 2 processes out from the data set to make 2 relative frequencyt histograms?
Please answer the following by coding in R with comments ! Thank you!!! Evaluation of a...
Please answer the following by coding in R with comments ! Thank you!!! Evaluation of a square root is achieved using the sqrt() function, but a warning will be issued when the argument is negative. Consider the following code which is designed to test whether a given value is positive before checking whether the square root of the value is less than 5. testValue <-7 (testValue > 0) & (sqrt(testValue) < 5) ## [1] TRUE testValue <--7 (testValue > 0)...
Please answer the following by coding in R with comments ! Thank you!!! Evaluation of a...
Please answer the following by coding in R with comments ! Thank you!!! Evaluation of a square root is achieved using the sqrt() function, but a warning will be issued when the argument is negative. Consider the following code which is designed to test whether a given value is positive before checking whether the square root of the value is less than 5. testValue <-7 (testValue > 0) & (sqrt(testValue) < 5) ## [1] TRUE testValue <--7 (testValue > 0)...
Define the basic concept of channel coding, and enumerate two types of channel coding?
Define the basic concept of channel coding, and enumerate two types of channel coding?
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
This question requires using Rstudio. This is following commands to install and import data into R:...
This question requires using Rstudio. This is following commands to install and import data into R: > install.packages("ISLR") > library(ISLR) > data(Wage) The required data installed and imported, now this is description of the data: This dataset contains economic and demographic data for 3000 individuals living in the mid-Atlantic region. For each of the 3000 individuals, the following 11 variables are recorded: year: Year that wage information was recorded age: Age of worker maritl: A factor with levels 1. Never...
Install and load the dataset named Carseats (in the ISLR package) into R. Run a multiple...
Install and load the dataset named Carseats (in the ISLR package) into R. Run a multiple linear regression with all the variables. Using the coefficients, write down the model. ( be careful with the qualitative variable ShelveLoc. ) obtain the interaction plot of ShelveLoc and price.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT