Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: xtmixed for repeated measures
From
Philip Ender <[email protected]>
To
[email protected]
Subject
Re: st: xtmixed for repeated measures
Date
Mon, 14 Nov 2011 08:39:21 -0800
Carrie Petrucci <[email protected] wrote
...
I hope I have not offended by including syntax from the other
statistical programs, but it seemed like the easiest way to illustrate
what I'm trying to do.
1. My dataset is long with up to 3 records per person to represent
standardized assessments at intake, 3 months, and 6 months; I wish to
look at the pattern of change over time and want to be able to look at
data for all participants, rather than just those with data at all 3
time points; these are periodic data runs that I do for project staff
for whom I do the evaluation work, and they find it quite motivating
to hear where there are trends towards improvement.
2. I "xtset" the data, although I'm unsure this was necessary
3. I used the syntax below thus far and it rendered the model output
(I've not yet included a between subjects factor as the SAS and SPSS
examples above do):
xtmixed bcs xobs || xpid:
"bcs" is the dependent variable measured at 3 time points;
"xobs" is 1, 3, or 6 to represent intake, 3 months or 6 months;
"xpid" is the individual id for each participant
4. I've also run it this way:
xtmixed bcs i.xobs || xpid:
I assume, but wish to confirm, that both models are valid, with the
"i.xobs" incorporating the dummy coding that tests each level of xobs
to the first level, which in this case, is intake, which would be an
appropriate for this data
5. From there, I cannot figure out the appropriate commands to get the
remaining output and to apply a first order autoregression model,
which appears to be appropriate for my data. Output in the SAS output
that would be helpful to see includes:
(These are titles of tables from the SAS output)
Estimated Correlation Matrix for Groups
Covariance Parameter Estimates
AIC and BIC fit statistics
Type 3 Tests of Fixed Effects
I hope these are easy questions to someone familiar with Stata. Thank
you for any assistance you can provide.
----------------------------
Dear Carrie,
Here are my suggestions of how to run a repeated measures analysis
with -xtmixed-. I note that both the SPSS and SAS examples include a
between subjects factor and your code does not. I will stick with
your example.
. xtmixed bcs i.xobs || xpid:, var reml residuals(ar1, t(visit))
// note the -reml- and -residuals()- options
. contrast xobs
// anova-type summary table
. margins xobs, asbalanced
// cell means equivalent to spas emmeans
. estat ic
// AIC and BIC
. pwcompare xobs, mcompare(bonferroni)
// pairwise post-hoc if needed (wanted)
I hope this is useful.
--
Phil Ender
UCLA Statistical Consulting Group
*
* 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/