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

Gustaf Rydevik gustaf.rydevik at gmail.com
Wed Jul 23 11:46:36 CEST 2008


On Wed, Jul 23, 2008 at 4:54 AM, Michal J. Figurski
<Michal at mail.med.upenn.edu> wrote:
> Dear all,
>
> Since you guys are frank, let me be frank as well. I did not ask anyone to
> impose on me their point of view on bootstrap. It's my impression that this is
> what you guys are trying to do - that's sad. Some of your emails in this
> discussion are worth less than junk mail - particularly the ones from Mr Harold
> Doran. It's even more sad that you use junior members of this forum to make fun
> and intimidate.
>
> Apparently, even with all your expertise and education in this area, many of you
> - experts - do not understand what I am talking about. You seem to be so much
> affixed to your expertise, that you can't see anything beyond it.
>
> Dear experts: if you do not wish to answer a question, why do you take time to
> send useless emails?
>
> Honestly, if you wished to help and educate me, these words as in email below
> would never see light. Now that is expert advice. I am impressed!
>
>
> --
> Michal J. Figurski
>

It seems as if there are two issues here:
1) Learning R
and
2) Learning statistics.


As for 1), here is a solution to what i think you wanted to do (and as
always, if you had provided some sample data and code attempts it
would have made things easier):

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)

I've never tried using any of the prepackaged bootstrap functions
since it's so easy to write your own. And I never really figured out
why you wanted to split the data in two, unless you do it before
bootstrapping to have a test set.

Regards,

Gustaf

-- 
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik



More information about the R-help mailing list