gltCode in 3dLME

Dear AFNI experts,

I have a study with a repeated measured design, where all participants when through two sessions of resting-state fMRI in separate days. Before each session, they took either medication x or y. Using 3dLME, I'm trying to analyze 1) the relationship between age and FALFFs in each session; 2) compare their FALFFs in x vs. y sessions; 3) examine the moderating effect of age on the change in FALFFs from x to y session.

-gltLabel 1 "x*age"	-gltCode 1 "pill : 1*x age :" #Relation between age and FALFF in x session
-gltLabel 2 "y*age"	-gltCode 2 "pill : 1*y age :" #Relation between age and FALFF in y session
-gltLabel 3 "x_y_age" -gltCode  3 "pill : 1*x -1*y age :" #Interaction between age and medication

My code works when I only included formulas 1 and 2. But it doesn't work when I add formula 3. I guess it is a syntax error. Any suggestions are welcome!

Could you share the snippet containing the model specification? We need to see those first few lines to understand the structure.

Gang Chen

Hi @Gang ,

Below is the code I used:

3dLME -prefix 3dLME_falff_age						\
	  -jobs 4										\
	  -mask T1_mask_intersection+tlrc			    \
	  -model "pill+visit+order+sex+age+motion"		\
	  -qVars "age,motion"     						\
	  -ranEff "~1"									\
	  -SS_type 3									\
	  -num_glt 3									\
	  -gltLabel 1 "x*age"	-gltCode 1 "pill : 1*x age :"		\
	  -gltLabel 2 "y*age"	-gltCode 2 "pill : 1*y age :"		\
	  -gltLabel 3 "x-y"		-gltCode 3 "pill : 1*x -1*y age :"	\
	  -dataTable 	

The model you specified

-model "pill+visit+order+sex+age+motion" \

implicitly assumes that the effect of age is identical across the two levels of pill, as it excludes any interaction between them. This assumption is inconsistent with your stated goal of assessing whether the age effect differs by pill condition.

To align the model with that objective, the interaction between pill and age should be included, for example:

-model "pill*age+visit+order+sex+motion" \

This specification allows the age effect to vary as a function of pill, making the interpretation of differential age effects well defined.

As a side note, ensure that each covariate included in the model is justified for the specific effects you intend to test. See more discussion here.

Gang Chen

Hi @Gang ,

Thank you so much for your suggestion! That works!

Best,
Chuan