[R] lme and varFunc()

Andrew Robinson andrewr at uidaho.edu
Mon Jan 24 20:24:18 CET 2005


Dear Christoph,

what command are you using to plot the residuals?  If you use the
default residuals it will not reflect the variance model.  If you use
the argument

type="p"

then you get the Pearson residuals, which will reflect the weights
model.  Try something like this:

plot(model, resid(., type = "p") ~ fitted(.), abline = 0)

I hope that this helps,

Andrew

On Mon, Jan 24, 2005 at 02:28:44PM +0100, Christoph Scherber wrote:
> Dear R users,
> 
> I am currently analyzing a dataset using lme(). The model I use has the 
> following structure:
> 
> model<-lme(response~Covariate+TreatmentA+TreatmentB,random=~1|Block/Plot,method="ML")
> 
> When I plot the residuals against the fitted values, I see a clear 
> positive trend (meaning that the variance increases with the mean).
> 
> I tried to solve this issue using weights=varPower(), but it doesn?t 
> change the residual plot at all.
> 
> How would you implement such a positive trend in the variance? I?ve 
> tried glmmPQL (which works great with poisson errors), but using glmmPQL 
> I can?t do model simplification.
> 
> Many thanks for your help!
> 
> Regards
> Chris.
> 
> ______________________________________________
> 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

-- 
Andrew Robinson                      Ph: 208 885 7115
Department of Forest Resources       Fa: 208 885 6226
University of Idaho                  E : andrewr at uidaho.edu
PO Box 441133                        W : http://www.uidaho.edu/~andrewr
Moscow ID 83843                      Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.




More information about the R-help mailing list