Re: [R] Compare effects between lm-models

From: Kuhn, Max <Max.Kuhn_at_pfizer.com>
Date: Mon 22 Jan 2007 - 15:26:54 GMT


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}}

R-help@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. Received on Tue Jan 23 02:37:39 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 22 Jan 2007 - 17:30:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.