I'm modelling trial-level betas using 3dLMEr (i.e., the input files for 3dLMEr are the trial-level betas using an un-modulated "stimulus" regressors and stim_times_IM). The model looks like this: ratings+cond+(1|subID). Here "ratings" is a quantitative variable between 0 and 1, "cond' is a categorical variable with 2 levels ("main" and "control") and subID is a 3-character subject ID.

Using this model I'm hoping to study how brain activity (trial-level betas) varies with the "ratings" and "cond" variables.

I think I've already figured out how to do this for the categorical "cond" term using gltCode thanks to the examples on the 3dlmer page (-gltCode diff 'cond : 1*main -1*control), but I'm not sure how to look at the effect of "ratings" (or any quant variable) on brain activity from this model - and by that, I mean (1) how can I get the regression estimate for this term besides the automatically-generated chi-square estimate, and (2) what is the best way to threshold chi-square distributions programmatically at p-value .001 and FDR-corrected thresholds?

I understand that it is possible to study the effect of the quantitative variable (ratings) within each level of the categorical variable (cond) like this: -gltCode someName cond : 1*main ratings :

Another question about 3dlmer - I would also like to test models with random slopes next, and in that case, is there an option to get the slopes?

Any help would be highly appreciated! I hope this is not redundant. I checked all the discussion board that had mentioned 3dLMEr and couldn't find the answer I was looking for. Some discussions (this and this) were similar, but couldn't find exactly what I'm looking for.

(1) center ratings for each condition.
(2) specify the model as -model 'ratings*cond+(ratings|subID/cond)' \

I'm not sure how to look at the effect of "ratings" (or any quant variable) on brain activity from this model - and by that, I mean (1) how can I get the regression estimate for this term besides the automatically-generated chi-square estimate

Add

-gltCode someName4 'ratings : ' \

what is the best way to threshold chi-square distributions programmatically at p-value .001 and FDR-corrected thresholds?

The output from 3dLMEr should automatically provide the FDR-q values. However, I suggest a highlight-but-not-hide approach in result reporting as shown in Figures 4-8 of this paper.

Thank you very much for the suggestions! I have a few questions/clarifications about them:
(1) Regarding centering the quant variable "ratings" within condition - would you recommend this with these 2 additional points in mind (sorry I didn't mention these in the original post):
(i) we have a within-subject design - i.e., we have only one group of subjects, and "main" and "control" are within-subject levels within the variable cond.
(ii) the quantitative term ratings (that you suggested centering for) is a meaningful variable for us - i.e., we're interested in the overall effect of this term on brain activity. So if I center "ratings" in the input data, won't the main effect for ratings become meaningless/wrong?

(2) about ratings*cond+(ratings|subID/cond) - I am not super experienced with nested LMEs, but is it a good idea to use cond both as a fixed and random effect term?

(3) -gltCode someName4 'ratings : ' \
Thank you very much!

(4) > The output from 3dLMEr should automatically provide the FDR-q values.
How can I access it? When I look at my results using 3dinfo -label output_file.nii.gz (or output_file.BRIK), I only see these:

ratings Chi-sq|cond Chi-sq|main|main Z|control|control Z|main-control|main-control Z

(5)> I suggest a highlight-but-not-hide approach ...
Thank you for the suggestion!

(1) Centering would not have any impact on those effects of interest. However, if you are not interested in comparing main and control, centering is not necessary.

(2) On second thought, I suggest a slightly different model: ratings*cond+(ratings*cond|subID). Yes, it is perfectly fine to have a similar effect structure as the population-level effects. In fact, it's desirable to have a varying intercept plus other varying effects as well as their correlation structure.

(3) The information about FDR-q is stored in the output header. Once loading the output into the AFNI viewer, you will see the FDR-q values underneath the threshold slider bar.

Thanks for the clarification! I am interested in the main v. control contrast, so I think centering makes more sense. This doc also had some helpful info on centering.

The information about FDR-q is stored in the output header. Once loading the output into the AFNI viewer, you will see the FDR-q values underneath the threshold slider bar.

Ah got it. I knew about this one, but I was wondering if there was a way to do this programmatically.

One last question (which was at the end of my first message): Is there a way to get the individual slopes for each subID from the random effects? A later analyses I would like to do is to compare individual subjects' slopes to their behavior (e.g. if my random effects term is cond|subID, is there a way to get the individual slopes for cond - i.e., the difference between levels of cond (main and control) from 3dLMEr?

I was wondering if there was a way to do this programmatically

3dFDR can be used for that.

if my random effects term is cond|subID, is there a way to get the individual slopes for cond - i.e., the difference between levels of cond (main and control ) from 3dLMEr

It does not make sense to obtain the difference from 3dLMEr. Rather, you might already have that contrast directly available from each individual. If not, compute it using

Quick question on the highlight-but-not-hide approach you suggested above. I'm trying to do this with @chauffeur_afni. I'm stuck at not being able to figure out how to plot FDR-corrected results this way. This is the script for plotting some results at p < .001.

I checked out this repo linked in this paper about the topic and also @chauffeur_afni documentation here and here, but didn't find a clear answer. Is this something I can set as an afni environment variable perhaps?

That's an interesting one... I hadn't thought of putting in FDR adjustment to stats here. Hmmm.

I can see the utility of just adding an option to FDR adjust internally, but I think it probably should be done outside of the @chauffeur_afni visualization program. Primarily, there are several options/styles of performing FDR, and some of those can depend strongly on using a mask; putting several consistency checks within the visualizer would be pretty lengthy, given the possible permutations/combinations. I think it would be safer to have the user do that externally, even though it will involve the pain of gluing the effect estimate and new FDR-adjusted stat output together.

# noting that there are a few options for specifically how
# to perform the FDR adjustment
3dFDR -prefix FDR_VOL.nii.gz -input "${olay}[${thr_subbrik}]" ...
3dTcat -prefix GLUED.nii.gz "${olay}[${olay_subbrik}]" FDR_VOL.nii.gz

... and then in your @chauffeur_afni command, your subbricks woudl probably be set as:

Yes this sounds good. Thank you very much!! I'll try this and report back in case there were any issues!

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.