setwd("~/Dropbox/EStroop (Hunter ERT fMRI)/Data/")
library(tidyverse)
Registered S3 method overwritten by 'rvest':
method from
read_xml.response xml2
[30m── [1mAttaching packages[22m ───────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──[39m
[30m[32m✔[30m [34mggplot2[30m 3.2.0 [32m✔[30m [34mpurrr [30m 0.3.2
[32m✔[30m [34mtibble [30m 2.1.3 [32m✔[30m [34mdplyr [30m 0.8.1
[32m✔[30m [34mtidyr [30m 0.8.3 [32m✔[30m [34mstringr[30m 1.4.0
[32m✔[30m [34mreadr [30m 1.3.1 [32m✔[30m [34mforcats[30m 0.4.0[39m
[30m── [1mConflicts[22m ──────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
[31m✖[30m [34m.GlobalEnv[30m::[32mfilter()[30m masks [34mdplyr[30m::filter(), [34mstats[30m::filter()
[31m✖[30m [34mdplyr[30m::[32mlag()[30m masks [34mstats[30m::lag()[39m
library(stats)
library(haven)
library(psych)
Attaching package: ‘psych’
The following objects are masked from ‘package:ggplot2’:
%+%, alpha
library(MASS)
Attaching package: ‘MASS’
The following object is masked _by_ ‘.GlobalEnv’:
select
The following object is masked from ‘package:dplyr’:
select
select <- dplyr::select
filter <- dplyr::filter
EStroop_NewDataset_allSRIAdata <- read_sav("~/Dropbox/EStroop (Hunter ERT fMRI)/Data/EStroop_NewDataset_allSRIAdata.sav")
EStroop_NewDataset_allSRIAdata <- EStroop_NewDataset_allSRIAdata %>% filter(`filter_$` == 1)
tots <- select(EStroop_NewDataset_allSRIAdata, c("ERT_ID", "TOT_ACS_Focus_11", "TOT_ACS_Focus_33", "TOT_ACS_Shift_11", "TOT_ACS_Shift_33", "TOT_ACS_11", "TOT_ACS_33", "TOT_EQ_decenter_11", "TOT_EQ_decenter_33", "TOT_ERQ_Reappraisal_11", "TOT_ERQ_Reappraisal_33", "IA_T11MDD_CSR_CUR_ALL", "IA_T33MDD_CSR_CUR_ALL", "IA_ADISgad1109b","IA_ADISgad3309b")) %>% mutate(ERT_ID = as.integer(ERT_ID))
#"TOT_MDD_CSR_11", "TOT_MDD_CSR_33", "TOT_GAD_CSR_11","TOT_GAD_CSR_33"
data <- read.csv("estroop-hunter-fmri.csv")
betas <- read.csv("betas_pre_post_con4__10_54_32_roi.csv")
data <- data %>% filter(`filter_.` == 1) # filter only participants w/estroop fmri data
data <- select(data, -contains("roi")) # get rid of old ROI variables
data <- select(data, -contains("con2")) # get rid of old ROI variables
dat <- left_join(data, betas, by="ERT_ID")
dat <- left_join(dat, tots, by = "ERT_ID")
# get standardized residuals
dat$stdres_prepost_con4_10_54_32 <-stdres(lm(prepost_con4_10_54_32_POST ~ prepost_con4_10_54_32_PRE, dat))
dat$stdres_ACS_Focus <- stdres(lm(TOT_ACS_Focus_33 ~ TOT_ACS_Focus_11, data = dat))
dat$stdres_ACS_Shift <- stdres(lm(TOT_ACS_Shift_33 ~ TOT_ACS_Shift_11, data = dat))
dat$stdres_ACS_total <- stdres(lm(TOT_ACS_33 ~ TOT_ACS_11, data = dat))
dat$stdres_EQ_Decenter <- stdres(lm(TOT_EQ_decenter_33 ~ TOT_EQ_decenter_11, data = dat))
dat$stdres_ERQ_Reappraisal <- stdres(lm(TOT_ERQ_Reappraisal_33 ~ TOT_ERQ_Reappraisal_11, data = dat))
dat$stdres_GAD_CSR <- stdres(lm(IA_ADISgad3309b ~ IA_ADISgad1109b, data = dat))
dat$stdres_MDD_CSR <- stdres(lm(IA_T33MDD_CSR_CUR_ALL ~ IA_T11MDD_CSR_CUR_ALL, data = dat))
Checking for outliers etc…
plot(stdres_ACS_Focus ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_ACS_Shift ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_ACS_total ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_ERQ_Reappraisal ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_EQ_Decenter ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_MDD_CSR ~ stdres_prepost_con4_10_54_32, dat)
plot(stdres_GAD_CSR ~ stdres_prepost_con4_10_54_32, dat)
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_ACS_Focus)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_ACS_Focus
t = -2.4198, df = 18, p-value = 0.02633
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.76929555 -0.06777341
sample estimates:
cor
-0.4954355
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_ACS_Shift)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_ACS_Shift
t = -2.1519, df = 18, p-value = 0.04523
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.74561432 -0.01228234
sample estimates:
cor
-0.4523445
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_ACS_total)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_ACS_total
t = -2.6071, df = 18, p-value = 0.01783
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.7843511 -0.1054634
sample estimates:
cor
-0.5235502
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_ERQ_Reappraisal)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_ERQ_Reappraisal
t = -0.72915, df = 18, p-value = 0.4753
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5692333 0.2952740
sample estimates:
cor
-0.1693786
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_EQ_Decenter)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_EQ_Decenter
t = -1.1995, df = 18, p-value = 0.2459
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.6377917 0.1937976
sample estimates:
cor
-0.2720544
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_MDD_CSR)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_MDD_CSR
t = 0.54549, df = 18, p-value = 0.5921
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.3338359 0.5395943
sample estimates:
cor
0.1275239
cor.test(dat$stdres_prepost_con4_10_54_32, dat$stdres_GAD_CSR)
Pearson's product-moment correlation
data: dat$stdres_prepost_con4_10_54_32 and dat$stdres_GAD_CSR
t = 1.8347, df = 18, p-value = 0.08314
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.05532568 0.71402123
sample estimates:
cor
0.3969126
library(cocor)
?cocor
## j = brain region, k = outcome A (attentional), h = outcome B (clinical/metacog.)
# dmPFC and ACS-Shift, vs. dmPFC and EQ-Decenter
r.jk <- cor(dat$stdres_ACS_Shift, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_EQ_Decenter, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_Shift, dat$stdres_EQ_Decenter)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.4523 and r.jh = -0.2721
Difference: r.jk - r.jh = -0.1803
Related correlation: r.kh = 0.7206
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.0837, p-value = 0.2785
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.5191 0.1448
Null hypothesis retained (Interval includes 0)
# dmPFC and ACS-Shift, vs. dmPFC and ERQ-Reappraisal
r.jk <- cor(dat$stdres_ACS_Shift, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_ERQ_Reappraisal, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_Shift, dat$stdres_ERQ_Reappraisal)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.4523 and r.jh = -0.1694
Difference: r.jk - r.jh = -0.283
Related correlation: r.kh = 0.5768
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.3641, p-value = 0.1725
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.6726 0.1166
Null hypothesis retained (Interval includes 0)
# dmPFC and ACS-Focus, vs. dmPFC and EQ-Decenter
r.jk <- cor(dat$stdres_ACS_Focus, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_EQ_Decenter, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_Focus, dat$stdres_EQ_Decenter)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.4954 and r.jh = -0.2721
Difference: r.jk - r.jh = -0.2234
Related correlation: r.kh = 0.6413
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.2062, p-value = 0.2277
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.5966 0.1363
Null hypothesis retained (Interval includes 0)
# dmPFC and ACS-Focus, vs. dmPFC and ERQ-Reappraisal
r.jk <- cor(dat$stdres_ACS_Focus, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_ERQ_Reappraisal, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_Focus, dat$stdres_ERQ_Reappraisal)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.4954 and r.jh = -0.1694
Difference: r.jk - r.jh = -0.3261
Related correlation: r.kh = 0.5443
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.5381, p-value = 0.1240
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.7260 0.0824
Null hypothesis retained (Interval includes 0)
# dmPFC and ACS total, vs. dmPFC and ERQ-Reappraisal
r.jk <- cor(dat$stdres_ACS_total, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_ERQ_Reappraisal, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_total, dat$stdres_ERQ_Reappraisal)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.5236 and r.jh = -0.1694
Difference: r.jk - r.jh = -0.3542
Related correlation: r.kh = 0.6454
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.9071, p-value = 0.0565
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.7196 0.0025
Null hypothesis retained (Interval includes 0)
# dmPFC and ACS total, vs. dmPFC and EQ-Decenter
r.jk <- cor(dat$stdres_ACS_total, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_EQ_Decenter, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_ACS_total, dat$stdres_EQ_Decenter)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = -0.5236 and r.jh = -0.2721
Difference: r.jk - r.jh = -0.2515
Related correlation: r.kh = 0.7694
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = -1.7013, p-value = 0.0889
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.5760 0.0354
Null hypothesis retained (Interval includes 0)
# dmPFC and GAD CSR, vs. dmPFC and MDD CSR
r.jk <- cor(dat$stdres_GAD_CSR, dat$stdres_prepost_con4_10_54_32)
r.jh <- cor(dat$stdres_MDD_CSR, dat$stdres_prepost_con4_10_54_32)
r.kh <- cor(dat$stdres_GAD_CSR, dat$stdres_MDD_CSR)
cocor.dep.groups.overlap(r.jk, r.jh, r.kh, n=20, alternative="two.sided", alpha=0.05, conf.level=0.95, null.value=0, return.htest=FALSE, test=c("steiger1980", "zou2007"))
Results of a comparison of two overlapping correlations based on dependent groups
Comparison between r.jk = 0.3969 and r.jh = 0.1275
Difference: r.jk - r.jh = 0.2694
Related correlation: r.kh = 0.4432
Group size: n = 20
Null hypothesis: r.jk is equal to r.jh
Alternative hypothesis: r.jk is not equal to r.jh (two-sided)
Alpha: 0.05
steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
z = 1.1115, p-value = 0.2664
Null hypothesis retained
zou2007: Zou's (2007) confidence interval
95% confidence interval for r.jk - r.jh: -0.1963 0.7050
Null hypothesis retained (Interval includes 0)
library(ggplot2)
ggplot(dat, aes(stdres_ACS_Shift, stdres_prepost_con4_10_54_32)) +
geom_point(size=2) +
labs(y = "Δ dmPFC (10, 54, 32)", x = "Δ ACS-Shift") +
ggtitle("Association between pre-post change in self-reported attentional \nshifting and change in dmPFC activation on iI vs. cI trials \n") +
geom_smooth(method=lm, linetype="solid", color="gray59", fill="lightgray") +
theme_light() +
theme(axis.text = element_text(size = 13), axis.title = element_text(size=14), plot.title = element_text(size=12))
ggsave("estroop-scatter_acs_shift.png",dpi=700)
Saving 5.5 x 5.5 in image
ggplot(dat, aes(stdres_ACS_Focus, stdres_prepost_con4_10_54_32)) +
geom_point(size=2) +
labs(y = "Δ dmPFC (10, 54, 32)", x = "Δ ACS-Focus") +
ggtitle("Association between pre-post change in self-reported attentional \nfocus and change in dmPFC activation on iI vs. cI trials \n") +
geom_smooth(method=lm, linetype="solid", color="gray59", fill="lightgray") +
theme_light() +
theme(axis.text = element_text(size = 13), axis.title = element_text(size=14), plot.title = element_text(size=12))
ggsave("estroop-scatter_acs_focus.png",dpi=700)
Saving 5.5 x 5.5 in image
ggplot(dat, aes(stdres_ACS_total, stdres_prepost_con4_10_54_32)) +
geom_point(size=2) +
labs(y = "Δ dmPFC (10, 54, 32)", x = "Δ ACS Total") +
ggtitle("Association between pre-post change in self-reported attentional \ncontrol and change in dmPFC activation on iI vs. cI trials \n") +
geom_smooth(method=lm, linetype="solid", color="gray59", fill="lightgray") +
theme_light() +
theme(axis.text = element_text(size = 13), axis.title = element_text(size=14), plot.title = element_text(size=12))
ggsave("estroop-scatter_acs_total.png",dpi=700)
Saving 5.5 x 5.5 in image