Hi, the following codes provided me results of bootstrapped logistic regression, but boot.ci() only provide one CI, which I have no idea what it it. I wonder if there is a way to obtain the CI for each factor in the model. Any help is appreciated.
logistic_coef <-function(d, i){
d <- d[i,]
fit <- glm(bpd ~ birthwt + gestage + toxemia,
data = d,
family = "binomial")
return(coef(fit))
}
#apply the boot() function
#sytem.time estimate time used
set.seed(77)
system.time(boot_logistic <- boot(data = bpd,
statistic = logistic_coef,
R=5000))
#view results
boot_logistic
boot.ci(boot_logistic, type = "perc")
Call:
boot(data = bpd, statistic = logistic_coef, R = 5000)
Bootstrap Statistics :
original bias std. error
t1* 13.936082577 0.4182376970 2.7596107013
t2* -0.002643578 -0.0001080289 0.0009459613
t3* -0.388535681 -0.0107899365 0.1042887437
t4* -1.343786469 -0.1162307066 1.0181248939
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 5000 bootstrap replicates
CALL :
boot.ci(boot.out = boot_logistic, type = "perc")
Intervals :
Level Percentile
95% ( 9.32, 20.01 )
Calculations and Intervals on Original Scale