Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

re: st: -xtmixed- and random terms nested within fixed treatment terms?

From   David Airey <>
Subject   re: st: -xtmixed- and random terms nested within fixed treatment terms?
Date   Thu, 16 Jun 2005 11:26:47 -0500


Have you seen the very helpful pages on xtmixed at UCLA? They are:

for classical experimental designs:

For the examples in Kreft and de Leeuw's textbook on multilevel modeling:

For examples from Singer's paper using SAS but with other mixed model packages, including xtmixed:

I don't know these answer your question.


I have a uestion on the new xtmixed. I am trying to match a model run in S-Plux lme, and I am confused by the (lack of) nesting in

Suppose I have subjects assigned to treatment with outcomes measured at repeated occasions, and a covariate. It seems that the syntax for -xtmixed- should be something like this, where id (treatment) indicates nesting of id within treatment:

xtmixed outcome covariate treatment occasion || subject(treatment):

I might expect an adaptation of the example for xtmixed on page 184 [XT] to look like this:

xtmixed weight preweight treatment week || id(treatment):

It seems to me that id must be nested in treatment, but treatment is a fixed effect, not random, so the following syntax would be incorrect:

xtmixed weight preweight treatment week || id : treatment

It does not seem possible to nest subject (as a random term) within treatment in -xtmixed-; which seems the appropriate specification. Am I incorrect in thinking that this nesting is necessary?

Buzz Burhans

*   For searches and help try:

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