[R] nlme plot residuals per group

Spencer Graves spencer.graves at pdf.com
Thu May 11 02:11:33 CEST 2006


	  Your example is not self contained, and I don't know enough to 
replicate it myself, so I can't tell you what caused it or how to fix 
it.  However, I can outline the type of thing I've often done with this 
kind of problem:

	  1.  First, can you get the plots you want using examples from the 
book and distributed with the 'nlme' package?  If no, might that provide 
a simple, self-contained example for a refined post?

	  2.  If you get the plots you want from one of the standard examples, 
how does your example that doesn't work differ from the published 
example that does?  That comparison might provide the insight you need 
to solve the problem.  If it doesn't, I would then experiment with both 
my example and the published example until I either solved my problem or 
produced a revision of the published example that illustrated my 
problem.  That revised example might then provide the core for a refined 
post.

	  3.  However, if it were me, I'd carry it further, making a local copy 
of the appropriate function, using 'debug', and walking through the code 
line by line until I found where it broke.  By the time I've done this, 
I've typically figured out the problem.  To do this, you need to know 
about the 'method' function, plus possibly 'getAnywhere'.

	  hope this helps,
	  Spencer Graves

Osman Al-Radi wrote:
> dear list:
> 
> I used the nlme library according to the great Pinheiro/Bates book, on
> R2.3, WinXp
> 
> Lac.lme is an lme object with unbalanced data, group is a factor
> variable with three levels, when I tried to plot the residuals by
> group I got this error msg:
> 
>> plot(Lac.lme,resid(.,type='p')~fitted(.)|group)
> Error in limits.and.aspect(prepanel.default.xyplot, prepanel = prepanel,  :
>         need at least one panel
> 
> Also When I try to use the auPred() function I get the follwoing error msg:
>> plot(augPred(Lac.lme))
> Error in tapply(as.character(object[[nm]]), groups, FUN[[dClass]]) :
>         arguments must have same length
> 
> Any suggestions?
> 
> Thanks
> 
> 
> --
> Osman O. Al-Radi, MD, MSc, FRCSC
> Fellow, Cardiovascular Surgery
> The Hospital for Sick Children
> University of Toronto, Canada
> 
> ______________________________________________
> 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




More information about the R-help mailing list