Mark Na
2008-Aug-22 15:27 UTC
[R] lme questions re: repeated measures & covariance structure
Hello, We are attempting to use nlme to fit a linear mixed model to explain bird abundance as a function of habitat: lme(abundance~habitat-1,data=data,method="ML",random=~1|sampleunit) The data consist of repeated counts of birds in sample units across multiple years, and we have two questions: 1) Is it necessary (and, if so, how) to specify the repeated measure (years)? As written, the above code does not. 2) How can we specify a Toeplitz heterogeneous covariance structure for this model? We have searched the help file for lme, and the R-help archives, but cannot find any pertinent information. If that's not possible, can we adapt an existing covariance structure, and if so how? Thanks, Mark [[alternative HTML version deleted]]
Christoph Scherber
2008-Aug-22 15:56 UTC
[R] lme questions re: repeated measures & covariance structure
Dear Mark, I would include the repeated measure as the smallest stratum in the random effects specification: random=~1|sampleunit/year Setting up user-defined variance structures should be possible using for example: weights=varPower(form=~habitat) or also try out the available corStruct() classes (found in Pinheiro and Bates 2000) HTH Christoph Mark Na schrieb:> Hello, > > We are attempting to use nlme to fit a linear mixed model to explain bird > abundance as a function of habitat: > > > lme(abundance~habitat-1,data=data,method="ML",random=~1|sampleunit) > > The data consist of repeated counts of birds in sample units across multiple > years, and we have two questions: > > 1) Is it necessary (and, if so, how) to specify the repeated measure > (years)? As written, the above code does not. > > 2) How can we specify a Toeplitz heterogeneous covariance structure for this > model? We have searched the help file for lme, and the R-help archives, but > cannot find any pertinent information. If that's not possible, can we adapt > an existing covariance structure, and if so how? > > Thanks, Mark > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > . >-- Dr. rer.nat. Christoph Scherber University of Goettingen DNPW, Agroecology Waldweg 26 D-37073 Goettingen Germany phone +49 (0)551 39 8807 fax +49 (0)551 39 8806 Homepage http://www.gwdg.de/~cscherb1