Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: xtmixed: How replicate a SAS example in Stata11

 From Amado David Quezada Sanchez To "'statalist@hsphsun2.harvard.edu'" Subject st: xtmixed: How replicate a SAS example in Stata11 Date Fri, 12 Feb 2010 19:14:50 -0600

```Dear statalisters,

I have been using xtmixed to replicate some examples from
Fitzmaurice/Laird/Ware book "Applied Logitudinal Analysis"

Those examples require a specified covariance. I have had
no problem with unstructured and with ar(1) covariance
structures. For example, in order to replicate the following
SAS code

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

I executed this in Stata 11:

xi: xtmixed y i.gpo*i.t || id:, nocons var residuals(unstructured, t(t))

I obtained the very same results as the book. Now I'm trying
to replicate an example for which an exponential covariance
structure has to be specified:

PROC MIXED;
CLASS id group time;
MODEL y=group time group*time/S CHISQ;
REPEATED time/TYPE=SP(EXP)(ctime) SUBJECT=id R RCORR;

Where ctime is a copy from the variable time. As the authors say,
this variable is used to construct "distances" or time separation
between repeated measures.

How could I fit this in Stata11?

For the exponential covariance model, we have:

Corr(Yj,Yk)=rho?(tj-tk)

That is, correlation between responses depend on time separation. The feature that distinguishes an exponential covariance model from the autoregressive one is its
ability to be used with unequally spaced responses. In this example we have that
characteristic since time=0,4,6,8,12.

This structure can be expressed so it includes an exponential component, that's
the reason for its name.

Thank you,
Dave Q.

*
*   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/
```