In R script (help with code) (there is a bootfunction in a bootstrap package — don’t usethis!)
Write a function to produce a 95% bootstrap confidence intervalfor a mean. (using functions andloops)
Your function should: Draw a sample the same size as the vector,selecting from the vector itself, with replacement. Compute themean of the vector, and store it in another vector. Repeat thesteps above n times. Compute the interval as the 2.5% and 97.5%quantiles of the vector of means.
Solution