Comparison of Different Runs or Sessions in RFX Analyses: Dummy Coding Design Matrices

BrainVoyager version: 23.0
Datasets used: ses-01_task-Localizer_run-01_bold and ses-01_task-Localizer_run-02_bold of sub-01 and sub-02 of the newbi4fmri datasets (Jody Culham and Kevin Stubbs and Ethan Jackson and Rebekka Lagace Cusiac (2020). newbi4fmri2020 Localizer. OpenNeuro. [Dataset] doi: 10.18112/openneuro.ds003433.v1.0.1, accessed 31 January 2023)

 

  1. Conducting a random effects (RFX) analysis necessitates distinguishing effects across individuals. In BrainVoyager, when employing the conventional multi-study GLM technique, it's required to select the "separate subjects" option for the RFX analysis. However, a limitation of this approach is the averaging of the subject-specific data across runs. Alternatively, opting for the "separate studies" option is not suitable for executing a Random Effects Analysis, as it separates all runs, even though there may be several per subject.



    When one wants to compare the different runs in the course of the Random Effects analysis, there is an easy workaround that allows to compare predictors as well as runs in the course of statistical contrasts.
     
  2. Normally, the protocol (PRT) as well as the design matrix (SDM) files have already been created at this stage of the analysis. To be able to perform a separation of subjects as well as runs, one has to adapt the design matrix file, which is the “heart” of the GLM analysis. Using external tools (e.g. Excel, Matlab, Python), the SDM files can be changed in a very flexible way, but there is a potential risk of getting typical import / export problems. We can also go one step back and change the protocol files within BrainVoyager.
     
  3. For this example, we will use a face/body/hand localizer dataset including two functional runs per participant and session. The simple block design contains four conditions in the original protocol file called "Body", "Face", "Hand" and "Scrambled".  Using the original design matrix files (SDM)(separating the four predictors) would allow us to run either a simple Fixed Effects analysis or a Random Effects analysis on the basis of four predictors. As discussed above, the Random Effects Analysis requires (per definition) separate subjects predictors and will not separate the runs.
     
  4. So we begin to change the protocol assigned:
    1. We link the first run (VTC) and
    2. open the protocol dialog and see that the protocol contains the four conditions described above


       
  5. To enable the proper separation between the runs, we have to add four new conditions and change the names of the old conditions.





    The four new conditions have no assigned time points in the new protocol. In the design matrix created later, they will be filled with zeros.
    The new protocol has to be saved to disk.

  6. Now, we create an SDM file from the adapted protocol file. One can see the list of predictors on the right side of the Single Study GLM dialog.





    We save the new SDM file that has eight predictors (four for the first and four the second run). BrainVoyager will present a warning that it has detected zero-filled predictors (our dummy-coded conditions). Usually, one should avoid zero-filled predictors as these predictors contain no information and pose a problem in the analysis. However, in that specific case we will accept these zero-filled predictors as we will combine them with predictors that contain information at the second level for the multi-subject analysis.




     
  7. Steps 5 and 6 have to be repeated for the second functional run. However, please be aware that it is important to keep the order of the PRT conditions identical across both runs, i.e. first all conditions of the first run (*_run-01), followed by all conditions of the second run (*_run-02). This can be easily achieved by opening the PRT file in any text-editor and adapting and saving the PRT in there:




     
  8. Now, the SDM for the second run is defined and saved in exactly the same way as for the first run.


     
  9. Now, we can finally create the necessary multi-study design matrix on the basis of the VTC data and the adapted SDM files.



    One can nicely see that the design matrix now contains eight predictors. The names of the predictors and their order are the same in both SDM files. It is advised to save the new multi-study design matrix as an MDM file.
     
  10. We run a Random Effects analysis (RFX GLM). The result allows to compare conditions as well as runs across the subjects. 


     
  11. We open the “Overlay GLM” dialog and see the different run and condition predictors per subject:



    Keep in mind that you can specify the conditions only in the same way for every subject in the RFX analysis.

 

You can also adapt the example python script attached to this article to create dummy coded protocol files and the corresponding dummy coded design matrix files for multiple participants in BrainVoyager.