I’d like to run the following regression model on a voxel-wise basis. I specified it in R syntax because I basically want something like 3dLMEr, but without the mixed-effects.

I thought 3dRegAna would do this, and maybe it does, but it doesn’t appear that I can model the interaction of a behavioral and brain variable. Thanks for any help!

The model:

lm(formula = y ~ x*brain + age + sex + race_ethnicity + education + marriage status + income + device, data = dat)

Is it better to try to bring the fMRI data into R?

I assume x and y each has one value per subject. See if the following works for you.

Remove the population mean of x from each subject and call it X;

Remove the population mean of ‘brain’ at the voxel level and call it BRAIN;

Obtain the product of X and BRAIN using 3dcalc for each subject and call it XB:

3dcalc -a BRAIN -expr ‘a*x’ -prefix XB

Create a 3D dataset for subject with the same y value for the whole brain with a command like

3dcalc -a BRAIN -expr ‘y’ -prefix subject1

Set up your model using 3dttest++ with all the explanatory variables: X, BRAIN, XB plus other covariates. 3dttest++ can accommodate voxel-wise covariates (BRAIN and XB in your cases).

Thanks Gang. A suggested future addition, to make this more straightforward, is to have a 3dLM version of 3dLMEr (or even better, allow robust linear modeling as well). But that may be down the line. In the meantime, a quick question about 2).

For 2) Remove the population mean of ‘brain’ at the voxel level and call it BRAIN;

Is that a 3dcalc command in which mean is the mean of all brain voxel b-values?

A suggested future addition, to make this more straightforward, is to have a 3dLM version of 3dLMEr (or even better, allow robust linear modeling as well).

In fact 3dMVM does allow voxel-wise covariate, but the limitation is that currently it can only take one voxel-wise covariate (you have two in this case). And it also does robust regression.

For 2) Remove the population mean of ‘brain’ at the voxel level and call it BRAIN;
Is that a 3dcalc command in which mean is the mean of all brain voxel b-values?

The mean/average should be performed across all the subjects for each voxel separately. You can use 3dMean or 3dTstat to compute the voxel-wise mean, and then use 3dcalc to subtract the mean from each subject’s data.

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.