Bug 14545 - plot.lm(which=5) switches the factor level labels the wrong way round.
plot.lm(which=5) switches the factor level labels the wrong way round.
Status: CLOSED FIXED
Product: R
Classification: Unclassified
Component: Graphics
R 2.12.2
x86_64/x64/amd64 (64-bit) Linux
: P5 normal
Assigned To: R-core
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-28 02:30 UTC by Robert King
Modified: 2014-02-16 11:43 UTC (History)
2 users (show)

See Also:


Attachments
the plot in question (4.77 KB, application/pdf)
2011-03-28 02:30 UTC, Robert King
Details
example plot.lm(which=5) (4.72 KB, application/pdf)
2012-01-31 16:55 UTC, alavals
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert King 2011-03-28 02:30:42 UTC
Created attachment 1190 [details]
the plot in question

example(lm)
plot.lm(lm.D9,which=5)

The group on the right, including the residuals labelled 17 and 15 (which are correctly labelled), are from the Trt group.  This group is labelled Ctl.
Comment 1 Brian Ripley 2011-03-28 12:16:28 UTC
Actually it is the plots which are incorrect: the groups are supposed to be in increasing order of standardized residual.

Fixed in the trunk (it is getting late for 2.13.0).
Comment 2 alavals 2012-01-31 16:55:34 UTC
Created attachment 1263 [details]
example plot.lm(which=5)
Comment 3 alavals 2012-01-31 17:08:17 UTC
Not fixed for me in 2.14.1
In the attached example, most of the residuals are in the wrong groups.
This is my data table:
>expData
   Nr. treatment block result
1    1         a     1     30
2    2         a     2     31
3    3         b     1     22
4    4         b     2     20
5    5         c     1     42
6    6         c     2     41
7    7         d     1     61
8    8         d     2     59
9    9         e     1     11
10  10         e     2     12

Then, with
>aov.expData<-aov(result~treatment+block,data=expData)
and
>plot(aov.expData,which=5)
i get the attached plot. Only the residuals 3 and 4 are in the right group. Or there is something wrong with my reasoning?

Best regards,
Alain
Comment 4 Jackie Rosen 2014-02-16 11:43:35 UTC
(spam comment removed)