3dlme model test fail

We are trying to run 3dLME but are stopped by a model test error. We suspect “Inappropriate model specification” but do not see why.
Any insights or obvious issues?

Thanks!


3dLME -overwrite -prefix ../ncanda_scripts/ncanda_3dlme_output/3dlme_output_extxagexcor_continuous.nii.gz \
      -mask gm_50mask+tlrc \
      -model 'Ext_t*ageatvisit*correct+reward+meanmotion' \
      -qVars "Ext_t,ageatvisit,meanmotion" \
      -ranEff '~1' \
      -jobs 8 \
      -SS_type 3 \
      -dataTable @datatable_3dlme_resp2018419.txt

where dataTable looks like


Subj   ageat… visit Ext_t Int_t Risk_… Ext_… Int_… meanm… corr… rewa… InputF…
  <fctr>  <dbl> <int> <dbl> <dbl> <fctr> <fct> <fct>  <dbl> <fct> <fct> <fctr>
1 A002    0.110     2  3.87  3.93 no     no    no    0.182  corr… neut… ../A00…
2 A002    0.110     2  3.87  3.93 no     no    no    0.182  corr… rewa… ../A00…
3 A002    0.110     2  3.87  3.93 no     no    no    0.182  erro… neut… ../A00…
4 A002    0.110     2  3.87  3.93 no     no    no    0.182  erro… rewa… ../A00…
5 A004    0.404     2  3.89  3.71 yes    no    no    0.0938 corr… neut… ../A00…
6 A004    0.404     2  3.89  3.71 yes    no    no    0.0938 corr… rewa… ../A00…

Ultimately we have 194 InputFiles repeated 4 times for each cat. vars reward and correct


read.table("datatable_3dlme_resp2018419.txt",header=T) %>% group_by(reward,correct) %>% summarise(n=length(InputFile)) %>% filter(n!=1)
  reward  correct           n
  <fctr>  <fctr>        <int>
1 neutral correct         194
2 neutral error_correct   194
3 reward  correct         194
4 reward  error_correct   194

3dLME’s model test fails:



***** End of data structure information *****
++++++++++++++++++++++++++++++++++++++++++++++++++++

Reading input files now...

Reading input files: Done!

If the program hangs here for more than, for example, half an hour,
kill the process because the model specification or the GLT coding
is likely inappropriate.

~~~~~~~~~~~~~~~~~~~ Model test failed  ~~~~~~~~~~~~~~~~~~~
Possible reasons:

0) Make sure that R packages nlme and phia have been installed. See the 3dLME
help documentation for more details.

1) Inappropriate model specification with options -model, or -qVars.

2) In correct specifications in general linear test coding with -gltCode.

3) Mistakes in data table. Check the data structure shown above, and verify
whether there are any inconsistencies.

4) Inconsistent variable names which are case sensitive. For example, factor
named Group in model specification and then listed as group in the table hader
would cause grief for 3dLME.

** Error:
   Quitting due to model test failure...

What kind of variables are Ext_t, ageatvisit, correct, reward, and meanmotion? Categorical or quantitative? Between- or within-subject?

Hi Gang! Thanks for the quick response.

ageatvisit, ext_t, meanmotion are all quantitative (qvars) between subjects variables
reward, correct are categorical within subjects variables

We are trying to use 3dlme because we want to eventually include “visit”. This is a sequential cohort /accelerated longitudinal design and there are high missing values for certain visits

Thanks!

With your current model specification:

-model ‘Ext_tageatvisitcorrect+reward+meanmotion’ \

do you really want the interaction between Ext_t and ageatvisit? Such an interaction can be modeled, but it would be a little tricky to set it up. I would start with a simpler model:

-model ‘correct*reward+Ext_t+ageatvisit+meanmotion’ \

Unless you have missing data, it would be better to use 3dMVM by replacing

3dLME -overwrite -prefix …/ncanda_scripts/ncanda_3dlme_output/3dlme_output_extxagexcor_continuous.nii.gz
-mask gm_50mask+tlrc
-model ‘Ext_tageatvisitcorrect+reward+meanmotion’
-qVars “Ext_t,ageatvisit,meanmotion”
-ranEff ‘~1’
-jobs 8
-SS_type 3 \

with

3dMVM -overwrite -prefix …/ncanda_scripts/ncanda_3dlme_output/3dlme_output_extxagexcor_continuous.nii.gz
-mask gm_50mask+tlrc
-bwVars ‘Ext_t+ageatvisit+meanmotion’
-wsVars ‘correct*reward’
-qVars “Ext_t,ageatvisit,meanmotion”
-jobs 8 \

Also, do those three quantitative variables (ageatvisit, ext_t, meanmotion) differ substantially across the levels of those two within-subject factors?

Thanks for the feedback!

To debug, we collapsed correct by contrasting the two values (errorCorrect-correct): ‘Ext_t*ageatvisit+reward+meanmotion’ as well as trying the suggested ‘reward+Ext_t+ageatvisit+meanmotion’ with MVM .
But both still fail the model test.

The datatable is on pastebin, if that is useful.

Ultimately we would like to model with missing values. Not all subjects came back for every visit. (50 for visit 3, 142 for 2, 168 for visit 1).

Here is our 3dMVM call without visit and with the input file as the difference score (contrast errorcorrect - correct for each reward type)


3dMVM -overwrite -prefix ../ncanda_scripts/ncanda_3dmvm_outputs/3dmvm_output_extxagexcor_continuous.nii.gz \
      -mask gm_50mask+tlrc \
      -model 'Ext_t+ageatvisit+reward+meanmotion' \
      -qVars "Ext_t,ageatvisit,meanmotion" \
      -ranEff '~1' \
      -jobs 8 \
      -SS_type 3 \
      -dataTable @datatable_3dlme_resp_diffscore2018524.txt

And it failed the model test:

Warning messages:
1: In process.MVM.opts(lop, verb = lop$verb) : NAs introduced by coercion
2: In process.MVM.opts(lop, verb = lop$verb) : NAs introduced by coercion

Possible reasons:
....
** Error:
   Quitting due to model test failure...

If you want to use 3dMVM, try

3dMVM -overwrite -prefix …/ncanda_scripts/ncanda_3dmvm_outputs/3dmvm_output_extxagexcor_continuous.nii.gz
-mask gm_50mask+tlrc
bsVars ‘Ext_t+ageatvisit+meanmotion’
wsVars ‘reward’
-qVars “Ext_t,ageatvisit,meanmotion”
-jobs 8
-dataTable @datatable_3dlme_resp_diffscore2018524.txt

For 3dLME, use

3dLME -overwrite -prefix …/ncanda_scripts/ncanda_3dmvm_outputs/3dmvm_output_extxagexcor_continuous.nii.gz
-mask gm_50mask+tlrc
-model ‘Ext_treward+ageatvisitreward+meanmotion*reward’
-qVars “Ext_t,ageatvisit,meanmotion”
-ranEff ‘~1’
-jobs 8
-SS_type 3
-dataTable @datatable_3dlme_resp_diffscore2018524.txt