[R] nested cross-sectional design using lmer or nlme

Daniel Malter daniel at umd.edu
Tue Jun 23 11:32:01 CEST 2009


Hi, you can try reading
http://cran.r-project.org/web/packages/SASmixed/vignettes/Usinglmer.pdf 

If I am not mistaken, the repeated measures over time and nesting of
individuals in communities as you describe them would be captured by:

reg=lmer(y~cond+timecat+cond*timecat+(timecat|community/subject))
summary(reg)

The random effects have the following structure:

(1|subject)  = random intercept
(timecat|subject) = random intercept and slope
(1|community/subject) = subject nested in community

The random effect above is a combination of nesting and random intercept and
slope. However, the question which random effects to select is a modeling
question and thus ultimately the ressearchers responsibility.

Best,
Daniel

-------------------------
cuncta stricte discussurus
-------------------------

-----Ursprüngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im
Auftrag von Alan Kelly
Gesendet: Tuesday, June 23, 2009 4:55 AM
An: r-help at r-project.org
Betreff: [R] nested cross-sectional design using lmer or nlme

Dear all, I'd appreciate some advice on the following problem.  I'm
attempting to analyse a nested cross-sectional design in which an
intervention was offered to a series of randomly selected (small)
communities, so the unit of randomisation is the community.  All available
individuals in each community were interviewed before the intervention and
again at follow-up post-intervention.  The set of available individuals at
baseline and at follow-up were far from identical (a common feature of such
designs).  Similarly, a series of control communities were interviewed.
This type of design is  used in epidemiological studies particularly in
intervention designed to alter lifestyle factors.  Such designs tend to be
highly unbalanced Murray et al. discuss the appropriate analysis of such
studies (Analysis of data from group-randomized trials with repeat
observations on the same  
groups, Stats in Med. 17, 1581-1600).  They offer three examples of   
SAS code - one of which is as follow:
proc mixed;
class cond unit timecat;
  model y=cond timecat cond*timecat/ddfm=res;
  random int timecat/subject=unit(cond); run;

cond is 0/1 corresponding to control/intervention timecat is 0/1
corresponding to baseline/follow-up unit is 1 to 39 and identifies the
communities.
and y is a continuous score

I've read the random statement as cond nested within unit and crossed
(?) by timecat.
Unfortunately I'm not familiar with SAS code.  I would expect random effects
for unit and timecat X unit.

I would much appreciate any suggestions on how to code the above in lmer or
nlme.

Alan Kelly
Trinity College Dublin
>

______________________________________________
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.




More information about the R-help mailing list