Re: [R] lme: random effects of a quadratic term

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Sat 26 Mar 2005 - 20:39:07 EST

On Sat, 26 Mar 2005, Montse Rue wrote:

> I am estimating the following model:
>
> so2.lme<-lme(so2~1+I(alcadakm^2)+dia,data=subjectes2,na.action=na.omit)
>
> And when I try to plot the random effects of the quadratic term with
> respect to a covariate (mam) I get an error:
>
>> so2.lmeRE<-ranef(so2.lme,augFrame=T)
>> plot(so2.lmeRE,form=I(alcadakm^2)~mam)
> Error in plot.ranef.lme(so2.lmeRE, form = I(alcadakm^2) ~ mam ) :
> Only single effects allowed in left side of form.
>
> Any suggestion?

Try renaming the variable, e.g. alcadakm2 = alcadakm^2, and refit.

NB: this is not `a quadratic term' but a transformed variable, since you used I().

-- 
Brian D. Ripley,                  ripley@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

______________________________________________
R-help@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
Received on Sat Mar 26 20:43:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:56 EST