[R] Correct effect plots from lme() objects

Deepayan Sarkar deepayan at stat.wisc.edu
Tue Feb 15 16:56:16 CET 2005


On Tuesday 15 February 2005 08:15, CG Pettersson wrote:
> 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.

It's not clear to me what you are looking for. In particular, exactly 
what 'estimates' do you want to plot? Could you give us a reproducible 
example (preferably using a dataset from nlme) and describe the plot 
you are looking for in terms of that example?

Deepayan

> 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




More information about the R-help mailing list