Nicolaas Busscher
2004-Oct-22 11:24 UTC
[R] grouping for lme with nested repeated measurements
I am using lme to handle repeated measurements. So far i can follow the examples from the book from pinheiro and bates. Now i get the problem , that i have "nested" repeated measuremnts, and i cant find out how to do the grouping part of the lme formula. 1.The simple problem ist that i have different Samples , from which i make repeated measurements (each sample is measured 6 times) and i repeat this experiment over several Days, so i get the lme grouping term "random=~1|Days/Sample". 2. Now i am measuring with 2 different measuring Apparatus the same Sample each 6 times, to see how big the difference from the appratus is. Because Apparatus is on the level of repeated measurements i cant write Days/Sample/Apparatus. the lme function offers a list() feature to design the grouping, but i didnt understand this, if it is the solution to the problem. Maybe somebody had the same Problem? best greetings N.Busscher -- #--------------------------------------------------- ##!! Achtung neue E-Mail adresse: busscher at uni-kassel.de ## Neue Telephon Nummer #--------------------------------------------------- Dr.Nicolaas Busscher Universit??t GH Kassel Nordbahnhofstrasse: 1a, D-37213 Witzenhausen Phone: 0049-(0)5542-98-1721, Fax: 0049-(0)5542-98-1713
Lorenz.Gygax@fat.admin.ch
2004-Oct-25 06:11 UTC
[R] grouping for lme with nested repeated measurements
> 1.The simple problem ist that i have different Samples , from > which i make repeated measurements (each sample is measured 6 > times) and i repeat this experiment over several Days, so i > get the lme grouping term "random=~1|Days/Sample".I would rather specify this as: random= ~ 1 | Sample/Days, but I am not quite sure how this affects the model.> 2. Now i am measuring with 2 different measuring Apparatus > the same Sample each 6 times, to see how big the difference > from the appratus is. > Because Apparatus is on the level of repeated measurements i > cant write Days/Sample/Apparatus. the lme function offers a > list() feature to design the grouping, but i didnt understand > this, if it is the solution to the problem.Why would you want to include the Apparatus in the random effect? I assume that you are interested in differences and thus, this is a fixed effect: lme (fixed= response ~ apparatus, data= XX, random= ~ 1 | Sample/Days) Lorenz - Lorenz Gygax, lorenz.gygax at fat.admin.ch Centre for proper housing of ruminants and pigs Swiss Federal Veterinary Office
A variable is considered to be nested when it is unique within that combination. i.e. if your measuring Apparatus was different at each sample. Hence, as Lorenz suggested it is reasonable to treat Apparatus as fixed, specially if you are considering making comparisons between the 2 apparatus. I hope that this helps Francisco>From: Lorenz.Gygax at fat.admin.ch >To: r-help at stat.math.ethz.ch >Subject: RE: [R] grouping for lme with nested repeated measurements >Date: Mon, 25 Oct 2004 08:11:21 +0200 > > > > 1.The simple problem ist that i have different Samples , from > > which i make repeated measurements (each sample is measured 6 > > times) and i repeat this experiment over several Days, so i > > get the lme grouping term "random=~1|Days/Sample". > >I would rather specify this as: random= ~ 1 | Sample/Days, but I >am not quite sure how this affects the model. > > > 2. Now i am measuring with 2 different measuring Apparatus > > the same Sample each 6 times, to see how big the difference > > from the appratus is. > > Because Apparatus is on the level of repeated measurements i > > cant write Days/Sample/Apparatus. the lme function offers a > > list() feature to design the grouping, but i didnt understand > > this, if it is the solution to the problem. > >Why would you want to include the Apparatus in the random effect? >I assume that you are interested in differences and thus, this >is a fixed effect: > >lme (fixed= response ~ apparatus, data= XX, random= ~ 1 | Sample/Days) > >Lorenz >- >Lorenz Gygax, lorenz.gygax at fat.admin.ch >Centre for proper housing of ruminants and pigs >Swiss Federal Veterinary Office > >______________________________________________ >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