[R] Linear Trend in Residuals From lme

i.m.s.white i.m.s.white at ed.ac.uk
Fri Aug 11 10:43:04 CEST 2006


As an extreme example of this sort of thing, consider

fit <- lme(y ~ 1, random = ~ 1 | group)

where there is exactly one observation per group, so that it is not possible to
get separate estimates of group and residual variances.  Despite this, lme
often (always?) provides a solution consistent with the data. Because of the
singularity, the plot of residuals against fitted values for this solution
shows a straight line.  This is easily recognized as an aberration, but I can
imagine configurations of data (e.g. with most groups having just one
observation and a few with two or more) where the residual vs fitted value plot
might show an apparent trend.



On Wed, Aug 09, 2006 at 03:43:12PM -0400, Rick Bilonick wrote:
> I'm fitting a mixed effects model:
> 
> fit.1 <- lme(y~x,random=~1|id,data=df)
> 
> There are two different observations for each id for both x and y. When
> I use plot(fit.1), there is a strong increasing linear trend in the
> residuals versus the fitted values (with no outliers). This also happens
> if I use random=~x|id. Am I specifying something incorrectly?
> 
> Rick B.
> 
> ______________________________________________
> R-help at 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.

-- 
************************************************
*    I.White                                   *
*    University of Edinburgh                   *
*    Ashworth Laboratories, West Mains Road    *
*    Edinburgh EH9 3JT                         *
*    Fax: 0131 650 6564   Tel: 0131 650 5490   *
*    E-mail: i.m.s.white at ed.ac.uk              *



More information about the R-help mailing list