I want to label groups of points in
the plot of residuals against predicted values
generated by plot.lm().
Labelling the points by color
x<-1:15
y<-rnorm(15)
f<-factor(rep(c(1:3),each=5))
g<-glm(y~x)
plot(g,which=1,col=c(1,2,3)[f])
I receive the error message
Error in title(main, sub, xlab, ylab, line, outer, ...) :
graphical parameter "col" has the wrong length
How can I resolve the error?
Labelling by symbols works fine
plot(g,which=1,pch=c(1,2,3)[f])
And setting
par(mfrow=c(1,2))
before plotting, produces the color plot without error
plot(g,which=1,col=c(1,2,3)[f])
Ulrich
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 3.0
year 2006
month 04
day 24
svn rev 37909
language R
version.string Version 2.3.0 (2006-04-24)
Ulrich Halekoh
Danish Institute of Agricultural Sciences
Unit of Statistics and Decision Analysis
8830 Tjele, Denmark
[[alternative HTML version deleted]]
On Mon, 8 May 2006, Ulrich Halekoh wrote:> I want to label groups of points in > the plot of residuals against predicted values > generated by plot.lm(). > > Labelling the points by color > > x<-1:15 > y<-rnorm(15) > f<-factor(rep(c(1:3),each=5)) > g<-glm(y~x) > plot(g,which=1,col=c(1,2,3)[f]) > > > I receive the error message > > Error in title(main, sub, xlab, ylab, line, outer, ...) : > graphical parameter "col" has the wrong length > > How can I resolve the error?Well, the help does say ...: other parameters to be passed through to plotting functions. and it really is unclear what you intended 'col' to refer to. But as title() is not going to make use of it, it should accept it. I'll see if I can adapt it suitably. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Maybe Matching Threads
- rstandard does not produce standardized residuals
- confint: which method attached?
- Problem in using confint method on polr model object
- glht: Problem with symbolic contrast for factors with number-levels
- glht (multcomp): NA's for confidence intervals using univariate_calpha (fwd)