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   Thu, 19 Apr 2007 18:56:05 -0700

Raphael Fraser wrote:

 Can anyone produce the equivalent code in Stata? A snippet of the data
 named "cholst" is given below.

 proc mixed data=cholst;
     class newid;
     model cholst = year / s;
     random intercept year / type=un subject=newid g;
     repeated / type=vc subject=newid;
 run;

I think the -xtmixed- code that comes closest to what you want would
be something like this:

xtmixed cholst year || newid: year, var cov(un)

By the way, I believe the "class newid;" statement in your SAS code is
unnecessary because newid is not a categorical variable in the model.
It doesn't hurt but it doesn't help either.

--
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