[R] Backward elimination in regression

From: <Denis.Aydin_at_unibas.ch>
Date: Tue, 22 Mar 2011 08:12:00 +0100


Dear all

I want to run a simple multiple linear regression model, say:

mod <- lm(y~x1+x2+x3+x4)

I have programmed a custom algorithm to calculate the p-values, because there is clustering present.

I ordered the variables according to their p-value and want to stepwise eliminate the variables with the highest p-values.

My question: How can I use "update" when I have only the variable name als string (e.g., "x1")? Or is there another convenient way to update the model?

Thanks!

Sincerely,
Denis



This email and any files transmitted with it are confide...{{dropped:8}}

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 Tue 22 Mar 2011 - 07:04:44 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 Tue 22 Mar 2011 - 10:00:23 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