Dear All, the lm() function has the possibility to create a subset of the possible explaining variables that you have. However, in the help there is no example how to use this subset option. I tried the following:
model<-lm(dependent.data$MPFD~.,data=explaining.data,subset=c(1,0,0,0,0,0,0,0,1,1,0,0)) MPFD is the dependent variable stored in the data frame dependent.data, and all 12 explaining variables are stored in the data frame explaining.data. However, this yields a model with only an intercept, and the comment "Coefficients: (12 not defined because of singularities)" I hope anyone would be able to give me an example how to do this correctly. Kind regards, Thomas ______________________________________________ R-help@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.