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,

(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, ,,p) 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, B Jb=1* we have B estimates {3}. 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
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Heres an R func... View full answer
Get step-by-step solutions from verified subject matter experts
