gPPI analyses are conducted in CONN by predicting each target time series with a seed ROI, psychological parametric modulators, convolved with the HRF, and the seed x psych interaction terms.
The connectivity change (interaction beta estimate) for each seed-target pair per subject and condition was then extracted and further analyzed at the group level here.
Connectivity beta estimates reflects the postive or negative change in connectivity estimates with increasing memory during ‘remember’ events.
Analyses use MNI-space unsmoothed data.
Change in connectivity between each target-seed pair with increasing memory detail (min 0, max 3 on any trial)
model <- 'Overall-Complexity-noEmot'
contrast <- "DetailRemembered" # memory parametric modulator
# GET PPI MATRIX ------------------------------------------------------------------
### fmri subjects for this model:
subjects = list.dirs(path = paste(matrixPath,model,'_ROI-to-ROI/',sep = ""), full.names = FALSE, recursive = FALSE)
### get ppi matrix per subject for this contrast
ppiMatrix <- format_conn(matrixPath, seeds, subjects, model, contrast, event)
MemoryQualityPPI <- ppiMatrix
### get overall change in connectivity with memory:
meanConn <- data.frame(ConnectivityChange = apply(ppiMatrix, c(3), mean))
sum <- meanConn %>% summarise(Mean.Connectivity = mean(ConnectivityChange), SE.Connectivity = se(ConnectivityChange))
print(kable(sum))
| Mean.Connectivity| SE.Connectivity|
|-----------------:|---------------:|
| 0.3581262| 0.1649264|
# test against zero
pander(t.test(meanConn$ConnectivityChange, mu=0, alternative=type))
----------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- ----------- ------------------------ -----------
2.171 27 0.01943 * greater 0.3581
----------------------------------------------------------------------
Table: One Sample t-test: `meanConn$ConnectivityChange`
### focus on on aHIPP and pHIPP in terms of mean inter-network connectivity change with PM and AT networks (both as seeds and targets)
meanHipp <- mean_hipp_change(subjects, ppiMatrix, seeds, networks)
p <- plot_hipp(meanHipp)
plot(p)
ggsave('Remember_Hipp-to-Network.jpg',plot=last_plot(),dpi=300,width=5,height=5)
# Anova:
pander(ezANOVA(data = meanHipp, dv = MeanConnectivity, wid = Subject,
detailed = TRUE, within = .(Network,Region)))
* **ANOVA**:
--------------------------------------------------------------------------------------
Effect DFn DFd SSn SSd F p p<.05 ges
---------------- ----- ----- --------- ------- --------- ---------- ------- ----------
(Intercept) 1 27 26.04 82.33 8.539 0.006949 * 0.1882
Network 1 27 0.7554 12.83 1.589 0.2182 0.006681
Region 1 27 0.9274 12.82 1.954 0.1736 0.008191
Network:Region 1 27 0.01325 4.319 0.08285 0.7757 0.000118
--------------------------------------------------------------------------------------
<!-- end of list -->
# test against zero
pander(t.test(meanHipp$MeanConnectivity[meanHipp$Network == 'AT' & meanHipp$Region == 'aHIPP'], mu=0, alternative=type))
--------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- --------- ------------------------ -----------
1.666 27 0.05363 greater 0.2982
--------------------------------------------------------------------
Table: One Sample t-test: `meanHipp$MeanConnectivity[meanHipp$Network == "AT" & meanHipp$Region == "aHIPP"]`
pander(t.test(meanHipp$MeanConnectivity[meanHipp$Network == 'PM' & meanHipp$Region == 'aHIPP'], mu=0, alternative=type))
------------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- ------------- ------------------------ -----------
2.484 27 0.00974 * * greater 0.4842
------------------------------------------------------------------------
Table: One Sample t-test: `meanHipp$MeanConnectivity[meanHipp$Network == "PM" & meanHipp$Region == "aHIPP"]`
pander(t.test(meanHipp$MeanConnectivity[meanHipp$Network == 'AT' & meanHipp$Region == 'pHIPP'], mu=0, alternative=type))
-------------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- -------------- ------------------------ -----------
2.797 27 0.004692 * * greater 0.5019
-------------------------------------------------------------------------
Table: One Sample t-test: `meanHipp$MeanConnectivity[meanHipp$Network == "AT" & meanHipp$Region == "pHIPP"]`
pander(t.test(meanHipp$MeanConnectivity[meanHipp$Network == 'PM' & meanHipp$Region == 'pHIPP'], mu=0, alternative=type))
------------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- ------------- ------------------------ -----------
2.993 27 0.00292 * * greater 0.6444
------------------------------------------------------------------------
Table: One Sample t-test: `meanHipp$MeanConnectivity[meanHipp$Network == "PM" & meanHipp$Region == "pHIPP"]`
write.csv(meanHipp, "Hipp-Network_MemoryQuality.csv", row.names=FALSE)
# GET CONNECTIVITY CHANGE BY NETWORK ---------------------------------------------
networkMatrix <- ppi_Network_connectivity(subjects, ppiMatrix, networks)
### p-value for each network comparison:
netStats <- get_network_pValues(networkMatrix, networkNames, nOrder, type)
print(kable(netStats))
|seed |target | connectivity| SE| t| df| p| FDRp|sig |
|:----|:------|------------:|---------:|--------:|--:|---------:|---------:|:---|
|PM |PM | 0.3518018| 0.2053519| 1.713165| 27| 0.0490720| 0.0616889|* |
|HIPP |PM | 0.5424819| 0.2269288| 2.390538| 27| 0.0120315| 0.0270708|** |
|AT |PM | 0.4899392| 0.2350950| 2.084005| 27| 0.0233762| 0.0420771|** |
|PM |HIPP | 0.5860639| 0.1781285| 3.290118| 27| 0.0013948| 0.0066537|** |
|HIPP |HIPP | 0.5912764| 0.1894669| 3.120738| 27| 0.0021324| 0.0066537|** |
|AT |HIPP | 0.5019440| 0.1616612| 3.104913| 27| 0.0022179| 0.0066537|** |
|PM |AT | 0.3652216| 0.1856076| 1.967708| 27| 0.0297260| 0.0445889|** |
|HIPP |AT | 0.2981062| 0.1802124| 1.654194| 27| 0.0548346| 0.0616889|NA |
|AT |AT | 0.1343305| 0.1833791| 0.732529| 27| 0.2350788| 0.2350788|NA |
### plot:
p <- plot_Network(netStats, type)
plot(p)
ggsave('Remember_MemoryQuality_Network.jpg',plot=last_plot(),dpi=300,width=7.5,height=6)
### get p-values for each individual seed-target comparison
ppiStats <- get_ppi_stats(ppiMatrix, seeds, sOrder, type)
### plot mean PPI matrix
p <- plot_meanPPI(ppiStats, 1, 2.6)
plot(p)
# now print the individually significant connections:
print(kable(subset(ppiStats,sig == '*')))
| |seeds |targets | value_conn| value_t| pvalue| pFDRAll| pFDRSeed|sig |
|:---|:-----|:-------|----------:|--------:|---------:|---------:|---------:|:---|
|25 |ANG |PCC | 1.0036129| 3.946562| 0.0002548| 0.0067279| 0.0019687|* |
|26 |PREC |PCC | 1.4031553| 3.576778| 0.0006701| 0.0088447| 0.0024569|* |
|28 |RSC |PCC | 0.5203776| 3.377105| 0.0011186| 0.0133139| 0.0061522|* |
|31 |aHIPP |PCC | 0.7851660| 3.199720| 0.0017510| 0.0154088| 0.0064203|* |
|36 |OFC |PCC | 1.2789153| 4.464415| 0.0000642| 0.0067279| 0.0007060|* |
|37 |ANG |RSC | 2.0721737| 3.817466| 0.0003579| 0.0075763| 0.0019687|* |
|38 |PREC |RSC | 2.1996787| 4.070193| 0.0001837| 0.0067279| 0.0020211|* |
|42 |pHIPP |RSC | 2.0711676| 4.177157| 0.0001383| 0.0067279| 0.0015211|* |
|43 |aHIPP |RSC | 1.2322646| 3.224484| 0.0016455| 0.0154088| 0.0064203|* |
|47 |ITC |RSC | 1.5128082| 3.230886| 0.0016193| 0.0154088| 0.0178122|* |
|48 |OFC |RSC | 2.4255781| 3.751671| 0.0004252| 0.0075763| 0.0023388|* |
|62 |PREC |pHIPP | 1.1824905| 3.722271| 0.0004592| 0.0075763| 0.0024569|* |
|64 |RSC |pHIPP | 0.6454269| 4.005134| 0.0002183| 0.0067279| 0.0024013|* |
|65 |PHC |pHIPP | 0.5655404| 3.038121| 0.0026160| 0.0203124| 0.0287760|* |
|67 |aHIPP |pHIPP | 0.6869242| 3.579561| 0.0006653| 0.0088447| 0.0064203|* |
|69 |AMYG |pHIPP | 0.5882459| 2.709897| 0.0057745| 0.0381114| 0.0534271|* |
|70 |FUS |pHIPP | 0.6568556| 2.594449| 0.0075635| 0.0475419| 0.0831983|* |
|72 |OFC |pHIPP | 0.9329880| 3.346097| 0.0012104| 0.0133139| 0.0044380|* |
|74 |PREC |aHIPP | 0.8807560| 2.929966| 0.0034085| 0.0249957| 0.0074987|* |
|134 |PREC |OFC | 0.9351170| 3.096148| 0.0022666| 0.0186996| 0.0062332|* |
|136 |RSC |OFC | 0.4348673| 2.906713| 0.0036064| 0.0250551| 0.0132235|* |
Calculates the change in connectivity between each target-seed pair with increasing color precision ## Overall connectivity
model <- 'Features-SuccessPrecision-noEmot'
contrast <- "ColorPrecision" # memory parametric modulator
# GET PPI MATRIX ------------------------------------------------------------------
### fmri subjects for this model:
subjects = list.dirs(path = paste(matrixPath,model,'_ROI-to-ROI/',sep = ""), full.names = FALSE, recursive = FALSE)
### get ppi matrix per subject for this contrast
ppiMatrix <- format_conn(matrixPath, seeds, subjects, model, contrast, event)
ColorPrecisionPPI <- ppiMatrix
### get overall change in connectivity with memory:
meanConn <- data.frame(ConnectivityChange = apply(ppiMatrix, c(3), mean))
sum <- meanConn %>% summarise(Mean.Connectivity = mean(ConnectivityChange), SE.Connectivity = se(ConnectivityChange))
print(kable(sum))
| Mean.Connectivity| SE.Connectivity|
|-----------------:|---------------:|
| 0.238302| 0.112872|
# test against zero
pander(t.test(meanConn$ConnectivityChange, mu=0, alternative=type))
----------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- ----------- ------------------------ -----------
2.111 27 0.02207 * greater 0.2383
----------------------------------------------------------------------
Table: One Sample t-test: `meanConn$ConnectivityChange`
# GET CONNECTIVITY CHANGE BY NETWORK ---------------------------------------------
networkMatrix <- ppi_Network_connectivity(subjects, ppiMatrix, networks)
### p-value for each network comparison:
netStats <- get_network_pValues(networkMatrix, networkNames, nOrder, type)
print(kable(netStats))
|seed |target | connectivity| SE| t| df| p| FDRp|sig |
|:----|:------|------------:|---------:|---------:|--:|---------:|---------:|:---|
|PM |PM | 0.1289932| 0.1455641| 0.8861609| 27| 0.1916779| 0.1916779|NA |
|HIPP |PM | 0.3285191| 0.1803347| 1.8217183| 27| 0.0397974| 0.0716353|* |
|AT |PM | 0.3539786| 0.1672092| 2.1169807| 27| 0.0218099| 0.0597240|* |
|PM |HIPP | 0.3277346| 0.1620115| 2.0229098| 27| 0.0265440| 0.0597240|* |
|HIPP |HIPP | 0.2112116| 0.1678587| 1.2582700| 27| 0.1095334| 0.1408286|NA |
|AT |HIPP | 0.3131076| 0.1397033| 2.2412333| 27| 0.0167163| 0.0597240|* |
|PM |AT | 0.2894520| 0.1416849| 2.0429283| 27| 0.0254666| 0.0597240|* |
|HIPP |AT | 0.2323645| 0.1565907| 1.4838970| 27| 0.0747087| 0.1120630|NA |
|AT |AT | 0.1605088| 0.1383712| 1.1599875| 27| 0.1281045| 0.1441175|NA |
### plot:
p <- plot_Network(netStats, type)
plot(p)
ggsave('Remember_ColorPrecision_Network.jpg',plot=last_plot(),dpi=300,width=7.5,height=6)
### get p-values for each individual seed-target comparison
ppiStats <- get_ppi_stats(ppiMatrix, seeds, sOrder, type)
# plot significant PRC/AMYG/PHC/RSC connections
p <- plot_seed_connections(ppiMatrix, ppiStats, 'Color', seeds)
plot(p)
ggsave('Remember_ColorPrecision_Connections.jpg',plot=last_plot(),dpi=300,width=6,height=4.5)
# now print the individually significant connections:
connections <- subset(ppiStats, pFDRSeed < .05 & (seeds == 'RSC' | seeds == 'PHC' | seeds == 'PRC' | seeds == 'AMYG'))
connections <- connections[,-c(5,6,8)]
print(kable(connections))
| |seeds |targets | value_conn| value_t| pFDRSeed|
|:--|:-----|:-------|----------:|--------:|---------:|
|8 |PRC |ANG | 0.5321694| 2.965276| 0.0344033|
|20 |PRC |PREC | 0.3920330| 2.382290| 0.0449355|
|21 |AMYG |PREC | 0.5027065| 2.843077| 0.0462563|
|65 |PHC |pHIPP | 0.5000328| 2.848443| 0.0456634|
|80 |PRC |aHIPP | 0.3680478| 2.506254| 0.0449355|
Calculates the change in connectivity between each target-seed pair with increasing scene precision ## Overall connectivity
model <- 'Features-SuccessPrecision-noEmot'
contrast <- "ScenePrecision" # memory parametric modulator
# GET PPI MATRIX ------------------------------------------------------------------
### fmri subjects for this model:
subjects = list.dirs(path = paste(matrixPath,model,'_ROI-to-ROI/',sep = ""), full.names = FALSE, recursive = FALSE)
### get ppi matrix per subject for this contrast
ppiMatrix <- format_conn(matrixPath, seeds, subjects, model, contrast, event)
ScenePrecisionPPI <- ppiMatrix
### get overall change in connectivity with memory:
meanConn <- data.frame(ConnectivityChange = apply(ppiMatrix, c(3), mean))
sum <- meanConn %>% summarise(Mean.Connectivity = mean(ConnectivityChange), SE.Connectivity = se(ConnectivityChange))
print(kable(sum))
| Mean.Connectivity| SE.Connectivity|
|-----------------:|---------------:|
| 0.2503445| 0.12929|
# test against zero
pander(t.test(meanConn$ConnectivityChange, mu=0, alternative=type))
----------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- ----------- ------------------------ -----------
1.936 27 0.03168 * greater 0.2503
----------------------------------------------------------------------
Table: One Sample t-test: `meanConn$ConnectivityChange`
# GET CONNECTIVITY CHANGE BY NETWORK ---------------------------------------------
networkMatrix <- ppi_Network_connectivity(subjects, ppiMatrix, networks)
### p-value for each network comparison:
netStats <- get_network_pValues(networkMatrix, networkNames, nOrder, type)
print(kable(netStats))
|seed |target | connectivity| SE| t| df| p| FDRp|sig |
|:----|:------|------------:|---------:|---------:|--:|---------:|---------:|:---|
|PM |PM | 0.4252629| 0.1478766| 2.8757954| 27| 0.0038864| 0.0177074|** |
|HIPP |PM | 0.3568793| 0.2162420| 1.6503695| 27| 0.0552270| 0.1396308|NA |
|AT |PM | 0.5241402| 0.1825858| 2.8706509| 27| 0.0039350| 0.0177074|** |
|PM |HIPP | 0.0322058| 0.1970698| 0.1634231| 27| 0.4357012| 0.4644029|NA |
|HIPP |HIPP | 0.0238647| 0.2646186| 0.0901852| 27| 0.4644029| 0.4644029|NA |
|AT |HIPP | 0.3166132| 0.2159388| 1.4662169| 27| 0.0770700| 0.1396308|NA |
|PM |AT | 0.0579253| 0.1619561| 0.3576604| 27| 0.3616891| 0.4644029|NA |
|HIPP |AT | 0.1382595| 0.1912239| 0.7230241| 27| 0.2379411| 0.3569117|NA |
|AT |AT | 0.2252702| 0.1540299| 1.4625096| 27| 0.0775727| 0.1396308|NA |
### plot:
p <- plot_Network(netStats, type)
plot(p)
ggsave('Remember_ScenePrecision_Network.jpg',plot=last_plot(),dpi=300,width=7.5,height=6)
### get p-values for each individual seed-target comparison
ppiStats <- get_ppi_stats(ppiMatrix, seeds, sOrder, type)
# plot significant PRC/AMYG/PHC/RSC connections
p <- plot_seed_connections(ppiMatrix, ppiStats, 'Scene', seeds)
plot(p)
ggsave('Remember_ScenePrecision_Connections.jpg',plot=last_plot(),dpi=300,width=7,height=4.5)
# now print the individually significant connections:
connections <- subset(ppiStats, pFDRSeed < .05 & (seeds == 'RSC' | seeds == 'PHC' | seeds == 'PRC' | seeds == 'AMYG'))
connections <- connections[,-c(5,6,8)]
print(kable(connections))
| |seeds |targets | value_conn| value_t| pFDRSeed|
|:--|:-----|:-------|----------:|--------:|---------:|
|4 |RSC |ANG | 0.4340115| 3.716394| 0.0033008|
|5 |PHC |ANG | 0.7010383| 3.158638| 0.0158123|
|8 |PRC |ANG | 0.6048164| 2.908155| 0.0395320|
|16 |RSC |PREC | 0.2804193| 2.918363| 0.0128551|
|28 |RSC |PCC | 0.4001136| 3.619339| 0.0033008|
|29 |PHC |PCC | 0.6116341| 2.999701| 0.0158123|
# a) calculate the overall pattern simiarity between the color precision and scene precision ROIxROI matrices within each subject
similarity <- feature_similarity(ColorPrecisionPPI, ScenePrecisionPPI)
sum <- similarity %>% summarise(Mean.Z = mean(Similarity), SE.Z = se(Similarity))
print(kable(sum))
| Mean.Z| SE.Z|
|---------:|---------:|
| 0.0185993| 0.0375638|
# test against zero
pander(t.test(similarity$Similarity, mu=0, alternative=type))
--------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of x
---------------- ---- --------- ------------------------ -----------
0.4951 27 0.3123 greater 0.0186
--------------------------------------------------------------------
Table: One Sample t-test: `similarity$Similarity`
# b) compare PM and AT seeds to common ANG/PREC targets by feature
features <- feature_connections(ColorPrecisionPPI, ScenePrecisionPPI, seeds, subjects)
feature_data <- features[[1]]
sum <- feature_data %>% group_by(SeedNetwork, Feature) %>%
summarise(Conn = mean(Connectivity), SE.Conn = se(Connectivity))
print(kable(sum))
|SeedNetwork |Feature | Conn| SE.Conn|
|:-----------|:-------|---------:|---------:|
|AT |Color | 0.4227308| 0.1196378|
|AT |Scene | 0.4392161| 0.1555691|
|PM |Color | 0.1284684| 0.0923896|
|PM |Scene | 0.4343643| 0.1176139|
# Anova:
pander(ezANOVA(data = feature_data, dv = Connectivity, wid = SubID,
detailed = TRUE, within = .(SeedNetwork,Feature)))
* **ANOVA**:
------------------------------------------------------------------------------
Effect DFn DFd SSn SSd F p p<.05
--------------------- ----- ----- -------- ------- ------- ----------- -------
(Intercept) 1 27 14.21 22.35 17.17 0.0003025 *
SeedNetwork 1 27 0.6263 7.371 2.294 0.1415
Feature 1 27 0.7275 12.41 1.583 0.2191
SeedNetwork:Feature 1 27 0.5863 3.904 4.055 0.0541
------------------------------------------------------------------------------
Table: Table continues below
---------
ges
---------
0.2359
0.01342
0.01556
0.01258
---------
<!-- end of list -->
# t-test for PM (color vs scene):
pander(t.test(Connectivity ~ Feature, data=feature_data[feature_data$SeedNetwork == 'PM',], paired=TRUE))
----------------------------------------------------------
Test statistic df P value Alternative hypothesis
---------------- ---- ----------- ------------------------
-2.667 27 0.01276 * two.sided
----------------------------------------------------------
Table: Paired t-test: `Connectivity` by `Feature` (continued below)
-------------------------
mean of the differences
-------------------------
-0.3059
-------------------------
# t-test for AT (color vs scene):
pander(t.test(Connectivity ~ Feature, data=feature_data[feature_data$SeedNetwork == 'AT',], paired=TRUE))
----------------------------------------------------------------------------------
Test statistic df P value Alternative hypothesis mean of the differences
---------------- ---- --------- ------------------------ -------------------------
-0.09518 27 0.9249 two.sided -0.01649
----------------------------------------------------------------------------------
Table: Paired t-test: `Connectivity` by `Feature`
plot(features[[2]])
ggsave('Remember_Network-to-ANGPREC.jpg',plot=last_plot(),dpi=300,width=6,height=7)
write.csv(feature_data, "Feature_Connections.csv", row.names=FALSE)
### save data
save(ROIs, MemoryQualityPPI, ColorPrecisionPPI, ScenePrecisionPPI, file = "Memory_gPPI_data.RData")