fc_analysis

Single run, single subject

All subjects

soc & phys blocks

#Primary hypothesis, soc & phys regions vs. func V1
roi_list_primary_R <- c("RSMG", "RSPC","RTPJ","RSTS","funcRV1", "anatRV1")
roi_list_primary_L <- c("LSMG", "LSPC","LTPJ","LSTS","funcLV1","anatLV1")

fc_primary_R <- get_fc_table(all_subjects, roi_list_primary_R, by_barrier=FALSE)
fc_primary_L <- get_fc_table(all_subjects,roi_list_primary_L,by_barrier=FALSE)

Visualization

#left hemisphere
ggplot(subset(fc_primary_L, trial_type %in% c("social", "physics")), aes(x = ROI_pair, y=correlation,fill=trial_type))+
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "coral2"))+
  theme_minimal()+
  labs(title="Left Hemisphere")+
  theme(plot.title = element_text(size=15))+
  ylim(-0.5,1)+
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

#right hemisphere
ggplot(subset(fc_primary_R, trial_type %in% c("social", "physics")), aes(x = ROI_pair, y=correlation,fill=trial_type))+
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "coral2"))+
  theme_minimal()+
  labs(title="Right Hemisphere")+
  theme(plot.title = element_text(size=15))+
  ylim(-0.5,1)+
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

Analysis

Take a pair of regions, one soc, one phys, see if they’re more connected during social than physical task. This connection is specific to this pair, don’t see it when you pair up either region with V1.

Simple Effect Model

compare_pair <- function(roi_list,roi_pair) {
  df <- roi_list %>%
  filter(ROI_pair == as.character(roi_pair)) %>%
  filter(trial_type != "rest") %>%
  mutate(subject = str_remove(subject_run, "_.*$"))
  
  df$trial_type <- relevel(as.factor(df$trial_type), ref = "physics")
  
  model <- lmer(correlation ~ trial_type + (1|subject), data = df)
  return(summary(model))
}

#fc_primary_L: LSMG, LSPC, LTPJ, LSTS, funcLV1
#fc_primary_R: RSMG, RSPC, RTPJ, RSTS, funcRV1

compare_pair(fc_primary_R,"RSPC_RSTS")
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: correlation ~ trial_type + (1 | subject)
   Data: df

REML criterion at convergence: -18.1

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-1.86106 -0.61502 -0.09085  0.58278  2.01820 

Random effects:
 Groups   Name        Variance Std.Dev.
 subject  (Intercept) 0.02287  0.1512  
 Residual             0.02566  0.1602  
Number of obs: 56, groups:  subject, 14

Fixed effects:
                 Estimate Std. Error       df t value Pr(>|t|)  
(Intercept)       0.11599    0.05050 19.02889   2.297   0.0331 *
trial_typesocial  0.07966    0.04281 41.00000   1.861   0.0700 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
            (Intr)
tril_typscl -0.424

RSPC-RSTS are more connected during soc than phys trials, the difference is marginally significant (b=0.080, p=.07). We don’t see this pattern in their connectivity with functional RV1.

compare_pair(fc_primary_R,"RSPC_anatRV1")
compare_pair(fc_primary_R,"RSMG_anatRV1")
compare_pair(fc_primary_L,"LSPC_anatLV1")

But LSPC and anat LV1 have significantly higher connectivity during soc than phys trials (b=0.11, p<.01), same for RSPC and anat RV1 (b=0.082, p=.01), and RSMG and anat RV1 (b=0.078, p<.01). These are unexpected.

None of the other pairs had significant difference in soc vs. phys trials.


Interaction Model

the effect of trial_type is greater for soc-phs pair, than soc-V1 pair and phys-V1 pair

(if you want to interpret main effects properly in this model, summed contrasts) - but dummy coding can better answer the question about difference between roi pairs?

library(emmeans)
Welcome to emmeans.
Caution: You lose important information if you filter this package's results.
See '? untidy'
interaction <- function(data, roi_set) {
  df <- data %>%
    filter(ROI_pair %in% roi_set) %>%
    filter(trial_type != "rest") %>%
    mutate(subject = str_remove(subject_run, "_.*$"),
           ROI_pair = factor(ROI_pair, levels = c(roi_set[1], setdiff(roi_set, roi_set[1]))))

  model <- lmer(correlation ~ ROI_pair * trial_type + (1 | subject), data = df)
  print(summary(model))
  
  emm <- emmeans(model, ~ trial_type | ROI_pair) # estimated marginal means of correlation for each level of trial_type, within each ROI_pair, accounting for interaction (same coefficient but dif p value than simple effect model)
  print(contrast(emm, method="pairwise")) #Are predicted correlations for soc vs. phys trials different within the same ROI_pair?
}

interaction(fc_primary_R, roi_set = c("RSPC_RSTS", "RSPC_funcRV1", "RSTS_funcRV1"))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: correlation ~ ROI_pair * trial_type + (1 | subject)
   Data: df

REML criterion at convergence: -122.8

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.3453 -0.5993  0.1031  0.6683  2.5751 

Random effects:
 Groups   Name        Variance Std.Dev.
 subject  (Intercept) 0.01122  0.1059  
 Residual             0.02062  0.1436  
Number of obs: 168, groups:  subject, 14

Fixed effects:
                                       Estimate Std. Error        df t value
(Intercept)                             0.11599    0.03922  34.66996   2.958
ROI_pairRSPC_funcRV1                    0.33110    0.03838 149.00000   8.627
ROI_pairRSTS_funcRV1                    0.12054    0.03838 149.00000   3.141
trial_typesocial                        0.07966    0.03838 149.00000   2.075
ROI_pairRSPC_funcRV1:trial_typesocial  -0.09290    0.05428 149.00000  -1.711
ROI_pairRSTS_funcRV1:trial_typesocial  -0.08338    0.05428 149.00000  -1.536
                                      Pr(>|t|)    
(Intercept)                            0.00555 ** 
ROI_pairRSPC_funcRV1                  8.73e-15 ***
ROI_pairRSTS_funcRV1                   0.00203 ** 
trial_typesocial                       0.03967 *  
ROI_pairRSPC_funcRV1:trial_typesocial  0.08908 .  
ROI_pairRSTS_funcRV1:trial_typesocial  0.12664    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) ROI_pRSPC_RV1 ROI_pRSTS_RV1 trl_ty ROI_RSPC_RV1:
ROI_pRSPC_RV1 -0.489                                                 
ROI_pRSTS_RV1 -0.489  0.500                                          
tril_typscl   -0.489  0.500         0.500                            
ROI_RSPC_RV1:  0.346 -0.707        -0.354        -0.707              
ROI_RSTS_RV1:  0.346 -0.354        -0.707        -0.707  0.500       
ROI_pair = RSPC_RSTS:
 contrast         estimate     SE  df t.ratio p.value
 physics - social -0.07966 0.0384 149  -2.075  0.0397

ROI_pair = RSPC_funcRV1:
 contrast         estimate     SE  df t.ratio p.value
 physics - social  0.01324 0.0384 149   0.345  0.7306

ROI_pair = RSTS_funcRV1:
 contrast         estimate     SE  df t.ratio p.value
 physics - social  0.00372 0.0384 149   0.097  0.9229

Degrees-of-freedom method: kenward-roger 
interaction(fc_primary_R, roi_set = c("RSPC_RSTS", "RSPC_anatRV1", "RSTS_anatRV1"))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: correlation ~ ROI_pair * trial_type + (1 | subject)
   Data: df

REML criterion at convergence: -100.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-2.4642 -0.5870 -0.0035  0.6622  2.2736 

Random effects:
 Groups   Name        Variance Std.Dev.
 subject  (Intercept) 0.01692  0.1301  
 Residual             0.02322  0.1524  
Number of obs: 168, groups:  subject, 14

Fixed effects:
                                        Estimate Std. Error         df t value
(Intercept)                             0.115987   0.045142  29.099441   2.569
ROI_pairRSPC_anatRV1                    0.224757   0.040728 149.000000   5.519
ROI_pairRSTS_anatRV1                    0.249402   0.040728 149.000000   6.124
trial_typesocial                        0.079658   0.040728 149.000000   1.956
ROI_pairRSPC_anatRV1:trial_typesocial   0.002277   0.057597 149.000000   0.040
ROI_pairRSTS_anatRV1:trial_typesocial  -0.113930   0.057597 149.000000  -1.978
                                      Pr(>|t|)    
(Intercept)                             0.0156 *  
ROI_pairRSPC_anatRV1                  1.48e-07 ***
ROI_pairRSTS_anatRV1                  7.75e-09 ***
trial_typesocial                        0.0523 .  
ROI_pairRSPC_anatRV1:trial_typesocial   0.9685    
ROI_pairRSTS_anatRV1:trial_typesocial   0.0498 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlation of Fixed Effects:
              (Intr) ROI_pRSPC_RV1 ROI_pRSTS_RV1 trl_ty ROI_RSPC_RV1:
ROI_pRSPC_RV1 -0.451                                                 
ROI_pRSTS_RV1 -0.451  0.500                                          
tril_typscl   -0.451  0.500         0.500                            
ROI_RSPC_RV1:  0.319 -0.707        -0.354        -0.707              
ROI_RSTS_RV1:  0.319 -0.354        -0.707        -0.707  0.500       
ROI_pair = RSPC_RSTS:
 contrast         estimate     SE  df t.ratio p.value
 physics - social  -0.0797 0.0407 149  -1.956  0.0523

ROI_pair = RSPC_anatRV1:
 contrast         estimate     SE  df t.ratio p.value
 physics - social  -0.0819 0.0407 149  -2.012  0.0460

ROI_pair = RSTS_anatRV1:
 contrast         estimate     SE  df t.ratio p.value
 physics - social   0.0343 0.0407 149   0.841  0.4014

Degrees-of-freedom method: kenward-roger 

RSPC_RSTS

  • funcRV1: social–physics difference is greatest for RSPC_RSTS pair than either one with funcRV1. Overall functional connectivity in physics trial (baseline) is higher in RSPC_funcRV1(b = 0.33, p < .001) and RSTS_funcRV1(b = 0.12, p = .002) compared to RSPC_RSTS. Trial_type had a modest effect (b = 0.08, p = .040), meaning there’s a higher connectivity in RSPC_RSTS in social than physical trials. Follow-up comparisons showed that only RSPC_RSTS pair showed significantly higher correlation during social than physical trials (p = .040), but not RSPC_RV1 or RSTS_funcRV1.

  • anatRV1: RSPC–RSTS connectivity has a marginal increase during social than physical trials. Follow-up comparisons showed that only RSTS–anatRV1 showed significantly higher correlation in social than physical trials, which is contrary to the finding with funcRV1 and our expectation.

interaction(fc_primary_R, roi_set = c("RSMG_RTPJ", "RSMG_funcRV1", "RTPJ_funcRV1"))
interaction(fc_primary_R, roi_set = c("RSMG_RTPJ", "RSMG_anatRV1", "RTPJ_anatRV1"))

RSMG_RTPJ

  • funcRV1: overall functional connectivity in physics trial (baseline) is lower in RSMG_funcRV1(b = -0.15, p < .001) and RTPJ_funcRV1(b = -0.14, p < .001) compared to RSMG_RTPJ. No effect of trial_type.

  • anatRV1: RSMG_anatRV1 pair showed significantly higher correlation during social than physical trials (b=0.08, p = .02), but not RSMG_TPJ or RTPJ_anatRV1.

interaction(fc_primary_L, roi_set = c("LSPC_LSTS", "LSPC_anatLV1", "LSTS_anatLV1"))
interaction(fc_primary_L, roi_set = c("LSPC_LTPJ", "LSPC_anatLV1", "LTPJ_anatLV1"))

LSPC_anatLV1 pair showed significantly higher correlation during social than physical trials, but not LSPC with any other regions.

soc & phys & rest blocks

Visualization

#soc vs. phys vs. rest blocks
fig2_L <- ggplot(fc_primary_L, aes(x = ROI_pair, y=correlation,fill=trial_type))+ 
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "grey", "coral2"))+
  theme_minimal()+
  theme(plot.title = element_text(size=15))+
  ylim(-0.5,1)+
    theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

fig2_R <- ggplot(fc_primary_R, aes(x = ROI_pair, y=correlation,fill=trial_type))+ 
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "grey", "coral2"))+
  theme_minimal()+
  theme(plot.title = element_text(size=15))+
  ylim(-0.5,1)+
    theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

(fig2_L / fig2_R)

Analysis

How does connectivity in soc vs. phys blocks differ compared to rest, when people are not seeing any stimuli?

we expect to see connectivity increase when people see stimuli, regardless of domain, versus in rest. Do we predict the same for V1?

barrier vs. no barrier

#barrier vs. no-barrier
all_subjects_by_barrier <- all_subjects |>
  filter(!is.na(barrier))

fc_primary_L_by_barrier <- get_fc_table(all_subjects_by_barrier, roi_list_primary_L, by_barrier=TRUE)

ggplot(fc_primary_L_by_barrier, aes(x = ROI_pair, y=correlation,fill=barrier))+ 
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "coral2"))+
  facet_wrap(~trial_type) +
  theme_minimal()+
  theme(plot.title = element_text(size=15))+
    theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

fc_primary_R_by_barrier <- get_fc_table(all_subjects_by_barrier,roi_list_primary_R,by_barrier=TRUE)

ggplot(fc_primary_R_by_barrier, aes(x = ROI_pair, y=correlation,fill=trial_type))+ 
  stat_boxplot(geom='errorbar')+
  geom_boxplot(position="dodge") +
  scale_fill_manual(values=c("deepskyblue", "coral2"))+
  facet_wrap(~barrier) +
  theme_minimal()+
  theme(plot.title = element_text(size=15))+
    theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))

Univariate Analysis