[R] Compare effects between lm-models

Kuhn, Max Max.Kuhn at pfizer.com
Mon Jan 22 16:26:54 CET 2007


You can use the anova function a la:

   > anova(model1, model2)
   Analysis of Variance Table
   
   Model 1: y ~ x
   Model 2: y ~ x + z
     Res.Df    RSS Df Sum of Sq      F Pr(>F)
   1     13 4.4947                           
   2     12 4.4228  1    0.0720 0.1952 0.6665

I would suggest getting a copy of MASS and/or reading 

   http://www.stats.ox.ac.uk/pub/MASS3/Exegeses.pdf


Max

   

----------------------------------------------------------------------
LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}



More information about the R-help mailing list