[R] translating SAS proc mixed into R lme()

Ben Bolker bbolker at gmail.com
Sat Sep 22 14:43:42 CEST 2012


Zoya Pyrkina <zoyapyrkina <at> gmail.com> writes:

> I need  help with translating these SAS codes into R with lme()? I have a
> longitudinal data with repeated measures (measurements are equally spaced
> in time, subjects are measured several times a year). I need to allow slope
> and intercept vary.
> 
> SAS codes are:
> 
> proc mixed data = survey method=reml;
> 
> class  subject var1 var3 var2 time;
> 
> model score = var2 score_base var4 var5 var3 var6 var7 var1 time/ noint
> solution;
> 
> random intercept timecontinious / subject=subject type=un g gcorr v vcorr;
> 
> run;
> 

  You might have more luck submitting this to r-sig-mixed-models <at>
r-project.org.  Have you looked at the lme documentation and examples
(and Pinheiro and Bates's 2000 book)?  You probably want something
*approximately* like

lme(score~var2+score_base+var4+var5+var3+var6+var7+var1+time-1,
   random=~time|subject,
   data=...)

A reproducible example would be nice too.

   Ben Bolker




More information about the R-help mailing list