I am trying to use beta maps for second-level GLM analysis.
However, I cannot find a way to save the beta maps from the first-level GLM function. Does anyone know how to save the beta map as nii file?
I also found that nilearn default setting of the 2nd level ‘effect_size’ map. Is ‘effect size’ map beta map?
Pure beta maps will come from individual conditions (that is, those that go into a contrast). The effect size here would be analogous to the “con_XXX” maps from SPM.
Yes. You have beta maps for your individual conditions, contrast maps for the difference between the beta maps, t-maps for the statistical significance of the contrasts, and z-maps for a normalized version of the t-maps. Outputting the z-score will get you directly to the last step, which will likely be useful for the next step in your analyses.
I’m sorry I have the same problem. I need a second-level GLM analysis between groups. Do I understand correctly that I need to save contrast maps between selected events at the first GLM level in order to calculate the contrast between groups at the second GLM level?
Assuming this is still a first level model, the output will still be the beta coefficients for how well the signal corresponds to the event regressor convolved with the HRF. You may also see these referred to as “dummy regressors”.
model.compute_contrast(condition_a,
output_type=‘stat’) AND model.compute_contrast(condition_a,
output_type=‘z_score’) should be the same as model.compute_contrast(condition_a,
output_type=‘effect_size’)?
Given that they are beta coeffs and model.compute_contrast(condition_a,
output_type=‘effect_size’) should be the way to extract beta coeffs…
Not quite. The effect size are the beta coefficients. stat is the t-values, which is are betas scaled by the variance of the betas, and z_score are normalized t-values. Does that make sense, or did I misunderstand the question at all?
I see! I think what was confusing is that in task fMRI studies usually t-values are reported when contrasting two conditions and betas are reported when… wanting to further illustrate said comparison or wanting to better understand interaction between >2 conditions.
Relatedly, when wanting to better understand my group level 2 (condition with 2 levels) x 2 (condition with 2 levels) interaction I can just as well opt to plot the the t-statistics of the individual conditions, instead of the unscaled beta coefficients, right?