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

From: Michal Figurski <figurski_at_mail.med.upenn.edu>
Date: Wed, 23 Jul 2008 09:15:22 -0400

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)
>
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Wed 23 Jul 2008 - 13:59:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jul 2008 - 14:32:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive