contrast coding error 3dLMEr

AFNI version info (23.1.08):
I have been trying to run my analysis to determine the effects of Time on education groups (low:0 vs high:1) across levels (pos:1 vs neg:0) of ptau status and I keep getting this error:

Warning messages:
1: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :
  NAs introduced by coercion
2: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :
  NAs introduced by coercion
3: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :
  NAs introduced by coercion
4: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :
  NAs introduced by coercion
5: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :
  NAs introduced by coercion
6: In gl_Constr(lop$num_glt, lapply(lop$gltCode, "[", -1), lop) :

##followed by this error once the analysis is over 

*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [13 TimeEdu Z] = 0
*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [15 TimePtau Z] = 0
*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [17 HighPosNeg Z] = 0
*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [19 LowPosNeg Z] = 0
*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [21 LowHighNeg Z] = 0
*+ WARNING: mri_fdrize: will not process only 0 values (min=20)
++ Smallest FDR q [23 LowHighPos Z] = 0

This is the code i used to call the function:

3dLMEr -prefix output_lmer_sample \
       -model 'Time_since_BL*education_group*ptau_status+Sex+TIV+scanner+(1|Subj)' \
       -qVars "Time_since_BL,TIV" \
       -gltCode Time 'Time_since_BL : ' \
       -gltCode TimeEdu 'Time_since_BL : education_group : 1*0 -1*1' \
       -gltCode TimePtau 'Time_since_BL : ptau_status : 1*1 -1*0' \
       -gltCode HighPosNeg 'Time_since_BL : education_group : 1*1 ptau_status : 1*1 -1*0' \
       -gltCode LowPosNeg 'Time_since_BL : education_group : 1*0 ptau_status : 1*1 -1*0' \
       -gltCode LowHighNeg 'Time_since_BL : education_group : 1*0 -1*1 ptau_status : 1*0' \
       -gltCode LowHighPos 'Time_since_BL : education_group : 1*0 -1*1 ptau_status : 1*1' \
       -dataTable @analysis_table_numeric_sample.txt \
       -resid residuals \
       -jobs 4

The error may lie in the way i wrote the contrast but I have looked at the documentation and I feel like that's how I should write them. Main effect of time alone worked. so it might have to do with how to specify interactions correctly (or levels of each factor). My dataset is clean without any NA and the summary of the data structure can correctly pick up the 2 levels so I'm at a loss. Thanks for any help !

2 levels for factor ptau_status : 0 1
2 levels for factor education_group : 0 1

and here is a little sample of my data

Subj    Visit_label_x   TIV     MRI_date        scanner Baseline_score    Time_since_BL   Sex     Education_years ptau217_UGOT    ptau_status     education_group    group   InputFile
MTL0447 BL00    1455.301504     2015-02-11      1       57.2    0       Female  14      1.6475  0       0       low_neg ./sub-MTL0447/ses-BL00A/mri/smwmwp1rsub-MTL0447_ses-BL00A_T1w.nii
MTL0447 FU24    1455.301504     2017-02-24      1       57.2    2.04    Female  14      1.6475  0       0       low_neg ./sub-MTL0447/ses-FU24A/mri/smwmwp1rsub-MTL0447_ses-FU24A_run-02_T1w.nii
MTL0447 FU12    1455.301504     2016-02-15      1       57.2    1.01    Female  14      1.6475  0       0       low_neg ./sub-MTL0447/ses-FU12A/mri/smwmwp1rsub-MTL0447_ses-FU12A_T1w.nii
MTL0194 FU72    1318.130566     2019-06-28      2       63.2    6.08    Female  12      1.7236  0       0       low_neg ./sub-MTL0194/ses-FU72/mri/smwmwp1rsub-MTL0194_ses-FU72_acq-MPRAGE_T1w.nii
MTL0194 FU12    1318.130566     2014-05-12      1       63.2    0.95    Female  12      1.7236  0       0       low_neg ./sub-MTL0194/ses-FU12A/mri/smwmwp1rsub-MTL0194_ses-FU12A_T1w.nii
MTL0194 FU24    1318.130566     2015-05-20      1       63.2    1.97    Female  12      1.7236  0       0       low_neg ./sub-MTL0194/ses-FU24B/mri/smwmwp1rsub-MTL0194_ses-FU24B_T1w.nii
MTL0194 FU36    1318.130566     2016-05-27      1       63.2    2.99    Female  12      1.7236  0       0       low_neg ./sub-MTL0194/ses-FU36A/mri/smwmwp1rsub-MTL0194_ses-FU36A_T1w.nii
MTL0194 BL00    1318.130566     2013-05-30      1       63.2    0       Female  12      1.7236  0       0       low_neg ./sub-MTL0194/ses-BL00A/mri/smwmwp1rsub-MTL0194_ses-BL00A_T1w.nii
MTL0107 BL00    1415.302089     2013-01-08      1       64.45   0       Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-BL00A/mri/smwmwp1rsub-MTL0107_ses-BL00A_T1w.nii
MTL0107 FU36    1415.302089     2016-06-23      1       64.45   3.46    Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-FU36A/mri/smwmwp1rsub-MTL0107_ses-FU36A_T1w.nii
MTL0107 FU24    1415.302089     2015-01-09      1       64.45   2       Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-FU24B/mri/smwmwp1rsub-MTL0107_ses-FU24B_T1w.nii
MTL0107 FU120   1415.302089     2022-11-30      2       64.45   9.89    Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-FU120/mri/smwmwp1rsub-MTL0107_ses-FU120_acq-MPRAGE_T1w.nii
MTL0107 FU48    1415.302089     2017-02-17      1       64.45   4.11    Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-FU48B/mri/smwmwp1rsub-MTL0107_ses-FU48B_T1w.nii
MTL0107 FU12    1415.302089     2014-01-07      1       64.45   1       Male    16      1.2274  0       1       high_neg        ./sub-MTL0107/ses-F

A couple of issues may exist with your model specification:

  • Within-individual variable: Is Time_since_BL the only within-individual variable? If so, consider using the following model:

    -model 'Time_since_BL*education_group*ptau_status+Sex+TIV+scanner+(Time_since_BL|Subj)' \  
    
  • Covariate selection: If your primary interest is in group differences in the effect of Time_since_BL, some included variables may not be justifiable. This blog post covers key considerations, and this paper provides a deeper discussion on covariate selection.

  • GLT specification: Update the following GLT codes:

    -gltCode TimeEdu 'Time_since_BL : education_group : 1*0 -1*1' \  
    -gltCode TimePtau 'Time_since_BL : ptau_status : 1*1 -1*0' \  
    -gltCode HighPosNeg 'Time_since_BL : education_group : 1*1 ptau_status : 1*1 -1*0' \  
    -gltCode LowPosNeg 'Time_since_BL : education_group : 1*0 ptau_status : 1*1 -1*0' \  
    -gltCode LowHighNeg 'Time_since_BL : education_group : 1*0 -1*1 ptau_status : 1*0' \  
    -gltCode LowHighPos 'Time_since_BL : education_group : 1*0 -1*1 ptau_status : 1*1' \  
    

    to

    -gltCode TimeEdu 'education_group : 1*0 -1*1 Time_since_BL :' \  
    -gltCode TimePtau 'ptau_status : 1*1 -1*0 Time_since_BL :' \  
    -gltCode HighPosNeg 'education_group : 1*1 ptau_status : 1*1 -1*0 Time_since_BL :' \  
    -gltCode LowPosNeg 'education_group : 1*0 ptau_status : 1*1 -1*0 Time_since_BL :' \  
    -gltCode LowHighNeg 'education_group : 1*0 -1*1 ptau_status : 1*0 Time_since_BL :' \  
    -gltCode LowHighPos 'education_group : 1*0 -1*1 ptau_status : 1*1 Time_since_BL :' \  
    

Gang Chen

Hi Gang, thanks for the quick reply, it's really appreciated!

Within individual variable: yes, Time_since_BL is the only one, I had tried to include it as a random slope but it gives me errors about boundary (singular) fit, which is why i took it out. But I just reran it and I don't get the error anymore so I'll keep monitoring it.

For the GLT specs, it works now!!! You're a lifesaver! I'll look more into the covariates. Is there a reason why Time needs to be the last in my contrast ?

Thanks again

Time_since_BL is the only one, I had tried to include it as a random slope but it gives me errors about boundary (singular) fit

This message is a warning, not an error. Given the large number of voxels in the brain, it is expected that some voxels may experience parameter estimation convergence issues. However, this is generally not a major concern and can be ignored.

Is there a reason why Time needs to be the last in my contrast ?

Only one quantitative variable can be estimated at a time for its slope effect. For programming convenience, the slope effect is always specified as the last component.

Gang Chen