Hi all, I'm not sure that this is the best forum for this question but am not sure of another one. I need to convert SAS code from PROC MIXED to Stata code. Here is the SAS code:
Here is the Stata code I have come up with. It doesn't give exactly the same results. I noticed part of the SAS code specifies type=un, which refers to an unstructured, that is, arbitrary covariance matrix. Is there an equivalent Stata option for that, maybe that is why the results don't match? Or maybe there is something else wrong with my Stata code? I'm not sure I got the random effects right.
Any advice much appreciated.
Code:
proc mixed data=data1 noclprint method=reml covtest; class batch bor mol pop var1 var2 var3; model dep = var1 var2 var3 / solution; random intercept / sub=pop type=un S G; random intercept / sub=mol type=un S G; random intercept / sub=bor type=un S G; run;
Here is the Stata code I have come up with. It doesn't give exactly the same results. I noticed part of the SAS code specifies type=un, which refers to an unstructured, that is, arbitrary covariance matrix. Is there an equivalent Stata option for that, maybe that is why the results don't match? Or maybe there is something else wrong with my Stata code? I'm not sure I got the random effects right.
Code:
mixed dep var1 var2 var3 || _all: R.bor || _all: R.mol || pop:, reml
Comment