Skip to content
Back to formatted view

Raw Message

Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076EBB@usctmx1106.merck.com>
Date: 2005-05-03T13:43:52Z
From: Liaw, Andy
Subject: Step wise regression

> From: Frank E Harrell Jr
> 
> walmir-rodrigues wrote:
> > Dear Fellows,
> > 
> > How can I do to proced a step wise regression in R, if it??s 
> possible ?
> > 
> > Thanks,
> > 
> > Walmir 
> 
> Here is an easy approach that will yield results only slightly less 
> valid than one actually using the response variable:
> 
> x <- data.frame(x1,x2,x3,x4,..., other potential predictors)
> x[,sample(ncol(x))]

Hmm...  Shouldn't that be something like:

x[, sample(ncol(x), ceiling(ncol(x) * runif(1)))]

?

Cheers,
Andy

 
> :-)   -Frank
> 
> 
> -- 
> Frank E Harrell Jr   Professor and Chair           School of Medicine
>                       Department of Biostatistics   
> Vanderbilt University
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>