I’m having difficulties to decide the best way to use 3dLME in my group analysis. I have two within-subject variables and a trial-level continuous covariate to control for. In analysis of behavioral data, I would also enter subjects and stimulus as random effects, and the latter is a trial-level variable. My question is if it is appropriate for me to calculate single trial betas for 3dLME? Or should I just do condition-wise analysis and discard the continuous covariate and stimulus as a random effect? And is there a better function to use in this case?

How did you perform your subject-level analysis? Did you obtain trial-level or condition-level effect estimates at the subject level? How many trials per condition? Did you model the covariate effect at the subject level through modulation?

Thanks for your reply. I did both trial-level and condition-level effect estimates. 108 trials per condition.Can I add the random effect (stimulus index) at subject level?
And for the continuous covariate, how should I handle it at the subject-level?
Thanks!

And for the continuous covariate, how should I handle it at the subject-level?

Use option -stim_times_AM2 in 3dDeconvolve/3dREMLfit for condition-level modeling. In that case, you perform a 2 x2 within-subject ANOVA at the population level using, for example, 3dMVM.

Do you mean I should use 3dLMEr with the trial-level estimates?

Are you interested in the population-level covariate effect across trials? If yes, you can use 3dLMEr (or 3dLME) as I previously suggested.

Can I add covariates at subject level when doing 3dDeconvolve in this case?

If you’re not interested in the population-level covariate effect across trials, you have two options: 1) the same model with 3dLMEr (or 3dLME), or 2) you could model the covariate effect at the subject level, and the proceed with the condition-level effects as input for your population-level analysis with 3dMVM.

I’m not sure if I understood you correctly. I will try to put everything together and please correct me if I’m wrong. Thank you!

I have two factors, one covariate that I’m not interested in and just want to control for, another covariate (rating) that I am interested in. And I’d like to have two random effects in the model, one is subject ID, the other is stimulus ID (this one is trial-level). In a behavioral model I would do rating~factor1*factor2+covariate+(1|SID)+(1|stimID)

So I should add both covariates into 3dDeconvolve with the -stim_times_AM2 option. Should the stimulus ID go into the -stim_times_AM2 option as well?

And then on the group level, I should do the below model? Is the covariate here stimulus ID?
-model ‘factor1factor2covariate+(1+covariate|Subj)’

The discussion becomes difficult because some of the information was not provided from the beginning (and remains unclear even after a couple of rounds).

If I understand your situation accurately, now you have two quantitative variables (instead one as you indicated initially): you care about the effect of one (rating) but not the other. I assume rating was acquired at the trial level, but how about the other quantitative variable?

In a behavioral model I would do rating~factor1*factor2+covariate+(1|SID)+(1|stimID)

I assume that your model for the FMRI data would be slightly different from the one above for the behavioral data, but only you know your research hypotheses.

So I should add both covariates into 3dDeconvolve with the -stim_times_AM2 option. Should the stimulus ID go into the -stim_times_AM2 option as well?

Again, it is not clear what kind of the other quantitative variable is: does it vary across trials? If it does not, there is no point modeling it at the subject level.

And then on the group level, I should do the below model? Is the covariate here stimulus ID?
-model ‘factor1factor2covariate+(1+covariate|Subj)’

Without knowing the nature of the variable, I cannot say much.

If either covariate varies within each factor, you may need to center the covariate properly.

The
National Institute of Mental Health (NIMH) is part of the National Institutes of
Health (NIH), a component of the U.S. Department of Health and Human
Services.