MATLAB Answers

2-way-anova with balance over subjects

1 view (last 30 days)
I have a 2x2 design measuring 50 subjects reactiontimes in congruant and incongruant conditions, using 2 different devices (joystick, responsepad).
My main effect is within devices (congruant trials should be faster than incongruant trials), my interaction effect is between devices(In the joystick-setup the effect should be more pronounced than for the Responsepad). I want to balance over subjects (since some subjects might be naturally slower or faster than others) and over the stimulus set (each subjects sees the same stimuli and I want to account for some stimuli being more difficult to react to).
Each row of my datatable would therefor look roughly like this:
SubjectNr StimulusNr Device Congruant/Incongruant Reactiontime
1 1 1 1 0.9213
1 2 2 1 0.4123
1 3 1 2 0.3123
1 4 2 2 0,5123
2 1 ... ... ...
The first 4 rows are obviously categorical variables.
After reading the anova, ranova and fitrm in Matlab several times I still struggle how to implement my analysis. Im thankfull for any help
Best Jo


Sign in to comment.

Accepted Answer

Jeff Miller
Jeff Miller on 29 Nov 2020
Look here for an explanation of how to do a repeated measures ANOVA with the same 2x2 within-Ss structure.


Show 3 older comments
Jeff Miller
Jeff Miller on 30 Nov 2020
That is clear--thanks for the explanation.
I assume that the 100 different pictures are chosen pseudo-randomly to represent some larger set of possible pictures (much like the subjects represent possible people). In that case, your experiment formally has two random elements--subjects and pictures--and you would need linear mixed models to accommodate both of these "random factors". The MATLAB command for this is 'fitlme', but I don't have a lot of experience with that and so cannot say what the model command would be.
I also assume that the pictures were assigned randomly to congruent/incongruent conditions within a device. If you are not interested in the effect of stimuli, I think you should just trust that the random assignment appropriately balanced the stimuli across conditions (so stimulus differences would not skew your results), and analyze the 4 condition averages per subject.
A final comment: from experience with this sort of experiment, my impression is that there will actually be large order effects unless the subjects already have a lot of practice with the task. So, I would not ignore these order effects (doing so may reduce your power to detect the device and congruence effects). The simplest way to include order effects is to have a between-subjects order factor with three levels.
Johannes Solzbacher
Johannes Solzbacher on 30 Nov 2020
Thank you very much for your help.
True, I think I have to use linear mixed models here - I think this is also why I didnt get any further with the ANOVA at this point. I gonna do it like you say and for now average over the 4 conditions within the subjects and do a 2x2 ANOVA.
Than I gonna go for a second step and try it with linear mixed models. That all helped me a lot, thank you very much for your effort, I realy apprciate it :)
Jeff Miller
Jeff Miller on 30 Nov 2020
You are welcome. Good luck with your research.
If you get around to looking at delta plots (as some people do with congruence effects), you might find some of the routines in RawRT useful.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by