Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: PROC MIXED


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: PROC MIXED
Date   Thu, 18 Mar 2004 12:13:58 +0900

Stata's analogue to SAS's LSMEANS is -adjust-.  Stata doesn't have one to 
PROC MIXED, but if your dataset doesn't have missing values, then you can use 
-manova- for the unstructured covariance matrix.  -xtgee- estimates a marginal 
(population average) model, so the coefficients might not be completely 
coincident with what you get with PROC MIXED.  Be sure that Stata drops one of 
the _gr* variables at the beginning of -xtgee-'s execution, and make sure that 
GROUP1 is coded 0/1 and not 1/2; otherwise, use 
-xi: xtgee Y i.GROUP1 i.GROUP2, . . .-

Joseph Coveney


john smith wrote:

--------------------------------------------------------------------------------


I wanted to translate the following SAS code to STATA,
and not being a SAS expert wanted your suggestions.

PROC MIXED SCORING METHOD=ML COVTEST;
CLASS GROUP1  GROUP2 ID ;
MODEL Y=GROUP1  GROUP2 X3;
REPEATED / TYPE=UN SUBJECT=ID ;
LSMEANS GROUP1/PDIFF;

I am mainly interested in the results of the LSMEANS.
Note that GROUP1 is binary.  The observations are
unique when sorted by ID and GROUP2.

My attempt in Stata was to do the following.
iis ID
tis GROUP2
qui tab GROUP2, gen(_gr)
xtgee Y GROUP1 _gr* X3, corr(uns)

The coefficient on GROUP1 does not match the SAS
LSMEANS result.  What am I doing wrong?

Thanks.

--------------------------------------------------------------------------------



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index