# How to deal with a specific case of unbalanced within-subjects design?

I have a completely within-subjects design with 3 independent variables:

• Trial type (3 levels)
• Modality (3 levels)

However, for one of my levels of Trial type, the Task order and Modality levels are redundant (because it is essentially a baseline measurement).

Ideally, I'd like to run a 3 (trial type: 1, 2, or 3) x 2 (task order: a or b) x 3 (modality: vm, av, hm) repeated measures ANOVA.

Do you know of a way around this? If I were to duplicate the Task 3 data across 'modalities' and 'task orders' I would have the correct number of levels for each within-subjects factor (i.e. six identical columns of data to represent imaginary modalities and task orders for Task 3). I'm assuming this violates an assumption but I'd be worried about looking at a similar analysis with a huge number of paired sample t-tests. Is lots of t-tests the way to go? Thanks for your help!

• Is the redundancy just in the meaning of the predictor variable or is it in the actual data such that each variable repeats the same baseline data? – John Mar 21 '11 at 16:13

You might use a nested design (and a hierarchical/multilevel model). The top level would be Baseline v Non-Baseline, and the Non-Baseline would include your 2^3 factorial design.

I unfortunately can't post my pretty picture of the nesting structure because I don't have 10 reputation yet.

I'd have to read a bit to remember exactly how to do this, but I'm pretty sure that this is a reasonable way of doing it.

• Can you post the picture now? – GaBorgulya Apr 13 '11 at 2:22

Riffing off of Thomas' suggestion, I think a multilevel model for this data would look something like this...

y(hat) = TrialTypeA + TrialTypeB + ModalityA + ModalityB + TaskOrder + TrialTypeA:ModalityA + TrialTypeB:ModalityB + TrialTypeA:TaskOrder + TrialTypeB + TaskOrder

At a deeper layer in the model each of these variables individual differences can be eliminated in regards to the TrialType variable.

The As and Bs for TrialType are dummy codes where a value of 0 means the baseline condition and a value of 1 denotes membership in a condition. E.g. ModalityA might be 0 for VM but be 1 for AV and the ModalityB would be 0 for VM but be 1 for HM.

In R I would specify this model (having loaded the package lme4) as lmer(TrialTypeA + TrialTypeB + ModalityA + ModalityB + TaskOrder + TrialTypeA:ModalityA + TrialTypeB:ModalityB + TrialTypeA:TaskOrder + TrialTypeB + TaskOrder + (1|SubjectID),data=mydata)

Good luck.