Re: [R] Compare effects between lm-models

From: Rense Nieuwenhuis <>
Date: Mon 22 Jan 2007 - 16:36:02 GMT

Thank you Alain and Max for your swift responses.

  It might be that I'm misunderstanding your responses, but aren't you testing if there is a difference between the two full models? What I want to know, os whether the effect of a specific predictor (x) differs between model1 and model2. I'm not interested (presently) if the fit of model 2 is better than that of model 1 (for instance).

thanks again,


On Jan 22, 2007, at 16:26 , Kuhn, Max wrote:

> 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
> Max
> ----------------------------------------------------------------------
> Unless expressly stated otherwise, this message is confidential and
> may be privileged. It is intended for the addressee(s) only.
> Access to this E-mail by anyone else is unauthorized. If you are
> not an addressee, any disclosure or copying of the contents of this
> E-mail or any action taken (or not taken) in reliance on it is
> unauthorized and may be unlawful. If you are not an addressee,
> please inform the sender immediately.
> mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Tue Jan 23 03:41:47 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 Please read the posting guide before posting to the list.