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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
