[R] Coefficients of Logistic Regression from bootstrap - how to get them?

Michal Figurski figurski at mail.med.upenn.edu
Wed Jul 23 15:15:22 CEST 2008


Thank you Gustaf,

I apologize for not including an example data in my first email. 
Nevertheless, your code worked for me excellently - I only added "55" as 
the size of sample.

I must admit this code looks so much simpler, compared to SAS. I am 
beginning to love R, despite some disrespectful experts in this forum.

--
Michal J. Figurski

Gustaf Rydevik wrote:
> 
> figurski.df<-data.frame(name=1:109,num1=rnorm(109),num2=rnorm(109),num3=rnorm(109),outcome=sample(c(1,0),109,replace=T))
> library(Design)
> lrm(outcome~num1+num2+num3,data=figurski.df)$coef
> coef<-list()
> for (i in 1:100){
> tempData<-figurski.df[sample(1:109,replace=T),]
> coef[[i]]<-lrm(outcome~num1+num2+num3,data=tempData)$coef
> }
> coef.df<-data.frame(do.call(rbind,coef))
> median(coef.df$num1)
>



More information about the R-help mailing list