[R] All combinations possible in a mutliple regression

arun smartpink111 at yahoo.com
Thu Aug 9 21:26:18 CEST 2012



HI,

I forgot about the AIC.
 resAIC<-list()
for(i in 1:length(res1)){
 resAIC[[i]]<-list()
 resAIC[[i]]<-AIC(res1[[i]])
 }
 unlist(resAIC)
# [1] 71.25981 65.22991 71.32024 71.29489 67.20616 73.15101 73.13823 66.17742
 #[9] 66.96219 73.27309 67.78183 68.85621 75.03196 68.00660 69.39852

A.K.





----- Original Message -----
From: zel7223 <jmichel.fortin at hotmail.fr>
To: r-help at r-project.org
Cc: 
Sent: Thursday, August 9, 2012 9:28 AM
Subject: [R] All combinations possible in a mutliple regression

Hi,

I want to use four independent variables to predict the output of one
dependent variable using a linear model lm. I want to compare all possible
combinations of the 4 independent variables, including singles, pairs and
triples.

I was thinking of using the AIC test to compare all models and pick the best
one.

The model looks like this : 

lm(Y ~ X1 + X2 + X3 + X4)

Thanks for your help

Cheers

Jean-Michel Fortin
UOttawa



--
View this message in context: http://r.789695.n4.nabble.com/All-combinations-possible-in-a-mutliple-regression-tp4639762.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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.




More information about the R-help mailing list