3dLME inputs

Hi AFNI Team,

I am working on an longitudinal analysis involving an fMRI paradigm with 3 visits. As a substantial number of patients had only two visits, I believe it is appropriate to use linear mixed effects analysis to be able to include those patients with missing data. My model fails and I am unsure why -

Does first-level analysis need to be conducted within AFNI? I am unsure if this is what is causing my problem. For example, I have previously analysed this data within FSL - am I able to use results from my first level analysis in FSL (e.g. cope files or t-statistics in standard space, for each subject/visit) as the inputs for 3dLME?

Otherwise, can you see any problem with my model specification below? Currently, it only contains 2 subjects, as I wanted to be sure it worked before including them all!

Thanks,
Naomi

3dLME -prefix LME_fMRI_fsl -jobs 2
-model ‘Visit+Time_dif+Base_DD+Base_Age’
-qVars ‘Time_dif,Base_DD,Base_Age’
-num_glt 3
-num_glf 1
-gltLabel 1 ‘Visit_1_2’ -gltCode 1 ‘Visit : 1v1 -1v2’
-gltLabel 2 ‘Visit_2_3’ -gltCode 2 ‘Visit : 1v2 -1v3’
-gltLabel 3 ‘Effect_of_time’ -gltCode 3 ‘Time_dif :’
-glfLabel 1 ‘Main_effect_visit’ -glfCode 1 ’ Visit : 1v1 -1v2 & 1v1 -1v3’
-ranEff ‘~1’ -SS_type 3
-dbgArgs
-dataTable
Subj Visit Time_dif Base_DD Base_Age InputFile
s1 v1 0 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/001_V1/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s1 v1 0 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/001_V1/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s1 v2 625 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/001_V2/1_run_Naomi++.feat/reg_standard/stats/cope8.nii.gz
s1 v2 625 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/001_V2/2_run_Naomi+.feat/reg_standard/stats/cope8.nii.gz
s1 v3 1150 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/001_V3/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s1 v3 1150 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/001_V3/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s2 v1 0 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/002_V1/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s2 v1 0 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/002_V1/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s2 v2 571 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/002_V2/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s2 v2 571 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/002_V2/2_run_Naomi+.feat/reg_standard/stats/cope8.nii.gz
s2 v3 1210 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/002_V3/1_run_Naomi++.feat/reg_standard/stats/cope8.nii.gz
s2 v3 1210 2.58 54.28 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/002_V3/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz

Does first-level analysis need to be conducted within AFNI?

No, most programs in AFNI including 3dLME can take NIfTI files as input.

it only contains 2 subjects, as I wanted to be sure it worked before including them all!

This is at least one source for model failure: there is not enough data available for the model. Try the script with at least 10 subjects.

In addition, a couple of other potential issues:

  1. It seems that Time_dif varies within subject. So, you may consider a finer model:

-model ‘Visit*Time_dif+Base_DD+Base_Age’ \

-ranEff ‘~1+Time_dif’

  1. Be careful about the centering issue. If the group average of Time_dif varies across those three visits, you may have to center within each visit first before feeding those Time_dif values into the data table for 3dLME:

https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/STATISTICS/center.html

  1. The following part

-num_glf 1 \
-glfLabel 1 ‘Main_effect_visit’ -glfCode 1 ’ Visit : 1v1 -1v2 & 1v1 -1v3’ \

is unnecessary because 3dLME automatically provides an omnibus test for each variable in the model.

Hi Gang,

Thank you for your quick and very helpful reply!
As you suggested, I have changed the model and centred ‘Time_dif’ within each visit, before running the model on 10 subjects
However I am still running into problems and am unsure what I’m doing wrong -

My model specification now reads:

3dLME -prefix LME_fMRI_fsl -jobs 2
-model ‘VisitTime_dif+Base_DD+Base_Age’
-qVars ‘Time_dif,Base_DD,Base_Age’
-num_glt 3
-gltLabel 1 ‘Visit_1_2’ -gltCode 1 'Visit : 1
v1 -1v2’
-gltLabel 2 ‘Visit_2_3’ -gltCode 2 'Visit : 1
v2 -1*v3’
-gltLabel 3 ‘Effect_of_time’ -gltCode 3 ‘Time_dif :’
-ranEff ‘~1+Time_dif’ -SS_type 3
-dbgArgs
-dataTable @10_subs.txt

And the data table :
Subj Visit Time_dif Base_DD Base_Age InputFile
s01 v1 0 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/001_V1/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s01 v1 0 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V1/001_V1/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s01 v2 -9.5 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/001_V2/1_run_Naomi++.feat/reg_standard/stats/cope8.nii.gz
s01 v2 -9.5 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/001_V2/2_run_Naomi+.feat/reg_standard/stats/cope8.nii.gz
s01 v3 -85.1 4.71 56.15 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/001_V3/1_run_Naomi.feat/reg_standard/stats/cope8.nii.gz

s14 v2 -79.5 2.82 50.22 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V2/014_V2/2_run_Naomi.feat/reg_standard/stats/cope8.nii.gz
s14 v3 -179.1 2.82 50.22 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/014_V3/1_run_Naomi+++.feat/reg_standard/stats/cope8.nii.gz
s14 v3 -179.1 2.82 50.22 /media/nhannawa/NIU3/Motor_task_TRANSEURO_FSL/PD_V3/014_V3/2_run_Naomi++.feat/reg_standard/stats/cope8.nii.gz

I also checked the both the specification and table using the file tool, which showed no problems:
file_tool -infiles test.txt -test
test.txt has 0 bad characters
test.txt file type: UNIX

Any ideas what the remaining problem might be?
Thanks again,
Naomi