Aaron and I met with Avi to talk about the issues we were having with multiple comparisons. He suggested that Aaron re-process the data using 8 larger regions instead of 41 smaller regions. Avi gave guidance regarding brain region selection, and then I applied a Manova and Anova to look for differences in brain response on Day 2 vs. Day 1 for the control population. After looking at the control population, I apply a very similar approach to looking for differences between the diabetic population and the control population on Day 1.

I performed a manova and anova to look for significant areas of response. We see that there is a significant difference between Day 1 and Day 2 response for ALL regions, and that the thalamus responds to the changing glucose level. Bonferroni says we should look for p < 0.00625. I controlled for repeated measures for individuals by including patient ID as a random effect.

dependent.vars<-as.matrix(df_practice[,5:13])
summary(manova(dependent.vars~df_practice$Glucose.level*df_practice$Day)) 
##                                           Df  Pillai approx F num Df
## df_practice$Glucose.level                  1 0.40584   5.3884      9
## df_practice$Day                            1 0.38473   4.9329      9
## df_practice$Glucose.level:df_practice$Day  1 0.10544   0.9298      9
## Residuals                                 79                        
##                                           den Df    Pr(>F)    
## df_practice$Glucose.level                     71 1.314e-05 ***
## df_practice$Day                               71 3.815e-05 ***
## df_practice$Glucose.level:df_practice$Day     71     0.505    
## Residuals                                                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod2<-aov(dependent.vars~Glucose.level*Day, data = df_practice) #no repeated measures effect accounted for
mod1<-aov(dependent.vars~Glucose.level*Day + Error(X), data = df_practice) #accounting for repeated measures in participants with Error term
summary(mod1)
## 
## Error: X
##  Response Frontal :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1  515.1  515.08  0.4514 0.5206
## Day                1 1104.0 1104.04  0.9676 0.3541
## Glucose.level:Day  1   71.1   71.13  0.0623 0.8091
## Residuals          8 9127.8 1140.98               
## 
##  Response OrbitalFrontal :
##                   Df  Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1    44.9   44.88  0.0351 0.8560
## Day                1   390.8  390.84  0.3057 0.5954
## Glucose.level:Day  1   176.3  176.29  0.1379 0.7200
## Residuals          8 10227.8 1278.48               
## 
##  Response Motor :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1  710.6  710.59  0.6000 0.4609
## Day                1  457.7  457.71  0.3864 0.5515
## Glucose.level:Day  1    1.9    1.91  0.0016 0.9690
## Residuals          8 9475.2 1184.40               
## 
##  Response Parietal :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1  353.2  353.22  0.3398 0.5760
## Day                1  815.3  815.27  0.7842 0.4017
## Glucose.level:Day  1  123.1  123.06  0.1184 0.7397
## Residuals          8 8316.7 1039.58               
## 
##  Response Temporal :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1  711.9  711.86  0.9410 0.3604
## Day                1  581.8  581.81  0.7691 0.4061
## Glucose.level:Day  1    4.6    4.61  0.0061 0.9397
## Residuals          8 6051.8  756.48               
## 
##  Response Occipital :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1 1567.9 1567.92  1.3269 0.2826
## Day                1  750.1  750.10  0.6348 0.4486
## Glucose.level:Day  1   12.3   12.28  0.0104 0.9213
## Residuals          8 9453.3 1181.66               
## 
##  Response BasalGanglia :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1   29.5   29.45  0.0345 0.8573
## Day                1  661.7  661.68  0.7749 0.4044
## Glucose.level:Day  1  226.4  226.37  0.2651 0.6205
## Residuals          8 6830.8  853.86               
## 
##  Response Thalamus :
##                   Df  Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1    48.3   48.30  0.0274 0.8726
## Day                1  1489.6 1489.59  0.8448 0.3849
## Glucose.level:Day  1    45.3   45.35  0.0257 0.8766
## Residuals          8 14105.5 1763.19               
## 
##  Response InsulaAndAmygdala :
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1 1899.1 1899.05  3.3900 0.1029
## Day                1  154.7  154.69  0.2761 0.6135
## Glucose.level:Day  1    7.9    7.88  0.0141 0.9085
## Residuals          8 4481.6  560.20               
## 
## 
## Error: Within
##  Response Frontal :
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1  166.43  166.43  5.2059   0.02565 *  
## Day                1 2533.83 2533.83 79.2554 5.062e-13 ***
## Glucose.level:Day  1    4.09    4.09  0.1278   0.72181    
## Residuals         68 2173.99   31.97                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response OrbitalFrontal :
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1  118.90  118.90  3.8667   0.05334 .  
## Day                1 1997.45 1997.45 64.9568 1.708e-11 ***
## Glucose.level:Day  1    0.28    0.28  0.0092   0.92404    
## Residuals         68 2091.02   30.75                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Motor :
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1    3.48    3.48  0.1024    0.7500    
## Day                1 2776.98 2776.98 81.8007 2.807e-13 ***
## Glucose.level:Day  1    0.16    0.16  0.0047    0.9456    
## Residuals         68 2308.47   33.95                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Parietal :
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1    0.3     0.3  0.0078   0.93001    
## Day                1 3504.5  3504.5 94.1295 1.853e-14 ***
## Glucose.level:Day  1  128.8   128.8  3.4584   0.06726 .  
## Residuals         68 2531.7    37.2                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Temporal :
##                   Df  Sum Sq Mean Sq F value   Pr(>F)    
## Glucose.level      1   41.58   41.58  1.4907   0.2263    
## Day                1 1723.70 1723.70 61.7945 3.92e-11 ***
## Glucose.level:Day  1    7.09    7.09  0.2542   0.6158    
## Residuals         68 1896.80   27.89                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Occipital :
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1   38.3   38.29  0.7676    0.3840    
## Day                1 2664.3 2664.30 53.4148 3.934e-10 ***
## Glucose.level:Day  1    0.7    0.65  0.0130    0.9094    
## Residuals         68 3391.8   49.88                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response BasalGanglia :
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1  680.14  680.14 26.7162 2.245e-06 ***
## Day                1 1306.79 1306.79 51.3313 7.162e-10 ***
## Glucose.level:Day  1    1.43    1.43  0.0563    0.8132    
## Residuals         68 1731.14   25.46                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Thalamus :
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1 3059.3 3059.34 33.1284 2.260e-07 ***
## Day                1 2694.4 2694.37 29.1763 9.124e-07 ***
## Glucose.level:Day  1    4.6    4.56  0.0493    0.8249    
## Residuals         68 6279.7   92.35                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response InsulaAndAmygdala :
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level      1   21.0   20.99  0.3879    0.5355    
## Day                1 1205.3 1205.31 22.2720 1.222e-05 ***
## Glucose.level:Day  1    2.2    2.16  0.0399    0.8423    
## Residuals         68 3680.0   54.12                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

I know John was concerned about the appropriateness of a normality assumption, so here is the Q-Q plot. It’s not perfect (particularly in the upper righthand corner), but I think it’s probably ok.

Just to be safe, I also applied a permutation test. The results come out basically the same.

library(lmPerm)
mod2<-aovp(dependent.vars~df_practice$Glucose.level*df_practice$Day, perm = "Prob") #bonferroni threshold is <0.00625
## [1] "Settings:  unique SS : numeric variables centered"
summary(mod2)
##  Response Frontal :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1    136.5     136.5   66
## df_practice$Day                            1   3508.8    3508.8 5000
## df_practice$Glucose.level:df_practice$Day  1      2.6       2.6   51
## Residuals                                 79  12053.0     152.6     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.6061    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.8431    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response OrbitalFrontal :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1    112.7    112.70  252
## df_practice$Day                            1   2385.1   2385.09 5000
## df_practice$Glucose.level:df_practice$Day  1      0.1      0.09   51
## Residuals                                 79  12552.5    158.89     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.2857    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   1.0000    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Motor :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1      0.2       0.2   51
## df_practice$Day                            1   3426.0    3426.0 5000
## df_practice$Glucose.level:df_practice$Day  1      0.0       0.0   51
## Residuals                                 79  12308.4     155.8     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.9804    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.9804    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Parietal :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1      1.9       1.9   51
## df_practice$Day                            1   4365.7    4365.7 5000
## df_practice$Glucose.level:df_practice$Day  1    113.1     113.1  224
## Residuals                                 79  11292.5     142.9     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   1.0000    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.3125    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Temporal :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1     62.3     62.29  120
## df_practice$Day                            1   2354.5   2354.49 5000
## df_practice$Glucose.level:df_practice$Day  1      6.4      6.38   51
## Residuals                                 79   8593.6    108.78     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.4583    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.8235    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Occipital :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1     70.8      70.8  137
## df_practice$Day                            1   3617.6    3617.6 5000
## df_practice$Glucose.level:df_practice$Day  1      0.4       0.4   51
## Residuals                                 79  14186.9     179.6     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.4234    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.9804    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response BasalGanglia :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1    667.0    667.04 4005
## df_practice$Day                            1   1784.8   1784.78 5000
## df_practice$Glucose.level:df_practice$Day  1      0.2      0.15   51
## Residuals                                 79   9022.4    114.21     
##                                           Pr(Prob)    
## df_practice$Glucose.level                  0.02447 *  
## df_practice$Day                            < 2e-16 ***
## df_practice$Glucose.level:df_practice$Day  1.00000    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Thalamus :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1   3019.5    3019.5 5000
## df_practice$Day                            1   3737.4    3737.4 5000
## df_practice$Glucose.level:df_practice$Day  1      1.7       1.7   51
## Residuals                                 79  20986.0     265.6     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   <2e-16 ***
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day        1    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response InsulaAndAmygdala :
##                                           Df R Sum Sq R Mean Sq Iter
## df_practice$Glucose.level                  1     50.4     50.35   81
## df_practice$Day                            1   1615.8   1615.81 5000
## df_practice$Glucose.level:df_practice$Day  1      0.9      0.93   51
## Residuals                                 79   9782.8    123.83     
##                                           Pr(Prob)    
## df_practice$Glucose.level                   0.5556    
## df_practice$Day                             <2e-16 ***
## df_practice$Glucose.level:df_practice$Day   0.9608    
## Residuals                                             
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

In order to visualize the change in brain activation between day 1 and day 2, I created a dumbbell chart. You can see qualitatively how the thalamus and basal ganglia are responsive to both changes in glucose level and chnages in day, as opposed to all the other regions which are quite responsive to day only. Note that these are just the mean responses for all the members of group 1. There are no error bars/confidence intervals displayed.

## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

Here is another comparison between a few different regions. The dark blue reflects Day 1, the light blue reflects Day 2.

## 
## Attaching package: 'gridExtra'
## The following object is masked from 'package:dplyr':
## 
##     combine

Avi suggested that I implement a 3 way Anova so that we could look for focality of response by considering the interaction between glucose level and region of interest. When I run a 2x8x4 anova considering interactions between glucose level, region of interest, and day, there are significant differences in brain response depending on: glucose level, day, region of interest, and the interaction between region of interest and glucose level.

## 
## Error: X
##                   Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level      1   4316    4316   0.534  0.486
## Day                1   5940    5940   0.735  0.416
## Glucose.level:Day  1    215     215   0.027  0.875
## Residuals          8  64607    8076               
## 
## Error: Within
##                        Df Sum Sq Mean Sq F value   Pr(>F)    
## Glucose.level           1    886     886  14.865 0.000126 ***
## Day                     1  19865   19865 333.239  < 2e-16 ***
## ROI                     8  74240    9280 155.669  < 2e-16 ***
## Glucose.level:Day       1     31      31   0.519 0.471497    
## Glucose.level:ROI       8   3436     430   7.205 3.33e-09 ***
## Day:ROI                 8    667      83   1.400 0.193042    
## Glucose.level:Day:ROI   8    103      13   0.216 0.988042    
## Residuals             700  41729      60                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Because the interaction between ROI and glucose level is significant, I broke it appart with a general linear hypotheses test. I performed Tukey’s test with a Bonferroni correction. There are a bunch of significant interactions which should lend themselves to a discussion of focality in cerebral response.

m<-lmer(y~factor(Glucose.level)*ROI + (1|X), data = df_long)
summary(glht(m, linfct=mcp(ROI = "Tukey")), test = adjusted(type = "bonferroni"))
## 
##   Simultaneous Tests for General Linear Hypotheses
## 
## Multiple Comparisons of Means: Tukey Contrasts
## 
## 
## Fit: lme4::lmer(formula = y ~ factor(Glucose.level) * ROI + (1 | X), 
##     data = df_long)
## 
## Linear Hypotheses:
##                                         Estimate Std. Error z value
## OrbitalFrontal - Frontal == 0            -8.4877     2.9583  -2.869
## Motor - Frontal == 0                     -7.6689     2.9583  -2.592
## Parietal - Frontal == 0                  -6.9929     2.9583  -2.364
## Temporal - Frontal == 0                 -18.7529     2.9583  -6.339
## Occipital - Frontal == 0                -17.7245     2.9583  -5.991
## BasalGanglia - Frontal == 0             -16.8937     2.9583  -5.711
## Thalamus - Frontal == 0                 -15.5931     2.9583  -5.271
## InsulaAndAmygdala - Frontal == 0        -34.0369     2.9583 -11.506
## Motor - OrbitalFrontal == 0               0.8188     2.9583   0.277
## Parietal - OrbitalFrontal == 0            1.4948     2.9583   0.505
## Temporal - OrbitalFrontal == 0          -10.2653     2.9583  -3.470
## Occipital - OrbitalFrontal == 0          -9.2369     2.9583  -3.122
## BasalGanglia - OrbitalFrontal == 0       -8.4060     2.9583  -2.842
## Thalamus - OrbitalFrontal == 0           -7.1054     2.9583  -2.402
## InsulaAndAmygdala - OrbitalFrontal == 0 -25.5492     2.9583  -8.636
## Parietal - Motor == 0                     0.6760     2.9583   0.229
## Temporal - Motor == 0                   -11.0841     2.9583  -3.747
## Occipital - Motor == 0                  -10.0557     2.9583  -3.399
## BasalGanglia - Motor == 0                -9.2248     2.9583  -3.118
## Thalamus - Motor == 0                    -7.9242     2.9583  -2.679
## InsulaAndAmygdala - Motor == 0          -26.3680     2.9583  -8.913
## Temporal - Parietal == 0                -11.7601     2.9583  -3.975
## Occipital - Parietal == 0               -10.7317     2.9583  -3.628
## BasalGanglia - Parietal == 0             -9.9008     2.9583  -3.347
## Thalamus - Parietal == 0                 -8.6003     2.9583  -2.907
## InsulaAndAmygdala - Parietal == 0       -27.0440     2.9583  -9.142
## Occipital - Temporal == 0                 1.0284     2.9583   0.348
## BasalGanglia - Temporal == 0              1.8593     2.9583   0.628
## Thalamus - Temporal == 0                  3.1598     2.9583   1.068
## InsulaAndAmygdala - Temporal == 0       -15.2839     2.9583  -5.166
## BasalGanglia - Occipital == 0             0.8309     2.9583   0.281
## Thalamus - Occipital == 0                 2.1314     2.9583   0.720
## InsulaAndAmygdala - Occipital == 0      -16.3123     2.9583  -5.514
## Thalamus - BasalGanglia == 0              1.3006     2.9583   0.440
## InsulaAndAmygdala - BasalGanglia == 0   -17.1432     2.9583  -5.795
## InsulaAndAmygdala - Thalamus == 0       -18.4438     2.9583  -6.235
##                                         Pr(>|z|)    
## OrbitalFrontal - Frontal == 0            0.14819    
## Motor - Frontal == 0                     0.34318    
## Parietal - Frontal == 0                  0.65116    
## Temporal - Frontal == 0                 8.32e-09 ***
## Occipital - Frontal == 0                7.49e-08 ***
## BasalGanglia - Frontal == 0             4.05e-07 ***
## Thalamus - Frontal == 0                 4.88e-06 ***
## InsulaAndAmygdala - Frontal == 0         < 2e-16 ***
## Motor - OrbitalFrontal == 0              1.00000    
## Parietal - OrbitalFrontal == 0           1.00000    
## Temporal - OrbitalFrontal == 0           0.01874 *  
## Occipital - OrbitalFrontal == 0          0.06458 .  
## BasalGanglia - OrbitalFrontal == 0       0.16164    
## Thalamus - OrbitalFrontal == 0           0.58720    
## InsulaAndAmygdala - OrbitalFrontal == 0  < 2e-16 ***
## Parietal - Motor == 0                    1.00000    
## Temporal - Motor == 0                    0.00645 ** 
## Occipital - Motor == 0                   0.02433 *  
## BasalGanglia - Motor == 0                0.06549 .  
## Thalamus - Motor == 0                    0.26611    
## InsulaAndAmygdala - Motor == 0           < 2e-16 ***
## Temporal - Parietal == 0                 0.00253 ** 
## Occipital - Parietal == 0                0.01030 *  
## BasalGanglia - Parietal == 0             0.02943 *  
## Thalamus - Parietal == 0                 0.13130    
## InsulaAndAmygdala - Parietal == 0        < 2e-16 ***
## Occipital - Temporal == 0                1.00000    
## BasalGanglia - Temporal == 0             1.00000    
## Thalamus - Temporal == 0                 1.00000    
## InsulaAndAmygdala - Temporal == 0       8.59e-06 ***
## BasalGanglia - Occipital == 0            1.00000    
## Thalamus - Occipital == 0                1.00000    
## InsulaAndAmygdala - Occipital == 0      1.26e-06 ***
## Thalamus - BasalGanglia == 0             1.00000    
## InsulaAndAmygdala - BasalGanglia == 0   2.46e-07 ***
## InsulaAndAmygdala - Thalamus == 0       1.63e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- bonferroni method)

After doing a complete comparison of the control subjects, I also analyzed differences between the control group and the diabetic participants. This process was very similar as the above analysis, except I did not include patient ID as a random effect. The Anova shows that is a difference between groups, which makes sense.

The differences between groups occurs in the occipital lobe and the basal ganglia. The occipital lobe’s location in the rear of the brain aligns with Avi’s expectation that we would see effects in the rear of the brain. The basal ganglia was a significant region in the earlier comparison between Day 1 and Day 2 response, as well. The thalamus is responsive to changes in glucose level, as it was in the earlier analysis; however, it is not affected by whether a person is diabetic or not.

This dataset seems to meet the assumption of normality, so I didn’t bother to apply a permutation test.

df_compare<-subset(df, df$Day == 1)

dependent.vars<-as.matrix(df_compare[,5:13])
summary(manova(dependent.vars~df_compare$Glucose.level*df_compare$Group)) 
##                                           Df  Pillai approx F num Df
## df_compare$Glucose.level                   1 0.44581   6.5247      9
## df_compare$Group                           1 0.35010   4.3695      9
## df_compare$Glucose.level:df_compare$Group  1 0.09120   0.8140      9
## Residuals                                 81                        
##                                           den Df    Pr(>F)    
## df_compare$Glucose.level                      73  9.12e-07 ***
## df_compare$Group                              73 0.0001393 ***
## df_compare$Glucose.level:df_compare$Group     73 0.6049450    
## Residuals                                                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
mod2<-aov(dependent.vars~Glucose.level*Group, data = df_compare)
summary(mod2)
##  Response Frontal :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1  217.8 217.780  2.0970 0.1515
## Group                1   11.3  11.294  0.1087 0.7424
## Glucose.level:Group  1   26.7  26.734  0.2574 0.6133
## Residuals           81 8412.2 103.855               
## 
##  Response OrbitalFrontal :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1  135.1 135.064  1.3220 0.2536
## Group                1   25.4  25.355  0.2482 0.6197
## Glucose.level:Group  1    1.1   1.121  0.0110 0.9168
## Residuals           81 8275.7 102.169               
## 
##  Response Motor :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1    0.3   0.310  0.0030 0.9568
## Group                1  233.8 233.764  2.2228 0.1399
## Glucose.level:Group  1    1.3   1.302  0.0124 0.9117
## Residuals           81 8518.4 105.165               
## 
##  Response Parietal :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1    3.1   3.122  0.0300 0.8629
## Group                1   98.9  98.937  0.9508 0.3324
## Glucose.level:Group  1  117.4 117.448  1.1287 0.2912
## Residuals           81 8428.8 104.059               
## 
##  Response Temporal :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1   22.6  22.638  0.3023 0.5839
## Group                1  104.4 104.363  1.3937 0.2412
## Glucose.level:Group  1   42.4  42.392  0.5661 0.4540
## Residuals           81 6065.4  74.882               
## 
##  Response Occipital :
##                     Df Sum Sq Mean Sq F value Pr(>F)  
## Glucose.level        1    0.2    0.21  0.0018 0.9659  
## Group                1  688.8  688.80  5.8846 0.0175 *
## Glucose.level:Group  1   88.4   88.41  0.7553 0.3874  
## Residuals           81 9481.1  117.05                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response BasalGanglia :
##                     Df Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level        1  847.9  847.94 11.8994 0.0008941 ***
## Group                1  352.3  352.32  4.9442 0.0289640 *  
## Glucose.level:Group  1    9.6    9.58  0.1344 0.7148718    
## Residuals           81 5772.0   71.26                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response Thalamus :
##                     Df  Sum Sq Mean Sq F value    Pr(>F)    
## Glucose.level        1  4764.9  4764.9 30.2429 4.323e-07 ***
## Group                1   313.3   313.3  1.9883    0.1623    
## Glucose.level:Group  1   177.7   177.7  1.1282    0.2913    
## Residuals           81 12761.9   157.6                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##  Response InsulaAndAmygdala :
##                     Df Sum Sq Mean Sq F value Pr(>F)
## Glucose.level        1    6.8   6.837  0.0755 0.7842
## Group                1    6.2   6.237  0.0688 0.7937
## Glucose.level:Group  1   33.4  33.406  0.3687 0.5454
## Residuals           81 7338.8  90.603
qqnorm(resid(mod2), main="Normal Q-Q Plot")
qqline(resid(mod2), col="red")

df_long<-gather(df_compare, ROI, y, Frontal:InsulaAndAmygdala, factor_key = TRUE)
mod1<-aov(y~Glucose.level*Group*ROI, data = df_long)
summary(mod1)
##                          Df Sum Sq Mean Sq F value   Pr(>F)    
## Glucose.level             1   1482    1482  14.392 0.000161 ***
## Group                     1    108     108   1.046 0.306866    
## ROI                       8  79329    9916  96.315  < 2e-16 ***
## Glucose.level:Group       1    353     353   3.424 0.064651 .  
## Glucose.level:ROI         8   4517     565   5.484 9.67e-07 ***
## Group:ROI                 8   1727     216   2.096 0.033976 *  
## Glucose.level:Group:ROI   8    146      18   0.177 0.993978    
## Residuals               729  75054     103                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

In order to consider the interaction between group and region of interest, I used the general linear hypothesis test with a Bonferroni correction again. Again we see many regions that appear correlated with each other.

m<-lm(y~factor(Glucose.level)*ROI*factor(Group), data = df_long)
summary(glht(m, linfct=mcp(ROI = "Tukey")), test = adjusted(type = "bonferroni"))
## 
##   Simultaneous Tests for General Linear Hypotheses
## 
## Multiple Comparisons of Means: Tukey Contrasts
## 
## 
## Fit: lm(formula = y ~ factor(Glucose.level) * ROI * factor(Group), 
##     data = df_long)
## 
## Linear Hypotheses:
##                                         Estimate Std. Error t value
## OrbitalFrontal - Frontal == 0            -6.4345     4.3311  -1.486
## Motor - Frontal == 0                     -7.4976     4.3311  -1.731
## Parietal - Frontal == 0                  -8.7656     4.3311  -2.024
## Temporal - Frontal == 0                 -17.5465     4.3311  -4.051
## Occipital - Frontal == 0                -17.6898     4.3311  -4.084
## BasalGanglia - Frontal == 0             -15.0874     4.3311  -3.483
## Thalamus - Frontal == 0                 -16.0170     4.3311  -3.698
## InsulaAndAmygdala - Frontal == 0        -31.1174     4.3311  -7.185
## Motor - OrbitalFrontal == 0              -1.0631     4.3311  -0.245
## Parietal - OrbitalFrontal == 0           -2.3311     4.3311  -0.538
## Temporal - OrbitalFrontal == 0          -11.1120     4.3311  -2.566
## Occipital - OrbitalFrontal == 0         -11.2553     4.3311  -2.599
## BasalGanglia - OrbitalFrontal == 0       -8.6529     4.3311  -1.998
## Thalamus - OrbitalFrontal == 0           -9.5825     4.3311  -2.212
## InsulaAndAmygdala - OrbitalFrontal == 0 -24.6829     4.3311  -5.699
## Parietal - Motor == 0                    -1.2680     4.3311  -0.293
## Temporal - Motor == 0                   -10.0489     4.3311  -2.320
## Occipital - Motor == 0                  -10.1922     4.3311  -2.353
## BasalGanglia - Motor == 0                -7.5898     4.3311  -1.752
## Thalamus - Motor == 0                    -8.5194     4.3311  -1.967
## InsulaAndAmygdala - Motor == 0          -23.6198     4.3311  -5.453
## Temporal - Parietal == 0                 -8.7809     4.3311  -2.027
## Occipital - Parietal == 0                -8.9243     4.3311  -2.060
## BasalGanglia - Parietal == 0             -6.3219     4.3311  -1.460
## Thalamus - Parietal == 0                 -7.2514     4.3311  -1.674
## InsulaAndAmygdala - Parietal == 0       -22.3518     4.3311  -5.161
## Occipital - Temporal == 0                -0.1434     4.3311  -0.033
## BasalGanglia - Temporal == 0              2.4590     4.3311   0.568
## Thalamus - Temporal == 0                  1.5295     4.3311   0.353
## InsulaAndAmygdala - Temporal == 0       -13.5709     4.3311  -3.133
## BasalGanglia - Occipital == 0             2.6024     4.3311   0.601
## Thalamus - Occipital == 0                 1.6729     4.3311   0.386
## InsulaAndAmygdala - Occipital == 0      -13.4275     4.3311  -3.100
## Thalamus - BasalGanglia == 0             -0.9295     4.3311  -0.215
## InsulaAndAmygdala - BasalGanglia == 0   -16.0299     4.3311  -3.701
## InsulaAndAmygdala - Thalamus == 0       -15.1004     4.3311  -3.486
##                                         Pr(>|t|)    
## OrbitalFrontal - Frontal == 0            1.00000    
## Motor - Frontal == 0                     1.00000    
## Parietal - Frontal == 0                  1.00000    
## Temporal - Frontal == 0                  0.00204 ** 
## Occipital - Frontal == 0                 0.00178 ** 
## BasalGanglia - Frontal == 0              0.01894 *  
## Thalamus - Frontal == 0                  0.00844 ** 
## InsulaAndAmygdala - Frontal == 0        6.29e-11 ***
## Motor - OrbitalFrontal == 0              1.00000    
## Parietal - OrbitalFrontal == 0           1.00000    
## Temporal - OrbitalFrontal == 0           0.37833    
## Occipital - OrbitalFrontal == 0          0.34405    
## BasalGanglia - OrbitalFrontal == 0       1.00000    
## Thalamus - OrbitalFrontal == 0           0.98138    
## InsulaAndAmygdala - OrbitalFrontal == 0 6.42e-07 ***
## Parietal - Motor == 0                    1.00000    
## Temporal - Motor == 0                    0.74242    
## Occipital - Motor == 0                   0.68001    
## BasalGanglia - Motor == 0                1.00000    
## Thalamus - Motor == 0                    1.00000    
## InsulaAndAmygdala - Motor == 0          2.48e-06 ***
## Temporal - Parietal == 0                 1.00000    
## Occipital - Parietal == 0                1.00000    
## BasalGanglia - Parietal == 0             1.00000    
## Thalamus - Parietal == 0                 1.00000    
## InsulaAndAmygdala - Parietal == 0       1.16e-05 ***
## Occipital - Temporal == 0                1.00000    
## BasalGanglia - Temporal == 0             1.00000    
## Thalamus - Temporal == 0                 1.00000    
## InsulaAndAmygdala - Temporal == 0        0.06485 .  
## BasalGanglia - Occipital == 0            1.00000    
## Thalamus - Occipital == 0                1.00000    
## InsulaAndAmygdala - Occipital == 0       0.07244 .  
## Thalamus - BasalGanglia == 0             1.00000    
## InsulaAndAmygdala - BasalGanglia == 0    0.00834 ** 
## InsulaAndAmygdala - Thalamus == 0        0.01873 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- bonferroni method)

Here is a visualization of the comparison of cerebral response separated by glucose level and group.