Statalist The Stata Listserver


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

st: Mixed Model (SAS to Stata)


From   "Raphael Fraser" <[email protected]>
To   [email protected]
Subject   st: Mixed Model (SAS to Stata)
Date   Thu, 19 Apr 2007 16:23:20 -0500

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;

Data (cholst.dat)
   newid   cholst   sex   age   year
       1      175     1    32      0
       1      198     1    32      2
       1      205     1    32      4
       1      228     1    32      6
       1      214     1    32      8
       1      214     1    32     10
       2      299     0    34      0
       2      328     0    34      4
       2      374     0    34      6
       2      362     0    34      8
       2      370     0    34     10
       3      250     0    41      0
       3      277     0    41      2
       3      265     0    41      4
       3      254     0    41      6
       3      263     0    41      8
       3      268     0    41     10

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