Question
(a) Program your own function in R to do the following: The input is a data.frame of n rows with each row containing (Y,I1, .
(a) Program your own function in R to do the following: The input is a data.frame of n rows with each row containing (Y,I1, . , Ip) and a positive integer B. It does the following calculation: repeat for b = 1, 2, ...,B: randomly sample n rows of the data with replacement, putting them into a new data.frame and fit OLS of y 2 against all the predictors. Keep the fitted coefficient B). For each j = 1, ... , P, we have B estimates {},"}&1. Plot the histogram of the B values and return the 2.5% and 97.5% quantiles of the set, denoted by CI.j. Such intervals are called bootstrap confidence intervals.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started