Here is the SAS proc mixed model procedure. I wonder how I can fit the same model in R with separate within-subject variance/covariance matrices for each treatment arm.

proc mixed data=cRMData method=reml;

class time subj;

model y=time2 arm arm*time2/ddfm=kenwardroger solution;

repeated time/subject=subj type=un group=arm rcorr;


I tried this in R but it does not give me different covariance matrices

                 correlation=corSymm(form = ~ 1 | subj),

you may or may not be aware of this blog which compares SAS and R code for specific purposes. I searched the site for 'mixed' and it seems to provide the answer to your Q(?), "Example 2014.3: Allow different variances by group": http://sas-and-r.blogspot.ca/search?q=mixed

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.