Interaction effect 2x2 ANOVA 2nd level w/ Nilearn

Hi everyone,

We are trying to set up a task based fMRI GLM analysis in nilearn with a repeated measure 2x2 factorial design. We are not sure on how to set up the first and second level contrasts (similarly to this question:fMRI Group analysis (2nd-level) - Which 1st-level contrasts for which model?).

This example (Understanding parameters of the first-level model - Nilearn) indicates how to build the F-contrast at the first level, but we are not sure on how to test for the interaction at the second-level.

Should we build the F contrast at the first level testing for the interaction and then perform a t-test at the second level with the maps from each subject?

Thank you very much for any suggestions!

The easiest way in my opinion is to estimate the interaction at the 1st level and then just do a one-sample t-test at the 2nd level.

Let’s take the tutorial you linked:
“left - right button press”: (
contrasts[“audio_left_hand_button_press”]
- contrasts[“audio_right_hand_button_press”]
+ contrasts[“visual_left_hand_button_press”]
- contrasts[“visual_right_hand_button_press”]
)

this is a contrast for main effect of direction, right?

“audio- visual button press”: (
contrasts[“audio_left_hand_button_press”]
+ contrasts[“audio_right_hand_button_press”]
- contrasts[“visual_left_hand_button_press”]
- contrasts[“visual_right_hand_button_press”]
)

this is a contrast for main effect of modality…

“modalityXdirection”: (
contrasts[“audio_left_hand_button_press”]
- contrasts[“audio_right_hand_button_press”]
- contrasts[“visual_left_hand_button_press”]
+ contrasts[“visual_right_hand_button_press”]
)

this is a contrast for the interaction.

Once you have these for each of your participant, you can get away with just doing a one-sample t-test on the resulting Z-maps like we see here:

Thank you very much for your suggestion @foldes.andrei . That sounds like a good approach to me!