Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Replicate a SAS example with xtmixed, STATA 11


From   Amado David Quezada Sanchez <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Replicate a SAS example with xtmixed, STATA 11
Date   Fri, 29 Jan 2010 11:55:01 -0600

Hello,

I have tried to replicate an example from Fitzmaurice/Laird/Ware book "Applied Longitudinal Analysis". The code presented by the authors was written for SAS:

PROC MIXED;
 CLASS id group time;
 MODEL y=group time group*time/S CHISQ;
 REPEATED time/TYPE=UN SUBJECT=id R RCORR;

According to the authors "The MODEL statement specifies the response varriable and the fixed effects" and "The SUBJECT option ... is used to denote a variable that distinguishes clusters of correlated responses"..."TYPE=UN specifies an unstructured covariance matrix"

So, after setting the data into long format, I tried to run the following code: 

/* Setting the data */
clear
infile id str1 grp y0 y1 y4 y6 using http://users.uoa.gr/~fsiannis/data/longitudinal/tlcdata.txt
reshape long y, i(id) j(time)
gen group=0 if grp=="P"
replace group=1 if grp=="A"
/* Fitting the model, option residuals only found in STATA11 */
xi: xtmixed y group i.time i.group*i.time, residuals(unstructured, t(time))


I receive an error message. What could I do to replicate the SAS code?

Thank you!
Dave




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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