Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Xtmixed specification for rmANOVA with 2 within-subject factors


From   Jared Saletin <jsaletin@berkeley.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: Xtmixed specification for rmANOVA with 2 within-subject factors
Date   Sun, 3 Apr 2011 15:30:30 -0700

Dear Stata users and experts,

I'm new to Stata and trying to learn xtmixed in a two-way within-subjects anova situation, and was hoping to ask a couple questions.

I have an psychological experimental design measuring performance on a cognitive task "y" with two controlled within-subject factors:  b - 3 levels (repeated conditions), and c - 2 levels (task manipulation, e.g. memory for two different word-types during the task), with subjects coded "s".

In an ANOVA setting I would typically do: 

(1) anova y s b / b#s c / c#s b#c, repeated(b c).

We have some missing data for a few subjects, so I hoped to move to a mixed model analysis. However,  I'm slightly confused as to the proper model specification.

Because both factors are experimentally controlled across subjects, I first presumed a random-intercept only model with fixed effects for a and b, and fit:

(2) xi: xtmixed y b##c || s:, var.

And then tested the effects of a, b, and a#b using the margins command (with asbalanced option, as the experiment was intended to be balanced), followed by tests of the main effects and interaction.

However, I've noticed on the ucla page,  a similar design (except also with a between-subject factor a) using what I believe are crossed random-intercepts for b,c and the interaction, respectively:

(3) xi: xtmixed y a##b##c || _all: R.bs || _all: R.cs || _all: R.bcs || s:, var.

I was hoping that the stats and Stata experts here could help me decide which is the better alternative to the rmANOVA, the former simple random-intercept model (model #2), seems to made more immediate sense to me.

Also, am I correct that to test the anova-style omnibus effects for b (or any factor), I would simply do: "margins b, post asbalanced" followed by "test (1.b=2.b=3.b)", for instance?

--

As a final question, and thank you for your patience,

If I wanted to include a random-slope into the model for say factor b, and would typically adapted model (2) above to be:

xi: xtmixed y b##c || s: b, var.

How would I best do the same for crossed model (3)?

Apologies if some of this is basic, I'm just attempting to integrate all my reading and find the ideal analyses.

Thank you all for your help!

Cheers,
Jared Saletin
*
*   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   |   Site index