[R-sig-ME] heteroscedastic model in lme4

Renwick, A. R. a.renwick at abdn.ac.uk
Thu Dec 18 12:23:46 CET 2008


I have been using the nlme package to run some LMM's, however I would like to try rerunning them using the lme4 package so that I can use mcmc sampling.  The data I am using shows some heteroscesdasticity of the within error group and so I have been using the 'weights' argument and the varIdent variance function structure to allow different variances for each level of my factor (patch width).

My problem is how to code for a heteroscedastic model in lme4 and any suggestion wouuld be much apprecaited.

The code I used in the nlme package:

# model fit using "REML"
mrem<-lme(log(Nhat+1)~Group + GreenPerc + sess + crop + VegDensity + Group:sess + Group:VegDensity ,random=~1|Site, data=all,
       method="REML",correlation=NULL,weights=varIdent(form=~1|width))


Many thanks,
Anna

Anna Renwick
Institute of Biological & Environment Sciences
University of Aberdeen
Zoology Building
Tillydrone Avenue
Aberdeen
AB24 2TZ


The University of Aberdeen is a charity registered in Scotland, No SC013683.




More information about the R-sig-mixed-models mailing list