AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
May 05, 2020 12:45AM
I'm running a model through 3dLMEr that includes 33 gltCodes and 6 glfCodes. This is a repeated measures design with 3 study groups and 3 measurement time points from each subject. The random effect structure has subject nested within site. I'm copying in the script that runs 3dLMEr below in case it's helpful.

The output seems reasonable, except that a few of the sub-bricks which would be expected to be z-scores (and appear to contain z-scores), are labelled as "statcode = fict; statpar = 2", as if they contain Chi-squared statistic values. This causes 3dClusterize to complain when I request -bisided statistics. I'm copying in the output of `3dinfo -subbrick_info` -- you can see the effect at sub-bricks #40 to #45, after which the sub-bricks go back to normal with appropriate labels for z-scores.

I'd appreciate any advice if you have an idea of why this might have happened. Do you think it is safe to fix the sub-bricks using e.g. `3drefit -'type'`?

Thanks,
Andrew

------------------------------------------
3dinfo -subbrick_info ...
------------------------------------------

-- At sub-brick #0 'TriGroup Chi-sq' datum type is float: 0 to 22.376
statcode = fict; statpar = 2
-- At sub-brick #1 'Visit Chi-sq' datum type is float: 0 to 35.7107
statcode = fict; statpar = 2
-- At sub-brick #2 'Age Chi-sq' datum type is float: 0 to 33.1694
statcode = fict; statpar = 2
-- At sub-brick #3 'Sex Chi-sq' datum type is float: 0 to 23.9372
statcode = fict; statpar = 2
-- At sub-brick #4 'Order Chi-sq' datum type is float: 0 to 23.6985
statcode = fict; statpar = 2
-- At sub-brick #5 'Motion Chi-sq' datum type is float: 0 to 29.8778
statcode = fict; statpar = 2
-- At sub-brick #6 'TriGroup:Visit Chi-sq' datum type is float: 0 to 19.8144
statcode = fict; statpar = 2
-- At sub-brick #7 'Resp-HC' datum type is float: -57.9204 to 47.5054
-- At sub-brick #8 'Resp-HC Z' datum type is float: -4.94335 to 3.2917
statcode = fizt
-- At sub-brick #9 'NonR-HC' datum type is float: -50.5609 to 54.1309
-- At sub-brick #10 'NonR-HC Z' datum type is float: -4.60852 to 4.224
statcode = fizt
-- At sub-brick #11 'NonR-Resp' datum type is float: -63.7495 to 62.4265
-- At sub-brick #12 'NonR-Resp Z' datum type is float: -4.12196 to 3.96195
statcode = fizt
-- At sub-brick #13 'BL_Resp-HC' datum type is float: -77.6713 to 63.9585
-- At sub-brick #14 'BL_Resp-HC Z' datum type is float: -5.37706 to 3.65976
statcode = fizt
-- At sub-brick #15 'BL_NonR-HC' datum type is float: -59.1157 to 62.5297
-- At sub-brick #16 'BL_NonR-HC Z' datum type is float: -4.59087 to 3.68859
statcode = fizt
-- At sub-brick #17 'BL_NonR-Resp' datum type is float: -82.9251 to 69.6564
-- At sub-brick #18 'BL_NonR-Resp Z' datum type is float: -4.19449 to 4.15532
statcode = fizt
-- At sub-brick #19 'Wk2_Resp-HC' datum type is float: -72.1301 to 54.086
-- At sub-brick #20 'Wk2_Resp-HC Z' datum type is float: -3.91597 to 3.33909
statcode = fizt
-- At sub-brick #21 'Wk2_NonR-HC' datum type is float: -61.8337 to 75.7904
-- At sub-brick #22 'Wk2_NonR-HC Z' datum type is float: -4.54073 to 3.29756
statcode = fizt
-- At sub-brick #23 'Wk2_NonR-Resp' datum type is float: -62.2724 to 77.1769
-- At sub-brick #24 'Wk2_NonR-Resp Z' datum type is float: -4.23456 to 3.90993
statcode = fizt
-- At sub-brick #25 'Wk8_Resp-HC' datum type is float: -73.5396 to 56.9227
-- At sub-brick #26 'Wk8_Resp-HC Z' datum type is float: -4.84425 to 4.29163
statcode = fizt
-- At sub-brick #27 'Wk8_NonR-HC' datum type is float: -68.7032 to 57.3075
-- At sub-brick #28 'Wk8_NonR-HC Z' datum type is float: -4.64745 to 4.06252
statcode = fizt
-- At sub-brick #29 'Wk8_NonR-Resp' datum type is float: -71.5177 to 66.3275
-- At sub-brick #30 'Wk8_NonR-Resp Z' datum type is float: -3.81272 to 3.77455
statcode = fizt
-- At sub-brick #31 'Wk2-BL' datum type is float: -30.9227 to 33.6492
-- At sub-brick #32 'Wk2-BL Z' datum type is float: -4.26236 to 4.94511
statcode = fizt
-- At sub-brick #33 'Wk8-BL' datum type is float: -29.8581 to 44.7639
-- At sub-brick #34 'Wk8-BL Z' datum type is float: -4.75152 to 6.0248
statcode = fizt
-- At sub-brick #35 'Wk8-Wk2' datum type is float: -26.2056 to 33.452
-- At sub-brick #36 'Wk8-Wk2 Z' datum type is float: -4.11878 to 4.94703
statcode = fizt
-- At sub-brick #37 'Resp_Wk2-BL' datum type is float: -44.6373 to 52.9728
-- At sub-brick #38 'Resp_Wk2-BL Z' datum type is float: -4.15298 to 4.11559
statcode = fizt
-- At sub-brick #39 'Resp_Wk8-BL' datum type is float: -40.2106 to 74.905
-- At sub-brick #40 'Resp_Wk8-BL Z' datum type is float: -3.82156 to 4.68501
statcode = fict; statpar = 2
-- At sub-brick #41 'Resp_Wk8-Wk2' datum type is float: -40.1381 to 57.0861
statcode = fict; statpar = 2
-- At sub-brick #42 'Resp_Wk8-Wk2 Z' datum type is float: -4.04636 to 4.61365
statcode = fict; statpar = 2
-- At sub-brick #43 'NonR_Wk2-BL' datum type is float: -54.745 to 65.3943
statcode = fict; statpar = 2
-- At sub-brick #44 'NonR_Wk2-BL Z' datum type is float: -4.59059 to 4.39628
statcode = fict; statpar = 2
-- At sub-brick #45 'NonR_Wk8-BL' datum type is float: -50.0781 to 57.8212
statcode = fict; statpar = 2
-- At sub-brick #46 'NonR_Wk8-BL Z' datum type is float: -4.03856 to 4.83987
statcode = fizt
-- At sub-brick #47 'NonR_Wk8-Wk2' datum type is float: -64.3433 to 61.7807
-- At sub-brick #48 'NonR_Wk8-Wk2 Z' datum type is float: -4.23796 to 4.26949
statcode = fizt
-- At sub-brick #49 'HC_Wk2-BL' datum type is float: -42.4743 to 41.3635
-- At sub-brick #50 'HC_Wk2-BL Z' datum type is float: -3.80611 to 4.32167
statcode = fizt
-- At sub-brick #51 'HC_Wk8-BL' datum type is float: -47.1151 to 53.4157
-- At sub-brick #52 'HC_Wk8-BL Z' datum type is float: -3.74541 to 4.28842
statcode = fizt
-- At sub-brick #53 'HC_Wk8-Wk2' datum type is float: -39.9265 to 48.9201
-- At sub-brick #54 'HC_Wk8-Wk2 Z' datum type is float: -3.56217 to 4.11194
statcode = fizt
-- At sub-brick #55 'Resp-HC_Wk2-BL' datum type is float: -61.6819 to 68.1134
-- At sub-brick #56 'Resp-HC_Wk2-BL Z' datum type is float: -3.61899 to 4.30117
statcode = fizt
-- At sub-brick #57 'NonR-HC_Wk2-BL' datum type is float: -74.3821 to 89.9132
-- At sub-brick #58 'NonR-HC_Wk2-BL Z' datum type is float: -4.09685 to 3.88493
statcode = fizt
-- At sub-brick #59 'NonR-Resp_Wk2-BL' datum type is float: -68.7695 to 62.998
-- At sub-brick #60 'NonR-Resp_Wk2-BL Z' datum type is float: -4.26472 to 4.07678
statcode = fizt
-- At sub-brick #61 'Resp-HC_Wk8-BL' datum type is float: -59.8906 to 72.5968
-- At sub-brick #62 'Resp-HC_Wk8-BL Z' datum type is float: -4.02826 to 4.21195
statcode = fizt
-- At sub-brick #63 'NonR-HC_Wk8-BL' datum type is float: -66.7535 to 69.4187
-- At sub-brick #64 'NonR-HC_Wk8-BL Z' datum type is float: -3.95447 to 3.80808
statcode = fizt
-- At sub-brick #65 'NonR-Resp_Wk8-BL' datum type is float: -83.3811 to 52.1631
-- At sub-brick #66 'NonR-Resp_Wk8-BL Z' datum type is float: -3.99679 to 3.82005
statcode = fizt
-- At sub-brick #67 'Resp-HC_Wk8-Wk2' datum type is float: -59.5091 to 65.32
-- At sub-brick #68 'Resp-HC_Wk8-Wk2 Z' datum type is float: -3.73434 to 3.38833
statcode = fizt
-- At sub-brick #69 'NonR-HC_Wk8-Wk2' datum type is float: -89.7458 to 67.0074
-- At sub-brick #70 'NonR-HC_Wk8-Wk2 Z' datum type is float: -4.00369 to 4.50605
statcode = fizt
-- At sub-brick #71 'NonR-Resp_Wk8-Wk2' datum type is float: -88.5912 to 64.5123
-- At sub-brick #72 'NonR-Resp_Wk8-Wk2 Z' datum type is float: -4.2246 to 4.60519
statcode = fizt
-- At sub-brick #73 'BL_TriGroup Chi-sq' datum type is float: 0 to 29.1038
-- At sub-brick #74 'Wk2_TriGroup Chi-sq' datum type is float: 0 to 20.9274
-- At sub-brick #75 'Wk8_TriGroup Chi-sq' datum type is float: 0 to 23.6811
-- At sub-brick #76 'Resp_Visit Chi-sq' datum type is float: 0 to 24.7257
-- At sub-brick #77 'NonR_Visit Chi-sq' datum type is float: 0 to 25.7557
-- At sub-brick #78 'HC_Visit Chi-sq' datum type is float: 0 to 23.2467


------------------------------------------
LME_3g_longitud_full.cmd
------------------------------------------

#!/usr/bin/env bash

# v0.2 (May 2020) by Andrew Davis

# Runs a linear mixed model (LMM) on CAN-BIND repeated measures Go/NoGo fMRI data
# See GoNoGo fMRI Analysis Notes for details

# CPUs/Threads to use
njobs=4

# analysis i/o vars
des_file=LME_3g_longitud_design_table.csv
out_pref=LME_3g_longitud_full_results

# set up Compute Canada environment if we're running there
if [[ -n $SLURM_ACCOUNT ]]; then
echo "Loading CC modules for AFNI"
module purge
module load gcc/5.4.0 nixpkgs/16.09 gcc/7.3.0 r/3.6.0 afni/20190312
fi

# robustness
set -o nounset
set -o errexit
set -o pipefail

# verbosity
set -x

# run LMM
3dLMEr -prefix "$out_pref" \
-jobs $njobs -mask mask.nii.gz \
-model '1+TriGroup*Visit+(1|Site/Subj)+Age+Sex+Order+Motion' \
-qVars 'Age,Motion' \
-qVarCenters '34.774358974359,0.0543358456358456' \
-gltCode Resp-HC 'TriGroup : 1*Resp -1*HC' \
-gltCode NonR-HC 'TriGroup : 1*NonR -1*HC' \
-gltCode NonR-Resp 'TriGroup : 1*NonR -1*Resp' \
-gltCode BL_Resp-HC 'TriGroup : 1*Resp -1*HC Visit : 1*BL' \
-gltCode BL_NonR-HC 'TriGroup : 1*NonR -1*HC Visit : 1*BL' \
-gltCode BL_NonR-Resp 'TriGroup : 1*NonR -1*Resp Visit : 1*BL' \
-gltCode Wk2_Resp-HC 'TriGroup : 1*Resp -1*HC Visit : 1*Wk2' \
-gltCode Wk2_NonR-HC 'TriGroup : 1*NonR -1*HC Visit : 1*Wk2' \
-gltCode Wk2_NonR-Resp 'TriGroup : 1*NonR -1*Resp Visit : 1*Wk2' \
-gltCode Wk8_Resp-HC 'TriGroup : 1*Resp -1*HC Visit : 1*Wk8' \
-gltCode Wk8_NonR-HC 'TriGroup : 1*NonR -1*HC Visit : 1*Wk8' \
-gltCode Wk8_NonR-Resp 'TriGroup : 1*NonR -1*Resp Visit : 1*Wk8' \
-gltCode Wk2-BL 'Visit : 1*Wk2 -1*BL' \
-gltCode Wk8-BL 'Visit : 1*Wk8 -1*BL' \
-gltCode Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2' \
-gltCode Resp_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*Resp' \
-gltCode Resp_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*Resp' \
-gltCode Resp_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*Resp' \
-gltCode NonR_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*NonR' \
-gltCode NonR_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*NonR' \
-gltCode NonR_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*NonR' \
-gltCode HC_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*HC' \
-gltCode HC_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*HC' \
-gltCode HC_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*HC' \
-gltCode Resp-HC_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*Resp -1*HC' \
-gltCode NonR-HC_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*NonR -1*HC' \
-gltCode NonR-Resp_Wk2-BL 'Visit : 1*Wk2 -1*BL TriGroup : 1*NonR -1*Resp' \
-gltCode Resp-HC_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*Resp -1*HC' \
-gltCode NonR-HC_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*NonR -1*HC' \
-gltCode NonR-Resp_Wk8-BL 'Visit : 1*Wk8 -1*BL TriGroup : 1*NonR -1*Resp' \
-gltCode Resp-HC_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*Resp -1*HC' \
-gltCode NonR-HC_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*NonR -1*HC' \
-gltCode NonR-Resp_Wk8-Wk2 'Visit : 1*Wk8 -1*Wk2 TriGroup : 1*NonR -1*Resp' \
-glfCode BL_TriGroup 'TriGroup : 1*Resp -1*HC & 1*NonR -1*HC Visit : 1*BL' \
-glfCode Wk2_TriGroup 'TriGroup : 1*Resp -1*HC & 1*NonR -1*HC Visit : 1*Wk2' \
-glfCode Wk8_TriGroup 'TriGroup : 1*Resp -1*HC & 1*NonR -1*HC Visit : 1*Wk8' \
-glfCode Resp_Visit 'Visit : 1*Wk2 -1*BL & 1*Wk8 -1*BL TriGroup : 1*Resp' \
-glfCode NonR_Visit 'Visit : 1*Wk2 -1*BL & 1*Wk8 -1*BL TriGroup : 1*NonR' \
-glfCode HC_Visit 'Visit : 1*Wk2 -1*BL & 1*Wk8 -1*BL TriGroup : 1*HC' \
-dataTable @"$des_file"

# Write out results as float, not short int; this saves annoyances with 3dClusterize later
3dcalc -t "${out_pref}+tlrc" \
-expr 't' \
-prefix "${out_pref}+tlrc" \
-datum float -overwrite

# gzip to save space
gzip "${out_pref}+tlrc.BRIK"
Subject Author Posted

3dLMEr output sub-bricks with wrong statcode

Andrew Davis May 05, 2020 12:45AM

Re: 3dLMEr output sub-bricks with wrong statcode

gang May 05, 2020 01:11PM

Re: 3dLMEr output sub-bricks with wrong statcode

Andrew Davis May 05, 2020 02:57PM