[R] Correct effect plots from lme() objects

CG Pettersson cg.pettersson at evp.slu.se
Tue Feb 15 15:15:33 CET 2005


Hello all!

R2.0.1, W2k

I posted this question to the list last Sunday without getting any 
replies on the list. I got two off the list though, suggesting me to 
plot "manually" as a second step, from estimable() or intervals() 
objects respectively. As this was not really what I wished for, I take 
the risk to upset somebody with a trivial question, and re-post it (just 
a little edited).

So, here it is again:

I use lme() from nlme to make mean estimates from series of field
experiments where not all treatments (like "variety") are present in
all experiments. (An old problem in variety evaluation).

A typical call is:

yield.lme <- lme(Yield ~ Variety, data = data,
                             na.action = na.omit,
                             random = ~ 1 | Experiment/Block)

This works well, even when observations are lacking. I have checked
against the accepted method for doing this in Sweden, which is
PROC MIXED in SAS, and the fitted fixed effects are more or less
identical. I use estimable() from gmodels (gregmisc package) to
extract estimates, standard errors and such. I use matrices with the
variety names as row names, it works smooth.

What I am unable to, as yet, is to make nice plots of the estimates
for a given set of varieties. To use only the fixed call directly on
the dataset works for many plooting functions, but produces the wrong 
graphs, as the structure is not used. The structure (the random call)
has to be used, as there are NA:s in the dataset.

Pinheiro & Bates have a lot of graphics on lme objects, but they try
to illustrate more sophisticated relations than my need. I´ve looked
through gplots and the graphic parts of nlme without any hits.
Probably, my difficulties are just due to my own lack of skill. Some 
standard plotting facility plotting directly from the lme object ought 
to work, but I don´t understand how.

How should I do this?

Cheers
/CG
-- 
CG Pettersson MSci. PhD.Stud.
Swedish University of Agricultural Sciences (SLU)
Dep. of Ecology and Crop production sciences (EVP).
http://www.slu.se/
cg.pettersson at evp.slu.se




More information about the R-help mailing list