Re: [R] Conveting SAS Proc mixed to R code

From: RKinzer <>
Date: Fri, 15 Apr 2011 13:37:04 -0700 (PDT)

I am desperate for help and thank you to everyone providing input.

I am using lme4 for a mixed linear model, and trying to replicate a SAS analysis (see thread below).

Dependent = logrkm; Independent = Group (Streams grouped by similarity), Treatment (3 treatments), Stream, Time (1 or 2; before treatment and after), Year (-8, -7,...7, 8; each yearly observation;negs before treatment and positive after).

Blocking by stream group results in unbalanced repeated measures with 3 treatments arranged in blocks with various numbers of observations (Streams) per treatment-block. Stream, Group, and Year are random variables and Treatment and Time are fixed effects.

I have tried the following code, but can't seem to replicate the SAS results. Please correct the model below if you see where I am wrong, I am also open to other suggestions.


Thank you.

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 16 Apr 2011 - 05:46:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 16 Apr 2011 - 05:50:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive