Re: [R] different results with plot.lm vs. plot.lm(which=c(2))

From: Effie Greathouse <>
Date: Wed, 12 Nov 2008 10:16:19 -0800

Hi Dr. Ripley--Sorry for the repost everybody. The original message I sent never showed up in my inbox, so I thought it didn't get sent to the list.

I'm running R 2.8.0, installed from a pre-compiled version, on Windows XP. When I type Sys.getlocale() at the R prompt, it returns:  "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"

Here's an example:
bob <- seq(1:100)
bob2 <- rgamma(100, 2, 1)*10+bob
model<-glm(bob2 ~ bob, family=Gamma)

Then enter:
plot(model, which=c(3))
to get the Scale-Location graph

Then compare it to the Scale-Location graph when you run the following command and page through to the 3rd graph: plot(model)

When I do this, I get different results -- some of the high values are different on each plot. On my real data the difference is more severe than in this randomly generated example. I'd be happy to supply my real data and R code if this smaller example isn't sufficient. Thank you for any help!!

On Wed, Nov 12, 2008 at 9:43 AM, Prof Brian Ripley <>wrote:

> Instead of re-posting the same message, please study the posting guide and
> supply the information asked for, including a reproducible example. There is
> no way we can help you unless you help us to help you.
> On Wed, 12 Nov 2008, Effie Greathouse wrote:
> I am running GLM models using the gamma family. For example:
>> model <-glm(y ~ x, family=Gamma(link="identity"))
>> I am getting different results for the normal Q-Q plot and the
>> Scale-Location plot if I run the diagnostic plots without specifying the
>> plot vs. if I specify the plot ... e.g., "plot(model)" gives me a
>> different
>> Normal Q-Q graph than "plot(model, which=c(2))". The former gives data
>> points distributed in a quadratic pattern, while the latter gives data
>> points more or less along the 1:1 line. Shouldn't these two commands be
>> giving me the same exact graphs? I have read the documentation on plot.lm
>> and searched the help archives, but I am still learning GLM's and I'm not
>> very familiar with understanding diagnostic plots for GLM's, so any help
>> would be much appreciated!
>> [[alternative HTML version deleted]]
>> ______________________________________________
>> mailing list
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
> --
> Brian D. Ripley,
> Professor of Applied Statistics,
> University of Oxford, Tel: +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865 272595

        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 12 Nov 2008 - 18:18:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 12 Nov 2008 - 19:30:25 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive