3dttest++ - coding categorical covariates?

Hello!

I’m interested in running an unpaired t-test in 3dttest++ comparing functional connectivity (of amygdala ROI) between 2 groups while controlling for categorical (Site (4 levels), Maternal Education (3 levels)) and continuous (Father’s Age) covariates of no-interest.

Based on this previous post[/url], I have noted that categorical variables with two levels should be coded as 1/-1 (or 0.5/-0.5). From the [url=https://stats.idre.ucla.edu/r/library/r-library-contrast-coding-systems-for-categorical-variables/]link provided in that post, it seems like this is either “simple coding” or “deviation coding” (though the examples show 4 levels). Assuming that I should be using deviation coding, I have coded the categorical covariates numerically (please see below for my covariates file). Is this the correct way to code for categorical variables of no-interest that have more than two levels in 3dttest++? Also, is there a significant difference in the interpretation of the results when coding using 1/-1 versus 0.5/-0.5?

Thank you for your time and kind help!
-Janelle

Covariate File used with 3dttest++:


SubID	Site1	Site2	Site3	MEdu1	MEdu2	FatherAge
sub01	1	0	0	0	1	42.98
sub02	1	0	0	1	0	46.89
sub03	1	0	0	1	0	41.1
sub04	1	0	0	0	1	29.87
sub05	1	0	0	0	1	34.55
sub06	1	0	0	0	1	42.13
sub07	1	0	0	1	0	43.75
sub08	1	0	0	1	0	38.45
sub09	1	0	0	1	0	37.13
sub10	1	0	0	-1	-1	24.96
sub11	0	1	0	0	1	35
sub12	0	1	0	1	0	36.06
sub13	0	1	0	-1	-1	35.31
sub14	0	1	0	-1	-1	48.19
sub15	0	1	0	1	0	41.45
sub16	0	1	0	0	1	27.88
sub17	0	1	0	1	0	35.5
sub18	0	1	0	0	1	33.16
sub19	0	1	0	0	1	30.82
sub20	0	1	0	1	0	36.34
sub21	0	1	0	0	1	32.5
sub22	0	1	0	0	1	40.05
sub23	0	1	0	0	1	34.94
sub24	0	1	0	1	0	39.59
sub25	0	1	0	0	1	37.95
sub26	0	1	0	1	0	31.81
sub27	0	1	0	1	0	31.83
sub28	0	1	0	0	1	42.19
sub29	0	1	0	-1	-1	27.43
sub30	0	1	0	1	0	32.98
sub31	0	1	0	0	1	33.7
sub32	0	0	1	0	1	45.21
sub33	0	0	1	-1	-1	44.63
sub34	0	0	1	-1	-1	39.7
sub35	0	0	1	1	0	31.62
sub36	0	0	1	0	1	48.98
sub37	0	0	1	0	1	34.7
sub38	0	0	1	-1	-1	32.14
sub39	0	0	1	0	1	27.32
sub40	0	0	1	1	0	37.04
sub41	0	0	1	1	0	39.52
sub42	0	0	1	1	0	44.05
sub43	0	0	1	1	0	35.45
sub44	0	0	1	-1	-1	30.1
sub45	0	0	1	1	0	33.77
sub46	0	0	1	-1	-1	34.82
sub47	0	0	1	-1	-1	30.81
sub48	0	0	1	1	0	41.64
sub49	0	0	1	0	1	38.17
sub50	0	0	1	1	0	38.63
sub51	-1	-1	-1	1	0	38.34
sub52	-1	-1	-1	1	0	30.44
sub53	-1	-1	-1	1	0	29.98
sub54	-1	-1	-1	1	0	34.75
sub55	-1	-1	-1	0	1	36.54
sub56	-1	-1	-1	0	1	31.23
sub57	-1	-1	-1	-1	-1	23.98
sub58	-1	-1	-1	0	1	42.16
sub59	-1	-1	-1	1	0	42.99
sub60	-1	-1	-1	-1	-1	31.09
sub61	-1	-1	-1	-1	-1	38.5
sub62	-1	-1	-1	0	1	26.07
sub63	-1	-1	-1	0	1	38.96
sub64	-1	-1	-1	-1	-1	37.21
sub65	-1	-1	-1	-1	-1	41.09
sub66	-1	-1	-1	0	1	38.41
sub67	-1	-1	-1	-1	-1	35
sub68	-1	-1	-1	0	1	38.68
sub69	-1	-1	-1	-1	-1	25.98
sub70	-1	-1	-1	0	1	37.96
sub71	-1	-1	-1	-1	-1	37.5
sub72	-1	-1	-1	1	0	35.89
sub73	-1	-1	-1	1	0	45.88
sub74	-1	-1	-1	-1	-1	33.1
sub75	-1	-1	-1	1	0	31.84
sub76	-1	-1	-1	1	0	33.3
sub77	-1	-1	-1	0	1	46.65
sub78	-1	-1	-1	-1	-1	38.74
sub79	-1	-1	-1	1	0	39.78
sub80	-1	-1	-1	0	1	38.19
sub81	-1	-1	-1	0	1	44.06
sub82	-1	-1	-1	0	1	34.1
sub83	-1	-1	-1	0	1	34.05
sub84	-1	-1	-1	-1	-1	40.07
sub85	-1	-1	-1	0	1	38.31
sub86	-1	-1	-1	-1	-1	37.54
sub87	-1	-1	-1	0	1	41

Is this the correct way to code for categorical variables of no-interest that have more than two levels in 3dttest++?

It looks fine if you assume there are no interactions among all the explanatory variables.

is there a significant difference in the interpretation of the results when coding using 1/-1 versus 0.5/-0.5?

The only difference is: with 1/-1 coding, the variable is associated with half of the group difference (i.e., (A - B) / 2) while with 0.5/-0.5 coding, the variable is associated with the group difference (i.e., A - B).

Thank you!

Janelle

Hi Gang,

I have thought more about my research question and have a few follow-up questions that I hope to get some help on. For context: I have 2 groups (HR: high risk for autism; LR: low risk for autism) with an uneven number of subjects in each group. I’m interested in the difference in amygdala functional connectivity between the groups, as well as how Brain Volume (continuous variable) is associated with connectivity. In total I have 3 covariates of no-interest as I mentioned in my initial message (Site, Maternal Education, Father’s Age), and also 1 covariate of interest (Brain Volume). This leads me to two follow-up questions:

  1. I was reading through the documentation on 3dttest++, which states that “Only the -paired and -pooled options can be used with covariates.” I cannot run a paired t-test (since I have an uneven number of subjects in each group) and I want to avoid the subtraction technique described in the documentation. Would it be better/appropriate to use 3dMVM (since I can incorporate covariates there too)?

  2. Regarding centering for the continuous covariates: Father’s Age is significantly different between the two groups (and I would like to “regress out” the effect of this covariate), but Brain Volume is not significantly different between the two groups (however, I expect the relationship between Brain Volume and amygdala functional connectivity to be different between the two groups; this is a covariate of interest). I have revisited this helpful link, but wanted to check - would it make sense to not demean either variable? Or would it make more sense to demean Brain Volume (since I expect the slopes to be different between the two groups) but not to demean for Father’s Age (since I want to regress out the effect)? I’m a little lost at this point thinking through the potential possibilities! What would you recommend in terms of centering as I know that it strongly impacts the interpretation?

Thank you very much!
Janelle

I cannot run a paired t-test (since I have an uneven number of subjects in each group)

You have two groups, not two conditions; so it’s not a “paired” situation. You should be fine using 3dttest++. However, it would be much easier to set it up in your situation with 3dMVM since you would not have to take care of the dummy coding issue.

Father’s Age is significantly different between the two groups (and I would like to “regress out” the effect of this covariate)

It depends on whether you want to model the interaction between Father’s Age and the Group. If yes, it would make sense to properly center Father’s Age. If no, you don’t have to center this variable.

Brain Volume is not significantly different between the two groups

Similar to the situation with Father’s Age, the impact of centering is on the interpretation of the group difference, not on the covariate effect. Also, it’s better to think about how you would like to interpret the difference between the two groups instead of whether the two groups differ in Brain Volume.

Hi Gang,

Thank you for the suggestion for 3dMVM - after reading through the documentation on 3dMVM, it does seem to be much easier for my situation. I wanted to make sure I understand - is the reason behind why dummy coding is not necessary for 3dMVM because the program can accept explanatory variables that are categorical (i.e., factors) in addition to explanatory variables that are quantitative (based on the Usage described here)?

Seems like this would work since I have 3 between-subject factors (Group with 2 categorical levels; Site with 4 categorical levels; MEdu with 3 categorical levels) and 1 quantitative covariate of no-interest (FatherAge) and 1 quantitative covariate of interest (BrainVolume).

My goal is to run two models - first looking at the main effect of Group, and then looking at the interaction between Group*BrainVolume. I looked through the examples on the 3dMVM documentation, but could not find an example of modeling an interaction between a categorical factor and a quantitative covariate. Would the setup below be correct for 1) modeling main effect of group, and 2) modeling this type of interaction?

  1. Main effect of Group (essentially I want to model FC ~ Group + Site + FatherAge + MEdu, where Site, FatherAge, and MEdu are covariates of no-interest):

3dMVM -prefix PREFIXNAME -jobs 5	\
	-mask MASKNAME	\
	-bsVars "Group+Site+MEdu"	\
	-qVars "FatherAge"	\
	-num_glt 3	\
	-gltLabel 1 HR -gltCode 1 'Group : 1*HR'	\
	-gltLabel 2 LR -gltCode 2 'Group : 1*LR'	\
	-gltLabel 3 HRvLR -gltCode 3 'Group : 1*HR -1*LR'	\
	-dataTable
	SubID	Group	Site	MEdu	FatherAge	InputFile
	sub01	LR	Site1	Level3	42.98	sub01/ROI.nii.gz
	sub02	HR	Site1	Level3	46.89	sub02/ROI.nii.gz
	sub03	LR	Site1	Level3	41.1	sub03/ROI.nii.gz
	sub04	HR	Site1	Level3	29.87	sub04/ROI.nii.gz
	sub05	HR	Site1	Level2	34.55	sub05/ROI.nii.gz
	sub06	LR	Site1	Level2	42.13	sub06/ROI.nii.gz
	sub07	HR	Site1	Level1	43.75	sub07/ROI.nii.gz
	sub08	HR	Site1	Level2	38.45	sub08/ROI.nii.gz
	sub09	HR	Site1	Level3	37.13	sub09/ROI.nii.gz
	sub10	HR	Site1	Level1	24.96	sub10/ROI.nii.gz
	sub11	HR	Site1	Level1	35	sub11/ROI.nii.gz
	sub12	HR	Site1	Level2	36.06	sub12/ROI.nii.gz
	sub13	HR	Site1	Level2	35.31	sub13/ROI.nii.gz
	sub14	HR	Site1	Level1	48.19	sub14/ROI.nii.gz
	sub15	HR	Site1	Level1	41.45	sub15/ROI.nii.gz
	sub16	LR	Site1	Level2	27.88	sub16/ROI.nii.gz
	sub17	HR	Site1	Level1	35.5	sub17/ROI.nii.gz
	sub18	LR	Site1	Level2	33.16	sub18/ROI.nii.gz
	sub19	HR	Site1	Level1	30.82	sub19/ROI.nii.gz
	sub20	LR	Site1	Level2	36.34	sub20/ROI.nii.gz

  1. Interaction between GroupBrainVolume (I want to model [u]FC ~ Group + Site + FatherAge + MEdu + BrainVolume + GroupBrainVolume[/u], where again Site, FatherAge, and MEdu are covariates of no-interest):

3dMVM -prefix PREFIXNAME -jobs 5	\
	-mask MASKNAME	\
	-bsVars "Group+Site+MEdu"	\
	-qVars "FatherAge,BrainVolume"	\
	-num_glt 3	\
	-gltLabel 1 HR_BrainVolume -gltCode 1 'Group : 1*HR BrainVolume'	\
	-gltLabel 2 LR_BrainVolume -gltCode 2 'Group : 1*LR BrainVolume'	\
	-gltLabel 3 Group_by_BrainVolume_interaction -gltCode 3 'Group : 1*HR -1*LR BrainVolume'	\
	-dataTable
	SubID	Group	Site	MEdu	FatherAge	BrainVolume	InputFile
	sub01	LR	Site1	Level3	42.98	22.3	sub01/ROI.nii.gz
	sub02	HR	Site1	Level3	46.89	23.6	sub02/ROI.nii.gz
	sub03	LR	Site1	Level3	41.1	29.0	sub03/ROI.nii.gz
	sub04	HR	Site1	Level3	29.87	31.8	sub04/ROI.nii.gz
	sub05	HR	Site1	Level2	34.55	4.3	sub05/ROI.nii.gz
	sub06	LR	Site1	Level2	42.13	22.3	sub06/ROI.nii.gz
	sub07	HR	Site1	Level1	43.75	22.9	sub07/ROI.nii.gz
	sub08	HR	Site1	Level2	38.45	17.7	sub08/ROI.nii.gz
	sub09	HR	Site1	Level3	37.13	26.0	sub09/ROI.nii.gz
	sub10	HR	Site1	Level1	24.96	15.6	sub10/ROI.nii.gz
	sub11	HR	Site1	Level1	35	14.0	sub11/ROI.nii.gz
	sub12	HR	Site1	Level2	36.06	9.8	sub12/ROI.nii.gz
	sub13	HR	Site1	Level2	35.31	17.0	sub13/ROI.nii.gz
	sub14	HR	Site1	Level1	48.19	15.6	sub14/ROI.nii.gz
	sub15	HR	Site1	Level1	41.45	10.2	sub15/ROI.nii.gz
	sub16	LR	Site1	Level2	27.88	30.8	sub16/ROI.nii.gz
	sub17	HR	Site1	Level1	35.5	20.5	sub17/ROI.nii.gz
	sub18	LR	Site1	Level2	33.16	17.2	sub18/ROI.nii.gz
	sub19	HR	Site1	Level1	30.82	16.0	sub19/ROI.nii.gz
	sub20	LR	Site1	Level2	36.34	11.0	sub20/ROI.nii.gz

Thank you for your kind help!
Janelle

Janelle,

is the reason behind why dummy coding is not necessary for 3dMVM because the program can accept explanatory variables
that are categorical (i.e., factors) in addition to explanatory variables that are quantitative?

The user does not need to dummy code categorical variables because 3dMVM (and other programs such as 3dLME and 3dLMEr) dummy code them internally.

Would the setup below be correct for 1) modeling main effect of group, and 2) modeling this type of interaction?

It would be better to adopt one model for all of your research hypotheses. Try something like

-bsVars “GroupFatherAge+Group BrainVolume+Site+MEdu”
-qVars “FatherAge,BrainVolume” \

Hi Gang,

Thanks for the explanation re: internal dummy coding for 3dMVM - very nifty!

I will try using just one model for all of my hypotheses - but since I am not interested in modeling the interaction between Group and FatherAge (i.e., I just want to regress out the effect of FatherAge as a covariate of no-interest to control for it), would the following be appropriate?

-bsVars “Group* BrainVolume+Site+MEdu+FatherAge”
-qVars “FatherAge,BrainVolume” \

I assume I can look at the main effect of Group since GroupBrainVolume is equivalent to Group+BrainVolume+GroupBrainVolume?

Thanks!
Janelle

Janelle, your model specification looks fine if you don’t believe there is interaction between Group and FatherAge.

Great, thanks Gang!

Hello!

I’m encountering some issues with running 3dMVM where it will read the input files but throw the following error:

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.

Possible reasons:

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

1) Inappropriate model specification with options -bsVars, -wsVars, or -qVars.
Note that within-subject or repeated-measures variables have to be declared
with -wsVars.

2) Incorrect 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 header
would cause grief for 3dMVM.

5) Not enough number of subjects. This may happen when there are two or more
withi-subject factors. For example, a model with two within-subject factors with
m and n levels respectively requires more than (m-1)*(n-1) subjects to be able to
model the two-way interaction with the multivariate approach.

I believe that each of the possible reasons for model test failure are satisfied, so I'm confused as to what could be causing the issue. Any ideas for what might be the cause? 

For reference, this is what my code looks like: 

```

3dMVM -prefix PREFIXNAME -jobs 5	\
	-bsVars "Group+Sex+MEdu"	\
	-num_glt 2	\
	-gltLabel 1 HR -gltCode 1 'Group : 1*HR'	\
	-gltLabel 2 LR -gltCode 2 'Group : 1*LR'	\
	-dataTable	@datatable.txt

```


where datatable.txt is: 

```

Subj	Group	Sex	MEdu	InputFile
sub01	LR	Male	2	sub01/ROI.nii.gz
sub02	HR	Male	4	sub02/ROI.nii.gz
sub03	LR	Male	4	sub03/ROI.nii.gz
sub04	HR	Male	4	sub04/ROI.nii.gz
sub05	HR	Male	3	sub05/ROI.nii.gz
sub06	LR	Male	3	sub06/ROI.nii.gz
sub07	HR	Male	3	sub07/ROI.nii.gz
sub08	HR	Male	4	sub08/ROI.nii.gz
sub09	HR	Male	4	sub09/ROI.nii.gz
sub10	HR	Female	3	sub10/ROI.nii.gz
sub11	HR	Male	4	sub11/ROI.nii.gz
sub12	HR	Male	3	sub12/ROI.nii.gz
sub13	HR	Male	4	sub13/ROI.nii.gz
sub14	HR	Female	2	sub14/ROI.nii.gz
sub15	HR	Male	2	sub15/ROI.nii.gz
sub16	LR	Female	4	sub16/ROI.nii.gz
sub17	HR	Male	2	sub17/ROI.nii.gz
sub18	LR	Female	4	sub18/ROI.nii.gz
sub19	HR	Male	4	sub19/ROI.nii.gz
sub20	LR	Female	4	sub20/ROI.nii.gz
sub21	HR	Female	4	sub21/ROI.nii.gz
sub22	HR	Male	3	sub22/ROI.nii.gz
sub23	HR	Female	2	sub23/ROI.nii.gz
sub24	HR	Female	3	sub24/ROI.nii.gz
sub25	HR	Male	3	sub25/ROI.nii.gz
sub26	HR	Male	4	sub26/ROI.nii.gz
sub27	HR	Male	2	sub27/ROI.nii.gz
sub28	HR	Female	2	sub28/ROI.nii.gz
sub29	HR	Female	3	sub29/ROI.nii.gz
sub30	HR	Female	3	sub30/ROI.nii.gz
sub31	HR	Male	2	sub31/ROI.nii.gz
sub32	HR	Female	3	sub32/ROI.nii.gz
sub33	HR	Male	2	sub33/ROI.nii.gz
sub34	HR	Male	3	sub34/ROI.nii.gz
sub35	HR	Female	3	sub35/ROI.nii.gz
sub36	LR	Female	3	sub36/ROI.nii.gz
sub37	HR	Male	3	sub37/ROI.nii.gz
sub38	HR	Male	4	sub38/ROI.nii.gz
sub39	HR	Male	2	sub39/ROI.nii.gz
sub40	HR	Male	3	sub40/ROI.nii.gz
sub41	LR	Male	4	sub41/ROI.nii.gz
sub42	LR	Male	4	sub42/ROI.nii.gz
sub43	LR	Male	2	sub43/ROI.nii.gz
sub44	HR	Female	4	sub44/ROI.nii.gz
sub45	HR	Female	4	sub45/ROI.nii.gz
sub46	HR	Female	2	sub46/ROI.nii.gz
sub47	HR	Female	3	sub47/ROI.nii.gz
sub48	HR	Female	2	sub48/ROI.nii.gz
sub49	HR	Male	3	sub49/ROI.nii.gz
sub50	HR	Female	2	sub50/ROI.nii.gz
sub51	HR	Male	3	sub51/ROI.nii.gz
sub52	HR	Male	2	sub52/ROI.nii.gz
sub53	HR	Male	2	sub53/ROI.nii.gz
sub54	HR	Male	3	sub54/ROI.nii.gz
sub55	HR	Male	3	sub55/ROI.nii.gz
sub56	HR	Male	2	sub56/ROI.nii.gz
sub57	HR	Male	2	sub57/ROI.nii.gz
sub58	LR	Female	4	sub58/ROI.nii.gz
sub59	LR	Female	3	sub59/ROI.nii.gz
sub60	LR	Male	2	sub60/ROI.nii.gz
sub61	LR	Male	3	sub61/ROI.nii.gz
sub62	LR	Male	3	sub62/ROI.nii.gz
sub63	HR	Male	4	sub63/ROI.nii.gz
sub64	HR	Male	4	sub64/ROI.nii.gz
sub65	HR	Male	4	sub65/ROI.nii.gz
sub66	HR	Male	4	sub66/ROI.nii.gz
sub67	HR	Male	3	sub67/ROI.nii.gz
sub68	LR	Male	4	sub68/ROI.nii.gz
sub69	HR	Male	2	sub69/ROI.nii.gz
sub70	HR	Female	3	sub70/ROI.nii.gz
sub71	LR	Female	4	sub71/ROI.nii.gz
sub72	LR	Female	4	sub72/ROI.nii.gz
sub73	HR	Female	3	sub73/ROI.nii.gz
sub74	HR	Male	4	sub74/ROI.nii.gz
sub75	LR	Male	3	sub75/ROI.nii.gz
sub76	LR	Female	3	sub76/ROI.nii.gz
sub77	LR	Male	3	sub77/ROI.nii.gz
sub78	HR	Female	4	sub78/ROI.nii.gz
sub79	LR	Male	3	sub79/ROI.nii.gz
sub80	LR	Male	3	sub80/ROI.nii.gz
sub81	LR	Male	4	sub81/ROI.nii.gz
sub82	HR	Male	3	sub82/ROI.nii.gz
sub83	HR	Female	4	sub83/ROI.nii.gz
sub84	HR	Male	2	sub84/ROI.nii.gz
sub85	HR	Female	2	sub85/ROI.nii.gz
sub86	LR	Male	4	sub86/ROI.nii.gz
sub87	LR	Male	3	sub87/ROI.nii.gz

```



I also ran afni_system_check.py -check_all to see whether there might be an issue with my version of R (since I had run into that issue in the past), and here is the output of that (and everything seems to look ok?): 

-------------------------------- general ---------------------------------
architecture:         64bit 
system:               Darwin
release:              19.6.0
version:              Darwin Kernel Version 19.6.0: Thu May  6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64
distribution:         10.15.7 x86_64
number of CPUs:       16
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/liuj10/abin/afni
afni version         : Precompiled binary macosx_10.7_local: Aug 28 2018 
                     : AFNI_18.2.15
AFNI_version.txt     : AFNI_18.2.15, macosx_10.7_local, Aug 28 2018
which python         : /usr/bin/python
python version       : 2.7.16
which R              : /usr/local/bin/R
R version            : R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
which tcsh           : /bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/Users/liuj10/abin/afni)
    R       : 1   (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
    python  : 1   (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
    python2 : 1   (/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
    python3 : 2 
      /usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/bin/python3.9
      /usr/bin/python3


testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    uber_subject.py      : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success

checking for R packages...
    rPkgsInstall -pkgs ALL -check : success

checking for $HOME files...
    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
** python module not found: PyQt4
-- PyQt4 is no longer needed for an AFNI bootcamp

-------------------------------- env vars --------------------------------
PATH = /usr/local/ANTs/bin:/Users/liuj10/opt/anaconda2/condabin:/usr/local/fsl/bin:/usr/local/DTIPrepTools-0.1.1-Linux/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/MATLAB_R2019a.app/bin:/opt/X11/bin:/Users/liuj10/abin:/Users/liuj10/abin

PYTHONPATH = 
R_LIBS = 
LD_LIBRARY_PATH = 
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under /Users/liuj10/abin

------------------------------ OS specific -------------------------------
which brew           : /usr/local/bin/brew
brew version         : Homebrew 3.1.12

-- for PyQt4 under brew, consider running:
   brew install cartr/qt4/pyqt
-- consider installing gcc under homebrew
++ found valid link /usr/local/lib/libglib-2.0.dylib
   to ../Cellar/glib/2.68.3/lib/libglib-2.0.dylib
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
   -- found 'libXt' dylib files:
      /opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'bash'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in shell 'tcsh'...
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

=========================  summary, please fix:  =========================
*  login shell 'bash', trusting user to translate from 'tcsh'
*  shell bash: consider sourcing (non-login) .bashrc from (login) .bash_profile
*  insufficient data for AFNI bootcamp

Any ideas as to what could be incorrect in my 3dMVM code or why I'm getting this error? 

Thank you!
Janelle

As an update - I tried testing the model as follows:

  1. Including Group+Sex (taking out MEdu) - This still failed (same error message).
  2. Including Group+MEdu (taking out Sex) - This is working!

I think it might be because when I include Sex and MEdu as additional factors, the contingency tables look like this:
Contingency tables of subject distributions among the categorical variables:

, , MEdu = 2

 Sex

Group Female Male
HR 7 12
LR 0 3

, , MEdu = 3

 Sex

Group Female Male
HR 9 14
LR 3 8

, , MEdu = 4

 Sex

Group Female Male
HR 5 14
LR 6 6

where among subjects who have MEdu=2, there are no female LR subjects. Is there a way to still include Sex as a factor without the program erroring out?

As a side note, I am interested in the main effect of Group and am including Sex and MEdu as covariates of no interest.

Thanks!
Janelle

I was just responding to your previous message while your update came in! Yes, you already found out the problem: when MEdu = 2, there are no Female subjects in the LR group:

          Sex

Group Female Male
HR 7 12
LR 0 3

Is there a way to still include Sex as a factor without the program erroring out?

Unfortunately you cannot have both Sex and MEdu in the same model using 3dMVM, but I’m not sure why the model ‘Group+Sex’ failed. If you want me to dig it deeper, I may have to ask you to share a testing dataset for diagnosis.

On the other hand, try using 3dttest++ with -1/1 coding for Sex ang MEdu, and it may work in this case.