mandymejia / BayesfMRI

BayesfMRI R package
GNU General Public License v3.0
24 stars 7 forks source link

Repeated measures with `BayesGLM2`? #32

Open alexenge opened 11 months ago

alexenge commented 11 months ago

Hi all and thanks so much for creating this wonderful package!

I'm working with longitudinal data where I have repeated measures (6 sessions) for each of my participants and would like to model differences between these sessions (either as a categorical "session" factor or as a continuous "time" variable).

I assume and just wanted to double check that with the current implementation, all the first level models/maps that are fed to the second level stage are assumed to be statistically independent? That is, there is no way to estimate something like a repeated measures ANOVA or mixed model (with random by-participant intercepts or slopes)? Or do you see a way to do this via the contrast matrix argument?

Thanks a lot in advance for any replies and suggestions! :)

mandymejia commented 11 months ago

Hi Alexander,

Sounds really interesting! The short answer to your question is yes – we do not incorporate any explicit longitudinal modeling into the method implemented in BayesfMRI. However, we have applied the methods to longitudinal modeling in the past ( https://www.sciencedirect.com/science/article/pii/S1053811922003056). In that analysis, we developed a multi-session model extension (implemented in the package), which provides session-specific beta estimates while sharing spatial hyperparameters across sessions. This is mainly to improve estimation efficiency of these parameters. For the actual longitudinal analysis, we quantified the size of activations (implemented in the package) and fed that into a linear mixed effects (random intercept) model. That allowed us to avoid voxel/vertex-level comparisons (impacted by functional misalignment between subjects) and actually perform the analysis in native space, which we felt was important in our context. Explicit longitudinal or mixed effects modeling would be super useful, but that's not something we've pursued thus far. I'd be curious to know which route you take!

Mandy

On Thu, Oct 26, 2023 at 4:18 PM Alexander Enge @.***> wrote:

Hi all and thanks so much for creating this wonderful package!

I'm working with longitudinal data where I have repeated measures (6 sessions) for each of my participants and would like to model differences between these sessions (either as a categorical "session" factor or as a continuous "time" variable).

I assume and just wanted to double check that with the current implementation, all the first level models/maps that are fed to the second level stage are assumed to be statistically independent? That is, there is no way to estimate something like a repeated measures ANOVA or mixed model (with random by-participant intercepts or slopes)? Or do you see a way to do this via the contrast matrix argument?

Thanks a lot in advance for any replies and suggestions! :)

— Reply to this email directly, view it on GitHub https://github.com/mandymejia/BayesfMRI/issues/32, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHVKUTVVAFIIKKMBS2P4FDYBITFPAVCNFSM6AAAAAA6Q2WZ3CVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3DGMBXGQ3TKNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

alexenge commented 11 months ago

Thanks, Mandy, for the super fast and detailed response. The summary of your approach and the link to the paper are incredibly useful!

I've already implemented a (frequentist) whole-brain mixed model at the group level using AFNI's 3dLMEr, but based on first level maps from a classical GLM (from Nilearn). It's great to hear that it's possible to use BayesfMRI as a drop-in replacement at the first level and then feed the results into some other (frequentist) second level model! The spatial modeling with hyperparameter sharing across sessions could be a real game changer for my kind of data.

Of course it would be cool to have a one-stop (mixed model) solution within BayesfMRI, but I totally get that this would be a lot of additional work. Maybe someday if one of us has some time on our hands 🙂

Thanks again and feel free to close this!