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

From: Kevin Wright <>
Date: Thu, 14 Apr 2011 15:51:10 -0500

> I am trying to teach myself R and replicate some previous SAS analysis.
> Could someone please help me translate the following SAS code into R.
> Proc mixed method=ml
> Class Group Treatment Stream Time Year;
> Model Logrpk=Treatment Time Treatment*Time;
> Random Group Stream (Group Treatment) Year(Time);

Assuming you have a data frame "dat" with these factors: Group Treatment Stream Time Year
And continuous response: logrpk

This code is a starting point: (I'm not sure exactly what the SAS syntax means).

m1 = lmer(logrpk ~ treatment*time + (1|Group) + (1|Stream:Group:Treatment) + (1|Year:Time), data=dat)


        [[alternative HTML version deleted]] mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 14 Apr 2011 - 20:53:24 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 Fri 15 Apr 2011 - 14:00:31 GMT.

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

list of date sections of archive