First your response in the formula is a matrix which causes the lm function to return an object of type 'mlm' for multivariate linear model. Then when you run the stepAIC function it runs the addterm function which looks for a method(function) to add terms to mlm objects. However nobody has written that particular method/function (at least not in the packages that you have loaded), that's what it means by 'no addterm method implemented for "mlm" models'.
You can write your own method, redo the process using only 1 response term at a time, wait for someone else to write this method (it will probably be a long wait unless you provide sufficient motivation), or use other techniques (stepwise regression is not the best tool anymore). On Tue, Oct 30, 2012 at 4:51 AM, paola <aikaterin...@hotmail.com> wrote: > Hi everybody > > I am trying to run the next code but I have the next problem > > Y1<-cbind(score.sol, score.com.ext, score.pur) >> vol.lm<-lm(Y1~1, data=vol14.df) >> library(MASS) >> stepAIC(vol.lm,~fsex+fjob+fage+fstudies,data=vol14.df) > Start: AIC=504.83 > Y1 ~ 1 > > Error in addterm.mlm(fit, scope$add, scale = scale, trace = max(0, trace - > : > no addterm method implemented for "mlm" models > > Does anybody knows why I get this error? > > Thanks in advance > Paola > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/error-in-lm-tp4647840.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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. -- Gregory (Greg) L. Snow Ph.D. 538...@gmail.com ______________________________________________ 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.