When I use boot()
for a series of regression coefficients, I get the display of Bootstrap Statistics as shown below. Is there a way of retrieving these Bootstrap Statistics in the form of a data frame?
bs<-function(formula, data, indices) {
d<-data[indices,]
fit1<-lm(formula,data=d)
r<-residuals(fit1)
taus<-c(0.1, 0.2, 0.3, 0.4, 0.5)
fit2<-rq(srs~r, tau=taus, data=d)
return(coef(fit2))
library(boot)
results<-boot(data=earli, statistic=bs, R=1000, formula=Freq~prepreg_bmi+mat_age)
results
Bootstrap Statistics :
original bias std. error
t1* 39.000000 -0.06213177 0.4923311
t2* 0.000000 0.81613987 0.9480617
t3* 39.994080 0.20734506 0.5515006
t4* 1.978584 -0.27895713 1.0157747
t5* 41.494479 0.08356320 0.6923510
t6* 2.982711 -0.28310189 1.2957767
t7* 43.464062 -0.22307964 0.7879350
t8* 3.075496 0.31197213 1.4150300
t9* 44.974168 0.03526846 0.8638345
t10* 3.978100 -0.53116587 1.5490870
I tried results$t0
but that gave me only the intercepts and coefficients within a data frame.
I would like to get the standard errors within the data frame too.
New contributor
Jeff S is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.