Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Mixed Model (SAS to Stata)


From   "Philip Ender" <[email protected]>
To   [email protected]
Subject   Re: st: Mixed Model (SAS to Stata)
Date   Fri, 20 Apr 2007 14:18:06 -0700

Raphael Fraser wrote:

 Thanks Phil. It worked. I have three more model to imitate in Stata if
 any one is able to:

 1) I tried using -xtregar- but didn't work and it appear xtmixed does
 not have the AR(1) option.
 proc mixed data=cholst;
     class newid;
     model cholst = year / s;
     random intercept year / type=un subject=newid g;
     repeated / type=ar(1) subject=newid;
 run;

 2) don't understand the last line of code.
 proc mixed data=cholst;
     class newid;
     model cholst = year / s;
     random intercept year / type=un subject=newid g;
     repeated / type=vc subject=newid;
     estimate "long-cross" year 1 age -1;
 run;

 3) again, don't understand last line.
 proc mixed data=cholst;
     class newid;
     model cholst = sex age year sex*year age*year  / s;
     random intercept year / type=un subject=newid g;
     repeated / type=vc subject=newid;
     estimate "rate-diff" sex*year 1 age*year -10;
 run;

Stata will not run model 1).  The -xtregar- does not do random slopes.
Maybe level 1 covariance structures for -xtmixed- will be available
in a future release.  Model 2) makes no sense because age does not
appear in the model statement. I think the last line model 3) is
trying to get an estimate for a particular combination of levels but I
can't tell from the SAS code exactly what is wanted.   I suspect that
in Stata this would be handled by -lincom- but the exact specification
eludes me.

--
Phil Ender
Statistical Consulting Group
UCLA  Academic Technology Services
*
*   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