Statalist


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

Re: st: specifying random effects in -xtmixed- for pretest/posttest clustered design


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: specifying random effects in -xtmixed- for pretest/posttest clustered design
Date   Thu, 02 Apr 2009 20:07:12 -0400

Try,

 xtmixed y cond t tc || g: cond t tc

this tells -xtmixed- to estimate random effects across group
for cond, t, and tc.

I don't know what murray means by including M as a random
effect (and don't feel like pulling his book off the shelf
to check), but I'm pretty sure you don't want that unless
you have multiple records per person per time point.

hth,
Jeph



Michael I. Lichter wrote:
I am having difficulties figuring out how to specify the random effects in -xtmixed- for my study design, and I haven't been able to find anything helpful in the archives or the manual.

My study is a standard cluster-randomized, two-condition, two-time-point trial with balanced allocation of clusters to conditions and only moderate variation in cluster size, with no stratification, crossing, matching, or anything else. Suppose I have one record per time point per person with variables:

c - study condition (control or intervention)
t - time point (pretest or post-test)
m - ID # for individual enrolled in trial
g - group #
y - study result

I am taking my guidance from David Murray's DESIGN AND ANALYSIS OF GROUP-RANDOMIZED TRIALS and trying to follow his example for what he calls an "unadjusted time x condition analysis" for "nested cohort designs" (pp. 296-311). The model, with subscripts omitted, looks like this: Y = mu + c + t + tc + G + M + TG + MT + e, where mu is the grand mean, tc is the interaction effect t*c (same for TG and MT), and G, M, TG, and MT are random effects.

Is any of these correct given the model?

xtmixed y cond t tc || G: || M: || TG: || MT: xtmixed y cond t tc || G: TG || M: MT xtmixed y cond t tc || G: M TG MT None of the above converge successfully with my data, but that doesn't mean they're all wrong ... Obviously, I'm unclear on how the specification of random effects works.

FWIW, Murray provides the following SAS code (with my variable names; and "ddf = 4,4,4" is for a specific example):

proc mixed info order=internal noclprint;
       class C G M T;
       model Y = C T C*T /ddf = 4,4,4 ddfm = res;
       repeated T /type = cs subject = M(G*C) r = 1 to 3 rcorr = 1 to 3;
       random G(C) TG(C);
       lsmeans C*T /slice=C slice=T c1 e;
       estimate `(I3 - I0)-(C3-C0)' C*T 1 -1 -1 1/cl e;
run;

I can run this in SAS, but the value of doing so is diminished by the fact that Murray's commands and annotations are about 10 years out of date; I'd rather do it in Stata if possible.

Thanks.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index