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

st: specifying linear mixed-effects covariance structure

From   jwegelin <>
Subject   st: specifying linear mixed-effects covariance structure
Date   Thu, 18 Oct 2007 17:05:43 -0400

The purpose of this email is to enquire regarding the capabilities of
Stata for specifying the covariance structure in linear mixed-effects
models. The email starts with a fairly detailed description of the
problem and a sketch of how one approaches it in SAS. We end with a set 
of questions regarding Stata, marked by asterisks *********.

The bottom line is, "Can I do this all in Stata, or do I need to use SAS 
for such analyses?"


Suppose you have a longitudinal outcome (K repeated measures on N units)
and are fitting a linear mixed-effects model. Suppose you have specified
random intercepts and random slopes.

For instance, in Stata this might look like

xi: xtmixed Size i.Tribe*Day || Mouse: Day, cov(un)

where Tribe is dichotomous ("case" or "control"), Day goes from zero to
ten, and each Mouse, belonging to one of the Tribes, is measured each
day. You want to know whether the growth patterns differ between Tribes.

(1) One might consider the possibility of autocorrelation of residuals 
within unit (within Mouse) over time, for instance an AR(1) 
autoregressive model; or one might want to try conjugate symmetry as 
another alternative to independence of the within-Mouse residuals.

In SAS PROC MIXED it is possible to specify AR(1), exchangeable,
conjugate symmetry and other kinds of variances of the within-Mouse
residuals under the REPEATED statement, TYPE=AR(1), etc.

(2) One might suspect---e.g., from initial exploratory graphics---that
the variance of the "case" Tribe exceeds that of the "control" Tribe.
Furthermore, one might be curious whether this difference in variance is
in the intercept and slope random effects only, in the residuals only,
or in both.

In SAS PROC MIXED one can allow different variances of the random slopes
and intercepts in the two Tribes by saying "GROUP=TRIBE" under the
RANDOM statement.

Separately, one can allow different variances of the within-Mouse
residuals by saying the same thing under the REPEATED statement.

(3) Further, one can separately specify the covariance structures of the
between-mouse random effects (the slope and intercept random effects) on
one hand and the within-mouse residuals on the other hand.

When I used SAS, I specified unrestricted ("unstructured" in SAS-speak) 
covariance of the slopes  and intercepts within each Tribe. This used 
three degrees of freedom per Tribe and permitted the random Mouse 
intercept to be correlated with the random Mouse slope. But I specified 
a much more restricted structure for the within-mouse residuals, since 
that matrix is 10 by 10.


Am I correct in believing that there is no procedure or option in Stata 
by which one can readily do either of (1) or (2) described above?

If this is correct, are there any plans, either in Stata proper or among
people making well-documented add-ons (see for instance the work of
Rabe-Hesketh), to add these features?

In current xtmixed, we can specify the between-Mouse variance of
the random effects as "independent", "exchangeable", "identity" or
"unstructured". (See for lucid
definitions.) Regarding the within-Mouse residual variance, am I correct
in guessing that it is always specified as "identity" when one runs xtmixed?

In Stata, the xtreg procedure allows us to specify the within-group 
(within-Mouse) correlation structure as autoregressive, exchangeable, or
conjugate symmetry, but only with the "pa" (population average) option, 
I believe. One does this with the "corr" option. But I think there is no 
"corr" option in xtmixed. Furthermore, I think that one can only specify 
random intercepts, not other random effects, under xtreg.

Thanks in advance for any information or correction.

Jacob A. Wegelin
Assistant Professor
Department of Biostatistics
Virginia Commonwealth University
730 East Broad Street Room 3006
P. O. Box 980032
Richmond VA 23298-0032

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index