[R] stepAIC on lm() where response is a matrix..

Spencer Graves spencer.graves at pdf.com
Thu Jun 28 04:09:09 CEST 2007


      I see several options for you: 

      1.  Write a function 'dropterm.mlm', copying 'dropterm.lm' and 
modifying it as you think appropriate.  The function 'dropterm.lm' is 
hidden in a namespace, which you can see from 'methods(dropterm)'.  To 
get it, either use getAnywhere("dropterm.lm") or "MASS:::dropterm.lm".

      2.  Use 'stepAIC' in the univariate mode.  If they both select the 
same model, it would strongly suggest that you would get the same answer 
from a multivariate version.  Fit that multivariate version and be happy. 

      3.  If univariate analyses produce different models and you want a 
common one, take the models you get, and interpolate manually a list of 
alternative plausible models between the two best univariate models.  
Then fit those manually and select the one with the smallest AIC. 

      Hope this helps. 
      Spencer Graves

vinod gullu wrote:
> dear R users,
>
> I have fit the lm() on a mtrix of responses. 
> i.e M1 = lm(cbind(R1,R2)~ X+Y+0). When i use
> summary(M1), it shows details for R1 and R2
> separately. Now i want to use stepAIC on these models.
> But when i use stepAIC(M1) an error message  comes
> saying that dropterm.mlm is not implemented. What is
> the way out to use stepAIC in such cases.
>
> regards,
>
>
>  
> ____________________________________________________________________________________
> The fish are biting.
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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