[picchionid@cn0002 ~]$ afni -ver
Precompiled binary linux_rocky_8: Oct 31 2024 (Version AFNI_24.3.06 'Elagabalus')
[picchionid@cn0002 ~]$ R --version
R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Gang,
Hi! How are you? Happy holidays!
I have exciting news. Our sleep manuscript is almost ready for resubmission. Let me please ask you some questions about categorical variables/factors in 3dLMEr for the analyses contained therein. You have already reviewed them as a coauthor, but let me ask some questions anyway. I compared 3dLMEr results using a factor to a separate 3dLMEr using a quantitative variable. Here
3dLMEr \
-prefix output_lme_comsst_${region}${regsiz}_${prepro}_${statin}.nii \
-jobs 32 \
-model "1+SStage+(1+SStage|Subj)" \
-R2 \
-SS_type 3 \
-dataTable \
Subj Cond AAT SStage InputFile \
s00003 aro1 70 n3 20160713_2255_hip_procbasic_rz.nii.nii
s00003 aro2 25 n2 20160713_2326_hip_procbasic_rz.nii.nii
s00003 aro3 35 n2 20160714_0004_hip_procbasic_rz.nii.nii
...
s00105 aro5 0 r 20170413_0535_hip_procbasic_rz.nii.nii
is the code for the factor, and here
3dLMEr \
-prefix output_lme_audaro_${region}${regsiz}_${prepro}_${statin}_nocondinmodel.nii \
-jobs 32 \
-model "1+AAT+(1+AAT|Subj)" \
-qVars 'AAT' \
-R2 \
-SS_type 3 \
-gltCode AATeff 'AAT : ' \
-dataTable \
Subj Cond AAT SStage InputFile \
s00003 aro1 70 n3 20160713_2255_hip_procbasic_rz.nii.nii
s00003 aro2 25 n2 20160713_2326_hip_procbasic_rz.nii.nii
s00003 aro3 35 n2 20160714_0004_hip_procbasic_rz.nii.nii
...
s00105 aro5 0 r 20170413_0535_hip_procbasic_rz.nii.nii
is the code for the quantitative variable. Everything works great. My questions are about comparing these two results.
I was careful to make the comparison fair. Both use identical input data. In both cases, I compared the Chi-sq sub-brick (#0). However, I have a nagging concern about a small potential difference in the sensitivity/statistical power (1 - beta) of these two analyses. How did you program AFNI/R to calculate the resulting singular chi-square for the factor of sleep stage (SStage)? In my multiple regression experience, factors must be transformed into k-1 dummy-coded variables before being entered into the model, and you get k-1 statistical tests for those levels versus the chosen reference level. If you want to know the variance explained by the original factor as a whole, you need to use R^2 and the associated F for the whole model, including all the dummy-coded variables. Is the dummy coding done in a way that is transparent to the user? Do I understand correctly that the resulting singular chi-square from the above code can be interpreted as analogous to a main effect or a model R^2 with the associated F? If yes, how is that done? If no, what does it represent, and how was it calculated?
Because the analysis with one quantitative variable is being compared to an analysis with four dummy-coded variables (5 sleep stages - 1), does the analysis with one quantitative variable have an unfair advantage because it has greater statistical power derived from fewer variables in the model? If yes, could I make the comparison fair by decreasing the alpha in the analysis with one quantitative variable?
I read the 3dLMEr help file with the following text but would still appreciate your input. "Main effects, interactions and the composite effects (automatically generated by 3dLMEr) are represented in the output as chi-square with 2 degrees of freedom. The fixed number of DFs (i.e., 2) for the chi-square statistic, regardless of the specific situation, is adopted for convenience because of the varying DFs due to the Satterthwaite approximation" (AFNI program: 3dLMEr).
Sincerely,
Dante