[R] Mixed-effects model for nested design data

Han-Lin Lai Han-Lin.lai at noaa.gov
Thu Apr 29 18:18:34 CEST 2004


Hi,

I am using nlme for data from nested design.  That is, "tows" are nested
within "trip",  "trips" nested within "vessel", and "vessels" nested
within "season".  I also have several covariates, say "tow_time",
"latitude" and "depth"
My model is
   y = season + tow_time + latitude + depth + vessel(season) +
trip(season, vessel) + e

In SAS, the program would be

proc mixed NOCLPRINT NOITPRINT data=obtwl.x;
  class vessel trip tow season depth;
  model y = season depth latitude /solution;  <----------fixed effects
  random vessel(season) trip(season vessel);
run;

My question is:  How this nested mixed-effects model can be fitted in R-
"nlme"?

Thanks in advance for the helps.

Cheers!
Han


More information about the R-help mailing list