Hello all,
I'm fairly new to STATA so I am teaching myself as I go along. I am proficient in SAS, to be sure I am doing the right thing in STATA I am currently fitting the same model in SAS and STATA simultaneously and comparing results. I am using SAS proc mixed and STATA mixed commands.
I am baffled by the differences in the results of covariance parameters in the 2 softwares. However, I have noticed the values of the log-likelihood and solution for fixed effects are approximately the same. SAS uses Newton Raphson algorithm while STATA uses EM algorithm to converge to a solution, In theory both algorithms should lead to the same solutions. Also, I am using REML in both and denominator degree of freedom in both softwares is Kenward Rodgers. To clarify, I am estimating variances ( not sds in STATA ) so as to be able to compare the results directly with the one from SAS.
SAS CODE
procmixeddata=yr_2 covtesticmethod=reml;
model z_theory_r=zaq /solutionddfm=kr chisq ;
random intercept /subject=uni_id;
run;
STATA CODE
mixed z_theory_r zaq if yr_prog==2 || uni_id: , var reml dfmethod(kr)
Does anyone have an Idea why the results for the random effects differ ? Thanks !
I'm fairly new to STATA so I am teaching myself as I go along. I am proficient in SAS, to be sure I am doing the right thing in STATA I am currently fitting the same model in SAS and STATA simultaneously and comparing results. I am using SAS proc mixed and STATA mixed commands.
I am baffled by the differences in the results of covariance parameters in the 2 softwares. However, I have noticed the values of the log-likelihood and solution for fixed effects are approximately the same. SAS uses Newton Raphson algorithm while STATA uses EM algorithm to converge to a solution, In theory both algorithms should lead to the same solutions. Also, I am using REML in both and denominator degree of freedom in both softwares is Kenward Rodgers. To clarify, I am estimating variances ( not sds in STATA ) so as to be able to compare the results directly with the one from SAS.
SAS CODE
procmixeddata=yr_2 covtesticmethod=reml;
model z_theory_r=zaq /solutionddfm=kr chisq ;
random intercept /subject=uni_id;
run;
STATA CODE
mixed z_theory_r zaq if yr_prog==2 || uni_id: , var reml dfmethod(kr)
Does anyone have an Idea why the results for the random effects differ ? Thanks !
Comment