Can you help me answer iv, v, and vi using R please? my answers for i,ii, and iii can be seen below. Thank you! 1. Researchers found that the speed of a prey (twips/s) and the length of prey (twips x 100) are good predictors of the time (s) required to catch a prey. (A twip is a measure of distance used by programmers). Data were collected in an experiment in which subjects were asked to "catch" an animal prey moving across his or her computer screen by clicking on it with the mouse. The investigators varied the length of the prey and the speed with which prey moved across the screen. ```{r}prey <- read.csv("https://www.siue.edu/~jpailde/prey.csv")prey``` i) Fit a multiple regression model for predicting catch time using prey length and speed as predictors. ii) Construct 95\% confidence interval for the regression slopes of each predictor. Interpret your result. Will the interpretation change if you change the confidence level to 90\% and 99\%? iii) Predict the catch time for two animals whose lengths are 4 and 6; and whose speeds are 30 and 60, respectively. State your result in paragraph form including the associated prediction intervals. iv) Is the multiple regression model useful for predicting catch time? Use `R2`, `adj-R2`, and test the relevant hypothesis using `alpha = 0.05`. State your conclusion. v) The primary researchers suggest that a simple regression model with the single predictor `x = length/speed` might be a better model for predicting catch time. Calculate and add the `x` values to the data using the function `mutate` in the package `dplyr`. Fit a simple linear regression model using the new variable/column `x`. vi) Which of the two models considered (the multiple regression model in part (i) or the simple regression model in part (v)) would you recommend for predicting catch time? Justify your choice. ### Code chunk```{r} # start your code#imodel <- lm(Catch.Time ~ Prey.Length + Prey.Speed, data = prey)summary(model) #iiconfint(model, level = 0.95) #iiinew_data <- data.frame(length = c(4, 6), speed = c(30, 60))predict(model, inerval="prediction")predictions <- predict(model, newdata = new_data, interval = "prediction")
Can you help me answer iv, v, and vi using R please? my answers for i,ii, and iii can be seen below. Thank you!
1. Researchers found that the speed of a prey (twips/s) and the length of prey (twips x 100) are good predictors of the time (s) required to catch a prey. (A twip is a measure of distance used by programmers). Data were collected in an experiment in which subjects were asked to "catch" an animal prey moving across his or her computer screen by clicking on it with the mouse. The investigators varied the length of the prey and the speed with which prey moved across the screen.
```{r}
prey <- read.csv("https://www.siue.edu/~jpailde/prey.csv")
prey
```
i) Fit a multiple regression model for predicting catch time using prey length and speed as predictors.
ii) Construct 95\% confidence interval for the regression slopes of each predictor. Interpret your result. Will the interpretation change if you change the confidence level to 90\% and 99\%?
iii) Predict the catch time for two animals whose lengths are 4 and 6; and whose speeds are 30 and 60, respectively. State your result in paragraph form including the associated prediction intervals.
iv) Is the multiple regression model useful for predicting catch time? Use `R2`, `adj-R2`, and test the relevant hypothesis using `alpha = 0.05`. State your conclusion.
v) The primary researchers suggest that a simple regression model with the single predictor `x = length/speed` might be a better model for predicting catch time. Calculate and add the `x` values to the data using the
vi) Which of the two models considered (the multiple regression model in part (i) or the simple regression model in part (v)) would you recommend for predicting catch time? Justify your choice.
### Code chunk
```{r}
# start your code
#i
model <- lm(Catch.Time ~ Prey.Length + Prey.Speed, data = prey)
summary(model)
#ii
confint(model, level = 0.95)
#iii
new_data <- data.frame(length = c(4, 6), speed = c(30, 60))
predict(model, inerval="prediction")
predictions <- predict(model, newdata = new_data, interval = "prediction")
Step by step
Solved in 2 steps