Leaps works :)
Thanks a lot!
JMF
-
Jean-Michel Fortin
Étudiant au premier cycle en Biologie/ Undergraduate in Biology
Lab Currie Université d'Ottawa/ Currie Lab University of Ottawa
--
View this message in context:
http://r.789695.n4.nabble.com/All-combinations-possible-in-a-mutliple-reg
Look at the leaps function in the leaps package. It will compute the
Cp statistic which is a function of AIC.
On Thu, Aug 9, 2012 at 7:28 AM, zel7223 wrote:
> Hi,
>
> I want to use four independent variables to predict the output of one
> dependent variable using a linear model lm. I want to com
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.
HI,
I hope this helps you,
set.seed(1)
dat1<-data.frame(X1=rnorm(25,15),X2=rnorm(25,5),X3=runif(25,0.4),X4=rnorm(25,12),Y=rnorm(25,35))
ColNam<-names(dat1)
ColNam
#[1] "X1" "X2" "X3" "X4" "Y"
ColNam<-ColNam[!ColNam %in% "Y"]
n<-length(ColNam)
ColNam
#[1] "X1" "X2" "X3" "X4"
id1<-unlist(
Try a look at this:
http://stat.ethz.ch/R-manual/R-patched/library/MASS/html/stepAIC.html
Regards,
Phil
--
View this message in context:
http://r.789695.n4.nabble.com/All-combinations-possible-in-a-mutliple-regression-tp4639762p4639782.html
Sent from the R help mailing list archive at Nabble.
5 matches
Mail list logo