Jaime FradeStat Apps 2: HW3Problem 4.6Calculation of confidence interval from original observation fit lwr upr[1,] 8.755197 8.609724 8.90067Used bootstrapping method to give the following confidence interval. Used a function that was sourced in R, and is listed in code below 2.5% 50% 97.5% 8.801703 9.013620 9.229341Jaime FradeStat Apps 2: HW3Problem 4.6CODE: (R-Code)install.packages("alr3")library(alr3)data(wm1)attributes(wm1)fit1 = lm(CSpd~RSpd, data=wm1)x1 = data.frame(RSpd = 7.4285)predict(fit1, x1, interval="confidence")par(mfrow=c(2,2))plot(fit1)SOURCE (R-code)btstrp_4.6 = function(original_data){total = length(original_data[,1]);c1 = 1:total;meanCSpd = NULL;for(i in 1:999){data_num = sample(c1,replace=T);rearrange_data = original_data[data_num,];temp_meanCSpd = mean(rearrange_data$CSpd);meanCSpd = rbind(meanCSpd,temp_meanCSpd);}p1 = c(0.025,0.5,
View Full Document