OSCR

The effects of approach bias modification on smoking cue-reactivity in individuals who smoke: A randomized controlled fMRI study.

Code ↔ Paper

5 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 5 matches
  1. [1] § Interventions › Neuroimaging data ↔ fMRI Analysis/analysis scripts/063CBM ApBM Effects fMRI OSF.R, lines 434 to 475 · score 0.92 · medial prefrontal cortex, left angular gyrus, nucleus accumbens, dorsal striatum, right thalamus, smoking cue reactivity · Report a mismatch
  2. [2] § Results › Region of interest analysis ↔ fMRI Analysis/analysis scripts/063CBM ApBM Effects fMRI OSF.R, lines 434 to 475 · score 0.88 · medial prefrontal cortex, left angular gyrus, nucleus accumbens, dorsal striatum, right thalamus, activity · Report a mismatch
  3. [3] § Interventions › Data analysis › Data preprocessing and measure extraction › Behavioral data ↔ AAT_data_precprocessing.R, lines 133 to 174 · score 0.77 · pushsmoking pullsmoking, pull movements, untrained smoking related, joystick, picture, preprocessed · Report a mismatch
  4. [4] § Interventions › Statistical analysis ↔ fMRI Analysis/analysis scripts/063CBM ApBM Effects fMRI OSF.R, lines 612 to 678 · score 0.70 · pre post change, craving ratings, lme4, Cue reactivity, models, predictors · Report a mismatch
  5. [5] § Interventions › Study Arms: Approach bias modification, sham training, and TAU-only ↔ AAT_data_precprocessing.R, lines 1 to 42 · score 0.66 · smoking related pictures, positive pictures, Sham training, ApBm, joystick, bias · Report a mismatch

Paper

Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 678 lines · 39 KB · no license · 3 matches

  1. ### load packages
  2. library("readxl")
  3. library(data.table)
  4. library("writexl")
  5. library(tidyverse)
  6. library("Hmisc")
  7. library(powerjoin)
  8. library(pastecs)
  9. library(haven)
  10. library(naniar)
  11. #install.packages("rcompanion")
  12. library(rcompanion)
  13. library(ltm)
  14. library(tidyverse)
  15. library(ggpubr)
  16. library(rstatix)
  17. library(broom)
  18. library(writexl)
  19. library(openxlsx)
  20. library(psych)
  21. library(janitor)
  22. library(dplyr)
  23. library(sjmisc)
  24. #install.packages("jtools")
  25. library(jtools)
  26. #install.packages("interactions")
  27. library(interactions)
  28. library(emmeans)
  29. library(lmerTest)
  30. #install.packages("effects")
  31. #library(effects)
  32. library(sjPlot)
  33. library(haven)
  34. options(scipen=9999)
  35. #install.packages("effsize")
  36. #library(effsize)
  37. library(lsr)
  38. library(scales)
  39. library(effectsize)
  40. library(readxl)
  41. #################################################################
  42. ## LOAD DATA
  43. #################################################################
  44. data <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_fMRI_intervention.xlsx")
  45. data[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  46. data_long2 <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_long2.xlsx")
  47. data_long2[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_long2[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  48. data_ApBM <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_ApBM.xlsx")
  49. data_ApBM[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_ApBM[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  50. data_Sham <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_Sham.xlsx")
  51. data_Sham[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_Sham[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  52. data_TAU <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_TAU.xlsx")
  53. data_TAU[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_TAU[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  54. ROIs <- c("ACC_L", "Angular_L", "Thalamus_R", "dorsal_Striatum_R", "MCC_R", "SupraMarginal_R", "Precuneus_R", "AMY_Bilateral", "Nacc_Bilateral", "mPFC")
  55. ROIs_CIGminNEU.t1 <- c("ACC_L_CIGminNEU.t1", "Angular_L_CIGminNEU.t1", "Thalamus_R_CIGminNEU.t1", "dorsal_Striatum_R_CIGminNEU.t1", "MCC_R_CIGminNEU.t1", "SupraMarginal_R_CIGminNEU.t1", "Precuneus_R_CIGminNEU.t1", "AMY_Bilateral_CIGminNEU.t1", "Nacc_Bilateral_CIGminNEU.t1", "mPFC_CIGminNEU.t1")
  56. ROIs_CIG.t2 <- c("rsum_AAL3_ACC_L_mean_cigarettes.t2", "rAAL3_Angular_L_mean_cigarettes.t2", "rsum_AAL3_Thalamus_R_mean_cigarettes.t2", "rsum_AAL3_dorsal_Striatum_R_mean_cigarettes.t2", "rspmT_0001_mask_cluster_782_MCC_R_mean_cigarettes.t2", "rspmT_0001_mask_cluster_381_SupraMarginal_R_mean_cigarettes.t2", "rspmT_0001_mask_cluster_336_Precuneus_R_mean_cigarettes.t2", "rAAL3_AMY_Bilateral_mean_cigarettes.t2", "rAAL3_Nacc_Bilateral_mean_cigarettes.t2", "rMedFC_HarvardOxford_thr25_mPFC_mean_cigarettes.t2")
  57. ROIs_CIG.t1 <- c("rsum_AAL3_ACC_L_mean_cigarettes.t1", "rAAL3_Angular_L_mean_cigarettes.t1", "rsum_AAL3_Thalamus_R_mean_cigarettes.t1", "rsum_AAL3_dorsal_Striatum_R_mean_cigarettes.t1", "rspmT_0001_mask_cluster_782_MCC_R_mean_cigarettes.t1", "rspmT_0001_mask_cluster_381_SupraMarginal_R_mean_cigarettes.t1", "rspmT_0001_mask_cluster_336_Precuneus_R_mean_cigarettes.t1", "rAAL3_AMY_Bilateral_mean_cigarettes.t1", "rAAL3_Nacc_Bilateral_mean_cigarettes.t1", "rMedFC_HarvardOxford_thr25_mPFC_mean_cigarettes.t1")
  58. ################################################################################
  59. # HYPOTHESIS 0: APPETITIVE RESPONSES AT T0
  60. ################################################################################
  61. ### AAT
  62. # all trials
  63. shapiro.test(data$AAT_finalRT_pushSMOminpullSMO_t1) #--> sig. --> no normal distribution
  64. stat.desc(data$AAT_finalRT_pushSMOminpullSMO_t1)
  65. t.test(data$AAT_finalRT_pushSMOminpullSMO_t1, mu = 0)
  66. AAT_w <- wilcox.test(data$AAT_finalRT_pushSMOminpullSMO_t1, mu=0, alternative = c("two.sided"))
  67. AAT_w
  68. wilcoxonZ(data$AAT_finalRT_pushSMOminpullSMO_t1, paired=F, exact=FALSE, correct=FALSE)
  69. summary(aov(AAT_finalRT_pushSMOminpullSMO_t1 ~ group, data = data))
  70. describeBy(data$AAT_finalRT_pushSMOminpullSMO_t1, data$group, mat = TRUE, digits = 2)
  71. # untrained trials
  72. shapiro.test(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained) #--> sig. --> no normal distribution
  73. stat.desc(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained)
  74. stat.desc(data$AAT_finalRT_pushSMOminpullSMO_t2_untrained)
  75. t.test(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained, mu = 0)
  76. AAT_w <- wilcox.test(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained, mu=0, alternative = c("two.sided"))
  77. AAT_w
  78. wilcoxonZ(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained, paired=F, exact=FALSE, correct=FALSE)
  79. data %>% wilcox_effsize(AAT_finalRT_pushSMOminpullSMO_t1_untrained ~ 1, mu = 0)
  80. summary(aov(AAT_finalRT_pushSMOminpullSMO_t1_untrained ~ group, data = data))
  81. describeBy(data$AAT_finalRT_pushSMOminpullSMO_t1_untrained, data$group, mat = TRUE, digits = 3)
  82. describeBy(data$AAT_finalRT_pushSMOminpullSMO_t2_untrained, data$group, mat = TRUE, digits = 3)
  83. ### CRAVING RATING
  84. shapiro.test(data$craving_rating_smoking_t1) #--> sig. --> no normal distribution
  85. shapiro.test(data$craving_rating_neutral_t1) #--> sig. --> no normal distribution
  86. stat.desc(data$craving_rating_smoking_t1)
  87. stat.desc(data$craving_rating_smoking_t2)
  88. stat.desc(data$craving_rating_neutral_t1)
  89. t.test(data$craving_rating_smoking_t1, data$craving_rating_neutral_t1, paired = T, alternative = "two.sided")
  90. craving_rating_w <- wilcox.test(data$craving_rating_smoking_t1, data$craving_rating_neutral_t1, paired = TRUE, exact = F, correct = TRUE, conf.int = TRUE)
  91. craving_rating_w
  92. wilcoxonZ(x = data$craving_rating_smoking_t1, y = data$craving_rating_neutral_t1, paired=TRUE, exact=FALSE, correct=FALSE)
  93. data_long <- data %>% pivot_longer(cols = starts_with("craving_rating_smoking_t1") | starts_with("craving_rating_neutral_t1"), names_to = "condition", values_to = "value")
  94. data_long %>% wilcox_effsize(value ~ condition, paired = TRUE)
  95. summary(aov(craving_rating_smoking_t1 ~ group, data = data))
  96. describeBy(data$craving_rating_smoking_t1, data$group, mat = TRUE, digits = 3)
  97. describeBy(data$craving_rating_smoking_t2, data$group, mat = TRUE, digits = 3)
  98. ### fMRI
  99. results <- data.frame(Variable = character(), Test = character(), Statistic = numeric(), DF = numeric(), p_value = numeric(), EffectSize = numeric(), Mean = numeric(), SD = numeric(), stringsAsFactors = FALSE)
  100. for (ROI in ROIs_CIGminNEU.t1) {
  101. x <- data[[ROI]]
  102. shapiro_res <- shapiro.test(x)
  103. desc_stats <- stat.desc(x)
  104. df <- NA
  105. effect_size <- NA
  106. if (shapiro_res$p.value > 0.05) {
  107. test_res <- t.test(x, mu = 0, alternative = "two.sided")
  108. test_name <- "t-test"
  109. stat_value <- test_res$statistic
  110. df <- test_res$parameter
  111. p_value <- test_res$p.value
  112. effect_size <- lsr::cohensD(x, mu = 0)
  113. } else {
  114. test_res <- wilcox.test(x, mu = 0, alternative = "two.sided")
  115. wilcox_z <- wilcoxonZ(x, mu = 0, paired = FALSE, exact = FALSE, correct = FALSE)
  116. test_name <- "Wilcoxon test"
  117. stat_value <- wilcox_z
  118. p_value <- test_res$p.value
  119. effect_size <- data.frame(x = x) %>% wilcox_effsize(x ~ 1, mu = 0) %>% pull(effsize)
  120. }
  121. results <- rbind(results, data.frame(Variable = ROI, Test = test_name, Statistic = stat_value,
  122. DF = df, p_value = p_value, EffectSize = effect_size, Mean = desc_stats["mean"],
  123. SD = desc_stats["std.dev"], stringsAsFactors = FALSE))
  124. }
  125. print(results)
  126. p.adjust(c(results$p_value), method = "BH")
  127. ################################################################################
  128. ## HYPOTHESIS 1: PRE-POST CHANGES
  129. ################################################################################
  130. ### AAT #n=116, because CBM287 excluded at t0 and no t1 participation
  131. res_AAT_t0t1 <- lmer(AAT_untrained ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  132. summary(res_AAT_t0t1)
  133. confint(res_AAT_t0t1)
  134. Anova(res_AAT_t0t1, type = 3, test.statistic = "F")
  135. plot_model_AAT_t0t1_2 <- interact_plot(res_AAT_t0t1, pred = t1, modx = group, plot.points = TRUE)
  136. plot_model_AAT_t0t1_2
  137. ### CRAVING RATING
  138. res_CRAVING_t0t1 <- lmer(Craving_Rating ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  139. summary(res_CRAVING_t0t1)
  140. confint(res_CRAVING_t0t1)
  141. Anova(res_CRAVING_t0t1, type = 3, test.statistic = "F")
  142. plot_model_CRAVING_t0t1 <- interact_plot(res_CRAVING_t0t1, pred = t1, modx = group, plot.points = TRUE)
  143. plot_model_CRAVING_t0t1
  144. ### fMRI smoking cue-reactivity
  145. results <- list()
  146. plots <- list()
  147. anova_results_smoking_cue_reactivity <- data.frame(Region = character(), Df_t1 = numeric(), Df_res_t1 = numeric(), F_value_t1 = numeric(), Pr_t1 = numeric(), Df_t1_group = numeric(), Df_res_t1_group = numeric(), F_value_t1_group = numeric(), Pr_t1_group = numeric(), stringsAsFactors = FALSE)
  148. for (region in ROIs) {
  149. formula <- as.formula(paste0(region, " ~ t1 * group + (1 | subject) + (1 | course)"))
  150. model <- lmer(formula, data = data_long2)
  151. anova_res <- Anova(model, type = 3, test.statistic = "F")
  152. plot_model <- interact_plot(model, pred = t1, modx = group, plot.points = TRUE)
  153. results[[region]] <- list(summary = summary(model), anova = anova_res, plot = plot_model)
  154. anova_results_smoking_cue_reactivity <- rbind(anova_results_smoking_cue_reactivity, data.frame(
  155. Region = region,
  156. Df_time = anova_res["t1", "Df"],
  157. Df_res_time = anova_res["t1", "Df.res"],
  158. F_value_time = anova_res["t1", "F"],
  159. p_time = anova_res["t1", "Pr(>F)"],
  160. Df_inter_time_group = anova_res["t1:group", "Df"],
  161. Df_res_inter_time_group = anova_res["t1:group", "Df.res"],
  162. F_value_inter_time_group = anova_res["t1:group", "F"],
  163. p_inter_time_group = anova_res["t1:group", "Pr(>F)"]))
  164. print(plot_model)
  165. }
  166. print(anova_results_smoking_cue_reactivity)
  167. p.adjust(c(anova_results_smoking_cue_reactivity$p_time), method = "BH")
  168. p.adjust(c(anova_results_smoking_cue_reactivity$p_inter_time_group), method = "BH")
  169. # Precuneus_R
  170. res_Precuneus_R <- lmer(Precuneus_R ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  171. summary(res_Precuneus_R)
  172. Anova(res_Precuneus_R, type = 3, test.statistic = "F")
  173. interact_plot(res_Precuneus_R, pred = t1, modx = group, plot.points = TRUE)
  174. # SupraMarginal_R
  175. res_SupraMarginal_R <- lmer(SupraMarginal_R ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  176. summary(res_SupraMarginal_R)
  177. Anova(res_SupraMarginal_R, type = 3, test.statistic = "F")
  178. interact_plot(res_SupraMarginal_R, pred = t1, modx = group, plot.points = TRUE)
  179. # MCC_R
  180. res_MCC_R <- lmer(MCC_R ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  181. summary(res_MCC_R)
  182. Anova(res_MCC_R, type = 3, test.statistic = "F")
  183. interact_plot(res_MCC_R, pred = t1, modx = group, plot.points = TRUE)
  184. # ACC_L
  185. res_ACC_L <- lmer(ACC_L ~ t1 * group + (1 | subject) + (1 | course), data = data_long2)
  186. summary(res_ACC_L)
  187. Anova(res_ACC_L, type = 3, test.statistic = "F")
  188. interact_plot(res_ACC_L, pred = t1, modx = group, plot.points = TRUE)
  189. # Loop across all ROIs
  190. results <- data.frame(ROI = character(0), F_value = numeric(0), p_value = numeric(0), stringsAsFactors = FALSE)
  191. for (i in seq_along(ROIs_CIG.t2)) {
  192. t2 <- ROIs_CIG.t2[i]
  193. t1 <- ROIs_CIG.t1[i]
  194. model <- lm(as.formula(paste(t2, "~ group +", t1)), data = data)
  195. anova_res <- Anova(model, type = 3, test.statistic = "F")
  196. F_value <- anova_res$`F value`[2]
  197. p_value <- anova_res$`Pr(>F)`[2]
  198. results <- rbind(results, data.frame(ROI = t2, F_value = F_value, p_value = p_value))
  199. p <- ggplot(data, aes_string(x = t1, y = t2, color = "as.factor(group)")) +
  200. geom_point() +
  201. geom_smooth(method = "lm", se = TRUE) +
  202. labs(x = paste("AMY Bilateral Mean (T1):", t1),
  203. y = paste("AMY Bilateral Mean (T2):", t2),
  204. color = "Group") +
  205. theme_minimal()
  206. print(p)
  207. }
  208. print(results)
  209. # rAAL3_AMY_Bilateral_mean_cigarettes
  210. model_AMY <- lm(rAAL3_AMY_Bilateral_mean_cigarettes.t2 ~ group + rAAL3_AMY_Bilateral_mean_cigarettes.t1, data = data)
  211. summary(model_AMY)
  212. # rAAL3_Angular_L_mean_cigarettes
  213. model_Angular <- lm(rAAL3_Angular_L_mean_cigarettes.t2 ~ group + rAAL3_Angular_L_mean_cigarettes.t1, data = data)
  214. summary(model_Angular)
  215. #################################################################
  216. ## HYPOTHESIS 2: ASSOCIATION CHANGES IN CUE-REACTIVITY - ABSTINENCE RATES
  217. #################################################################
  218. ### DESCRIPTIVE STATISTICS
  219. # post intervention
  220. chisq.test(data$abstinence.t2, data$group)
  221. tabyl(data, abstinence.t2)
  222. tabyl(data, abstinence.t2, group)
  223. tabyl(data, abstinence.t2, group) %>%
  224. adorn_percentages("col") %>%
  225. adorn_pct_formatting(digits = 2)
  226. # follow up
  227. chisq.test(data$abstinence.t3, data$group)
  228. chisq.test(data[data$group %in% c(1, 2), ]$abstinence.t3, data[data$group %in% c(1, 2), ]$group) # calculated because TAU+ApBM: 11 of 42 [26.2%], TAU+Sham: 6 of 36 [16.7%]
  229. tabyl(data, abstinence.t3)
  230. tabyl(data, abstinence.t3, group)
  231. tabyl(data, abstinence.t3, group) %>%
  232. adorn_percentages("col") %>%
  233. adorn_pct_formatting(digits = 2)
  234. ### ABSTINENCE AT POST
  235. anova_results_abs_fMRI_post <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  236. for (ROI in ROIs) {
  237. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  238. res_abs <- glm(as.formula(paste0("abstinence.t2 ~", ROI_t0minust1, " * group")), family = binomial, data = data)
  239. anova_res <- Anova(res_abs, type = 3, test.statistic = "F")
  240. residuals_df <- anova_res$Df[4]
  241. main_effect_df <- anova_res$Df[1]
  242. main_effect_f <- anova_res$`F value`[1]
  243. main_effect_p <- anova_res$`Pr(>F)`[1]
  244. interaction_df <- anova_res$Df[3]
  245. interaction_f <- anova_res$`F value`[3]
  246. interaction_p <- anova_res$`Pr(>F)`[3]
  247. anova_results_abs_fMRI_post <- rbind(anova_results_abs_fMRI_post, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  248. plots <- plot_model(res_abs, type = "int")
  249. print(plots)
  250. }
  251. print(anova_results_abs_fMRI_post)
  252. p.adjust(c(anova_results_abs_fMRI_post$MainEffect_P), method = "BH")
  253. p.adjust(c(anova_results_abs_fMRI_post$Interaction_P), method = "BH")
  254. # Contrasts for AMY_Bilateral
  255. res_abs_AMY_Bilateral_post <- glm(abstinence.t2 ~ AMY_Bilateral_t0minust1 * group, family = binomial, data=data)
  256. res_AMY_Bilateral_abstinence_post_emtrends <- emtrends(res_abs_AMY_Bilateral_post, ~ 1, var = "AMY_Bilateral_t0minust1")
  257. summary(res_AMY_Bilateral_abstinence_post_emtrends)
  258. plot_model(res_abs_AMY_Bilateral_post, type = "pred", terms = "AMY_Bilateral_t0minust1") + labs(x = "AMY_Bilateral_t0minust1", y = "Wahrscheinlichkeit für Abstinenz (t2)") + theme_minimal()
  259. ### ABSTINENCE AT FOLLOW-UP
  260. anova_results_abs_fMRI_FU <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  261. for (ROI in ROIs) {
  262. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  263. res_abs <- glm(as.formula(paste0("abstinence.t3 ~", ROI_t0minust1, " * group")), family = binomial, data = data)
  264. anova_res <- Anova(res_abs, type = 3, test.statistic = "F")
  265. residuals_df <- anova_res$Df[4]
  266. main_effect_df <- anova_res$Df[1]
  267. main_effect_f <- anova_res$`F value`[1]
  268. main_effect_p <- anova_res$`Pr(>F)`[1]
  269. interaction_df <- anova_res$Df[3]
  270. interaction_f <- anova_res$`F value`[3]
  271. interaction_p <- anova_res$`Pr(>F)`[3]
  272. anova_results_abs_fMRI_FU <- rbind(anova_results_abs_fMRI_FU, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  273. plots <- plot_model(res_abs, type = "int")
  274. print(plots)
  275. }
  276. print(anova_results_abs_fMRI_FU)
  277. p.adjust(c(anova_results_abs_fMRI_FU$MainEffect_P), method = "BH")
  278. p.adjust(c(anova_results_abs_fMRI_FU$Interaction_P), method = "BH")
  279. ### Precuneus_R
  280. res_abs_Precuneus_R_FU <- glm(abstinence.t3 ~ Precuneus_R_t0minust1 * group, family = binomial, data=data)
  281. res_Precuneus_R_abstinence_FU_emtrends <- emtrends(res_abs_Precuneus_R_FU, ~ group, var = "Precuneus_R_t0minust1")
  282. summary(res_Precuneus_R_abstinence_FU_emtrends)
  283. plot_interaction <- interact_plot(res_abs_Precuneus_R_FU,
  284. pred = Precuneus_R_t0minust1,
  285. modx = group,
  286. x.label = "t0-t1 change in smoking cue-reactivity",
  287. y.label = "Probability for abstinence at t2",
  288. vary.lty = FALSE,
  289. ggplot_component = TRUE) +
  290. scale_y_continuous(labels = percent, limits = c(0, 1)) +
  291. scale_color_manual(name = "Group",
  292. labels = c("TAU-only", "TAU+Sham", "TAU+ApBM"),
  293. values = c("blue", "green", "red"))
  294. plot_interaction
  295. ggsave("plot_interaction.jpg", plot = plot_interaction, width = 5, height = 4, dpi = 600)
  296. ### SupraMarginal_R
  297. res_abs_SupraMarginal_R_FU <- glm(abstinence.t3 ~ SupraMarginal_R_t0minust1 * group, family = binomial, data=data)
  298. res_SupraMarginal_R_abstinence_FU_emtrends <- emtrends(res_abs_SupraMarginal_R_FU, ~ group, var = "SupraMarginal_R_t0minust1")
  299. summary(res_SupraMarginal_R_abstinence_FU_emtrends)
  300. ###############################################################################
  301. ## HYPOTHESIS 3: ASSOCIATION fMRI - BEHAVIORAL DATA
  302. ###############################################################################
  303. ### AAT
  304. result_table_AAT_untrained_ROIs_lm <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  305. for (ROI in ROIs) {
  306. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  307. res_AAT_fMRI <- lm(as.formula(paste0("AAT_score_untrained_t0minust1 ~", ROI_t0minust1, " * group")), data = data)
  308. anova_res <- Anova(res_AAT_fMRI, type = 3, test.statistic = "F")
  309. residuals_df <- anova_res$Df[5]
  310. main_effect_df <- anova_res$Df[2]
  311. main_effect_f <- anova_res$`F value`[2]
  312. main_effect_p <- anova_res$`Pr(>F)`[2]
  313. interaction_df <- anova_res$Df[4]
  314. interaction_f <- anova_res$`F value`[4]
  315. interaction_p <- anova_res$`Pr(>F)`[4]
  316. result_table_AAT_untrained_ROIs_lm <- rbind(result_table_AAT_untrained_ROIs_lm, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  317. plots <- plot_model(res_AAT_fMRI, type = "int")
  318. print(plots)
  319. }
  320. print(result_table_AAT_untrained_ROIs_lm)
  321. p.adjust(c(result_table_AAT_untrained_ROIs_lm$MainEffect_P), method = "BH")
  322. p.adjust(c(result_table_AAT_untrained_ROIs_lm$Interaction_P), method = "BH")
  323. ### CRAVING RATING
  324. result_table_craving_rating_ROIs_lm <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  325. for (ROI in ROIs) {
  326. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  327. res_craving_rating_fMRI <- lm(as.formula(paste0("craving_rating_smoking_t0minust1 ~", ROI_t0minust1, " * group")), data = data)
  328. anova_res <- Anova(res_craving_rating_fMRI, type = 3, test.statistic = "F")
  329. residuals_df <- anova_res$Df[5]
  330. main_effect_df <- anova_res$Df[2]
  331. main_effect_f <- anova_res$`F value`[2]
  332. main_effect_p <- anova_res$`Pr(>F)`[2]
  333. interaction_df <- anova_res$Df[4]
  334. interaction_f <- anova_res$`F value`[4]
  335. interaction_p <- anova_res$`Pr(>F)`[4]
  336. result_table_craving_rating_ROIs_lm <- rbind(result_table_craving_rating_ROIs_lm, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  337. plots <- plot_model(res_craving_rating_fMRI, type = "int")
  338. print(plots)
  339. }
  340. print(result_table_craving_rating_ROIs_lm)
  341. p.adjust(c(result_table_craving_rating_ROIs_lm$MainEffect_P), method = "BH")
  342. p.adjust(c(result_table_craving_rating_ROIs_lm$Interaction_P), method = "BH")
  343. # ACC_L
  344. res_craving_rating_ACC_L <- lm(craving_rating_smoking_t0minust1 ~ ACC_L_t0minust1 * group, data=data)
  345. res_craving_rating_ACC_L_emtrends <- emtrends(res_craving_rating_ACC_L, ~ 1, var = "ACC_L_t0minust1")
  346. summary(res_craving_rating_ACC_L_emtrends)
  347. plot_model(res_craving_rating_ACC_L, type = "pred", terms = "ACC_L_t0minust1") + labs(x = "ACC_L_t0minust1", y = "craving_rating_smoking_t0minust1") + theme_minimal()
  348. ###############################################################################
  349. ## SUPPLEMENTAL: ASSOCIATION fMRI - SMOKING-RELATED VARIABLES
  350. ###############################################################################
  351. ### Cigarettes per day # CPD.CDS12_t0minust1
  352. result_table_CPD.CDS12_ROIs_lm <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  353. for (ROI in ROIs) {
  354. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  355. formula <- as.formula(paste0("CPD.CDS12_t0minust1 ~ ", ROI_t0minust1, " * group"))
  356. model <- lm(formula, data = data)
  357. model_anova <- Anova(model, type = 3, test.statistic = "F")
  358. residuals_df <- model_anova$Df[5]
  359. main_effect_df <- model_anova$Df[2]
  360. main_effect_f <- model_anova$`F value`[2]
  361. main_effect_p <- model_anova$`Pr(>F)`[2]
  362. interaction_df <- model_anova$Df[4]
  363. interaction_f <- model_anova$`F value`[4]
  364. interaction_p <- model_anova$`Pr(>F)`[4]
  365. result_table_CPD.CDS12_ROIs_lm <- rbind(result_table_CPD.CDS12_ROIs_lm, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  366. plots <- interact_plot(model, pred = !!ROI_t0minust1, modx = group, plot.points = TRUE, x.label = ROI_t0minust1, y.label = "craving_rating_smoking_t0minust1", legend.main = "Group")
  367. print(plots)
  368. }
  369. print(result_table_CPD.CDS12_ROIs_lm)
  370. p.adjust(c(result_table_CPD.CDS12_ROIs_lm$main_effect_p), method = "BH")
  371. p.adjust(c(result_table_CPD.CDS12_ROIs_lm$interaction_p), method = "BH")
  372. ### CDS12
  373. result_table_CDS12_ROIs_lm <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  374. for (ROI in ROIs) {
  375. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  376. formula <- as.formula(paste0("CDS12_t0minust1 ~ ", ROI_t0minust1, " * group"))
  377. model <- lm(formula, data = data)
  378. model_anova <- Anova(model, type = 3, test.statistic = "F")
  379. residuals_df <- model_anova$Df[5]
  380. main_effect_df <- model_anova$Df[2]
  381. main_effect_f <- model_anova$`F value`[2]
  382. main_effect_p <- model_anova$`Pr(>F)`[2]
  383. interaction_df <- model_anova$Df[4]
  384. interaction_f <- model_anova$`F value`[4]
  385. interaction_p <- model_anova$`Pr(>F)`[4]
  386. result_table_CDS12_ROIs_lm <- rbind(result_table_CDS12_ROIs_lm, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  387. plots <- interact_plot(model, pred = !!ROI_t0minust1, modx = group, plot.points = TRUE, x.label = ROI_t0minust1, y.label = "craving_rating_smoking_t0minust1", legend.main = "Group")
  388. print(plots)
  389. }
  390. print(result_table_CDS12_ROIs_lm)
  391. p.adjust(c(result_table_CDS12_ROIs_lm$main_effect_p), method = "BH")
  392. p.adjust(c(result_table_CDS12_ROIs_lm$interaction_p), method = "BH")
  393. ### CO value # CO_fMRT.t1
  394. result_table_CO_fMRT_ROIs_lm <- data.frame(ROI = character(),Residuals_Df = numeric(),MainEffect_Df = numeric(),MainEffect_F = numeric(),MainEffect_P = numeric(),Interaction_Df = numeric(),Interaction_F = numeric(),Interaction_P = numeric(),stringsAsFactors = FALSE)
  395. for (ROI in ROIs) {
  396. ROI_t0minust1 <- paste0(ROI, "_t0minust1")
  397. formula <- as.formula(paste0("CO_fMRT_t0minust1 ~ ", ROI_t0minust1, " * group"))
  398. model <- lm(formula, data = data)
  399. model_anova <- Anova(model, type = 3, test.statistic = "F")
  400. residuals_df <- model_anova$Df[5]
  401. main_effect_df <- model_anova$Df[2]
  402. main_effect_f <- model_anova$`F value`[2]
  403. main_effect_p <- model_anova$`Pr(>F)`[2]
  404. interaction_df <- model_anova$Df[4]
  405. interaction_f <- model_anova$`F value`[4]
  406. interaction_p <- model_anova$`Pr(>F)`[4]
  407. result_table_CO_fMRT_ROIs_lm <- rbind(result_table_CO_fMRT_ROIs_lm, data.frame(ROI = ROI,Residuals_Df = residuals_df,MainEffect_Df = main_effect_df,MainEffect_F = main_effect_f,MainEffect_P = main_effect_p,Interaction_Df = interaction_df,Interaction_F = interaction_f,Interaction_P = interaction_p))
  408. plots <- interact_plot(model, pred = !!ROI_t0minust1, modx = group, plot.points = TRUE, x.label = ROI_t0minust1, y.label = "craving_rating_smoking_t0minust1", legend.main = "Group")
  409. print(plots)
  410. }
  411. print(result_table_CO_fMRT_ROIs_lm)
  412. p.adjust(c(result_table_CO_fMRT_ROIs_lm$main_effect_p), method = "BH")
  413. p.adjust(c(result_table_CO_fMRT_ROIs_lm$interaction_p), method = "BH")
  414. #################################################################
  415. ## PLOTS
  416. #################################################################
  417. ############################# SMOKING CUE-REACTIVITY AT T0
  418. roi_labels <- c("Left ACC", "Left angular gyrus", "Right thalamus", "Dorsal striatum",
  419. "MCC", "Supramarginal gyrus", "Precuneus",
  420. "Amygdala", "Nucleus accumbens", "medial prefrontal cortex")
  421. plot_data <- data %>%
  422. select(all_of(ROIs_CIGminNEU.t1)) %>%
  423. pivot_longer(cols = everything(), names_to = "ROI", values_to = "Activity") %>%
  424. mutate(ROI = factor(ROI, levels = ROIs_CIGminNEU.t1, labels = roi_labels))
  425. # Calculate mean
  426. mean_values <- plot_data %>%
  427. group_by(ROI) %>%
  428. summarise(mean_activity = mean(Activity, na.rm = TRUE))
  429. # Boxplot with means
  430. ggplot(plot_data, aes(x = ROI, y = Activity)) +
  431. geom_boxplot(fill = "skyblue", alpha = 0.5, outlier.shape = NA) +
  432. geom_point(data = mean_values, aes(x = ROI, y = mean_activity), shape = 23, size = 3, fill = "red") +
  433. geom_hline(yintercept = 0, color = "darkblue", size = 1) + # Dunkelblaue 0-Linie
  434. theme_minimal() +
  435. labs(x = "Region of interest",
  436. y = "Smoking cue-reactivity at t0",
  437. title = "Activity Distribution in each region of interest at t1") +
  438. theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
  439. ylim(-0.3, 0.5)
  440. ############################# SMOKING CUE-REACTIVITY CHANGE FROM T0 TO T1
  441. ROIs_t0minust1 <- c("ACC_L_t0minust1", "Angular_L_t0minust1", "Thalamus_R_t0minust1", "dorsal_Striatum_R_t0minust1", "MCC_R_t0minust1", "SupraMarginal_R_t0minust1", "Precuneus_R_t0minust1", "AMY_Bilateral_t0minust1", "Nacc_Bilateral_t0minust1", "mPFC_t0minust1")
  442. roi_labels <- c("ACC (L)", "AngularG (L)", "Thal (R)", "Striatum (d)",
  443. "MCC (R)", "SupramarG (R)", "Precuneus (R)",
  444. "Amygdala", "NAcc", "mPFC")
  445. plot_data <- data %>% select(group, all_of(ROIs_t0minust1)) %>% pivot_longer(cols = all_of(ROIs_t0minust1), names_to = "ROI", values_to = "Activity") %>% mutate(ROI = factor(ROI, levels = ROIs_t0minust1, labels = roi_labels))
  446. mean_data <- plot_data %>% group_by(group, ROI) %>%summarise(Mean = mean(Activity, na.rm = TRUE),SD = sd(Activity, na.rm = TRUE),SE = SD / sqrt(n()), .groups = 'drop')
  447. boxplots <- ggplot(plot_data, aes(x = ROI, y = Activity, fill = factor(group))) +
  448. geom_boxplot(alpha = 0.5, outlier.shape = NA) +
  449. geom_point(data = mean_data, aes(x = ROI, y = Mean, fill = factor(group)),
  450. shape = 23, size = 3, color = "black", position = position_dodge(0.75)) +
  451. geom_hline(yintercept = 0, color = "darkblue", size = 1) +
  452. theme_minimal() +
  453. labs(x = "Region of interest", y = "Smoking cue-reactivity change (t0-t1)", fill = "Group") +
  454. theme(axis.text.x = element_text(angle = 45, hjust = 0.7, size = 13),
  455. axis.title.x = element_text(size = 14, face = "bold", margin = margin(t = 0.1)),
  456. axis.title.y = element_text(size = 14, face = "bold")) +
  457. ylim(-0.5, 0.6) +
  458. scale_fill_manual(values = c("blue", "green", "red"), labels = c("TAU-only", "TAU+Sham", "TAU+ApBM"))
  459. boxplots
  460. ggsave("boxplots.jpg", plot = boxplots, width = 10, height = 6, dpi = 600)
  461. describeBy(data$ACC_L_t0minust1, data$group, mat = TRUE, digits=3)
  462. describeBy(data$MCC_R_t0minust1, data$group, mat = TRUE, digits=3)
  463. describeBy(data$mPFC_t0minust1, data$group, mat = TRUE, digits=3)
  464. describeBy(data$Precuneus_R_t0minust1, data$group, mat = TRUE, digits=3)
  465. describeBy(data$SupraMarginal_R_t0minust1, data$group, mat = TRUE, digits=3)
  466. describeBy(data$N_Acc_L_t0minust1, data$group, mat = TRUE, digits=3)
  467. describeBy(data$N_Acc_R_t0minust1, data$group, mat = TRUE, digits=3)
  468. describeBy(data$Olfactory_R_t0minust1, data$group, mat = TRUE, digits=3)
  469. describeBy(data$Thalamus_R_t0minust1, data$group, mat = TRUE, digits=3)
  470. describeBy(data$dorsal_Striatum_R_t0minust1, data$group, mat = TRUE, digits=3)
  471. describeBy(data$Angular_L_t0minust1, data$group, mat = TRUE, digits=3)
  472. ###################################### TABLE
  473. variables <- c("ACC_L_CIGminNEU", "Angular_L_CIGminNEU", "Thalamus_R_CIGminNEU", "dorsal_Striatum_R_CIGminNEU",
  474. "MCC_R_CIGminNEU", "SupraMarginal_R_CIGminNEU", "Precuneus_R_CIGminNEU",
  475. "AMY_Bilateral_CIGminNEU", "Nacc_Bilateral_CIGminNEU", "mPFC_CIGminNEU")
  476. results <- list()
  477. for (var in variables) {
  478. var_t1 <- paste(var, "t1", sep = ".")
  479. var_t2 <- paste(var, "t2", sep = ".")
  480. desc_t1 <- describeBy(data[[var_t1]], data$group, mat = TRUE, digits = 3)
  481. desc_t2 <- describeBy(data[[var_t2]], data$group, mat = TRUE, digits = 3)
  482. overall_t1 <- describe(data[[var_t1]])
  483. overall_t2 <- describe(data[[var_t2]])
  484. extract_value <- function(desc, row, col) {
  485. if (nrow(desc) >= row) return(desc[row, col]) else return(NA)}
  486. results[[var]] <- data.frame(
  487. ROI = gsub("_CIGminNEU", "", var),
  488. Timepoint = c("t1", "t2"),
  489. Overall_M = round(c(overall_t1$mean, overall_t2$mean), 3),
  490. Overall_SD = round(c(overall_t1$sd, overall_t2$sd), 3),
  491. `TAU+ApBM_M` = c(extract_value(desc_t1, 3, "mean"), extract_value(desc_t2, 3, "mean")),
  492. `TAU+ApBM_SD` = c(extract_value(desc_t1, 3, "sd"), extract_value(desc_t2, 3, "sd")),
  493. `TAU+Sham_M` = c(extract_value(desc_t1, 2, "mean"), extract_value(desc_t2, 2, "mean")),
  494. `TAU+Sham_SD` = c(extract_value(desc_t1, 2, "sd"), extract_value(desc_t2, 2, "sd")),
  495. `TAU-Only_M` = c(extract_value(desc_t1, 1, "mean"), extract_value(desc_t2, 1, "mean")),
  496. `TAU-Only_SD` = c(extract_value(desc_t1, 1, "sd"), extract_value(desc_t2, 1, "sd")))
  497. }
  498. final_table <- do.call(rbind, results)
  499. print(final_table)
  500. write_xlsx(final_table, "table_ROIs_M_SD.xlsx")
  501. ################################################################################
  502. ## HYPOTHESIS 2: PRE-POST CHANGES FOR PARTICIPANTS WITH 5 TRAININGS
  503. ################################################################################
  504. ### LOAD DATA
  505. data_5trainings <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_5trainings.xlsx")
  506. data_5trainings[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_5trainings[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  507. data_long2_5trainings <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_long2_5trainings.xlsx")
  508. data_long2_5trainings[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_long2_5trainings[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  509. ROIs <- c("ACC_L", "Angular_L", "Thalamus_R", "dorsal_Striatum_R", "MCC_R", "SupraMarginal_R", "Precuneus_R", "AMY_Bilateral", "Nacc_Bilateral", "mPFC")
  510. ROIs_CIGminNEU.t1 <- c("ACC_L_CIGminNEU.t1", "Angular_L_CIGminNEU.t1", "Thalamus_R_CIGminNEU.t1", "dorsal_Striatum_R_CIGminNEU.t1", "MCC_R_CIGminNEU.t1", "SupraMarginal_R_CIGminNEU.t1", "Precuneus_R_CIGminNEU.t1", "AMY_Bilateral_CIGminNEU.t1", "Nacc_Bilateral_CIGminNEU.t1", "mPFC_CIGminNEU.t1")
  511. ### AAT #n=116, because CBM287 excluded at t0 and no t1 participation
  512. res_AAT_t0t1 <- lmer(AAT_untrained ~ t1 * group + (1 | subject) + (1 | course), data = data_long2_5trainings)
  513. summary(res_AAT_t0t1)
  514. confint(res_AAT_t0t1)
  515. Anova(res_AAT_t0t1, type = 3, test.statistic = "F")
  516. plot_model_AAT_t0t1_2 <- interact_plot(res_AAT_t0t1, pred = t1, modx = group, plot.points = TRUE)
  517. plot_model_AAT_t0t1_2
  518. ### CRAVING RATING
  519. res_CRAVING_t0t1 <- lmer(Craving_Rating ~ t1 * group + (1 | subject) + (1 | course), data = data_long2_5trainings)
  520. summary(res_CRAVING_t0t1)
  521. confint(res_CRAVING_t0t1)
  522. Anova(res_CRAVING_t0t1, type = 3, test.statistic = "F")
  523. plot_model_CRAVING_t0t1 <- interact_plot(res_CRAVING_t0t1, pred = t1, modx = group, plot.points = TRUE)
  524. plot_model_CRAVING_t0t1
  525. ### fMRI smoking cue-reactivity
  526. results <- list()
  527. plots <- list()
  528. anova_results_smoking_cue_reactivity <- data.frame(Region = character(), Df_t1 = numeric(), Df_res_t1 = numeric(), F_value_t1 = numeric(), Pr_t1 = numeric(), Df_t1_group = numeric(), Df_res_t1_group = numeric(), F_value_t1_group = numeric(), Pr_t1_group = numeric(), stringsAsFactors = FALSE)
  529. for (region in ROIs) {
  530. formula <- as.formula(paste0(region, " ~ t1 * group + (1 | subject) + (1 | course)"))
  531. model <- lmer(formula, data = data_long2_5trainings)
  532. anova_res <- Anova(model, type = 3, test.statistic = "F")
  533. plot_model <- interact_plot(model, pred = t1, modx = group, plot.points = TRUE)
  534. results[[region]] <- list(summary = summary(model), anova = anova_res, plot = plot_model)
  535. anova_results_smoking_cue_reactivity <- rbind(anova_results_smoking_cue_reactivity, data.frame(
  536. Region = region,
  537. Df_time = anova_res["t1", "Df"],
  538. Df_res_time = anova_res["t1", "Df.res"],
  539. F_value_time = anova_res["t1", "F"],
  540. p_time = anova_res["t1", "Pr(>F)"],
  541. Df_inter_time_group = anova_res["t1:group", "Df"],
  542. Df_res_inter_time_group = anova_res["t1:group", "Df.res"],
  543. F_value_inter_time_group = anova_res["t1:group", "F"],
  544. p_inter_time_group = anova_res["t1:group", "Pr(>F)"]))
  545. print(plot_model)
  546. }
  547. print(anova_results_smoking_cue_reactivity)
  548. ################################################################################
  549. ## HYPOTHESIS 2: PRE-POST CHANGES FOR PARTICIPANTS WHO ACHIEVED ABSTINENCE AT POST
  550. ################################################################################
  551. ### LOAD DATA
  552. data_abstinent <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_abstinent.xlsx")
  553. data_abstinent[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_abstinent[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  554. data_long2_abstinent <- read_excel("Z:/063CBM5/Datenauswertung/fMRI/scripts/R_scripts/datasets/data_long2_abstinent.xlsx")
  555. data_long2_abstinent[c("abstinence.t2", "abstinence.t3", "group", "sex")] <- lapply(data_long2_abstinent[c("abstinence.t2", "abstinence.t3", "group", "sex")], as.factor)
  556. ROIs <- c("ACC_L", "Angular_L", "Thalamus_R", "dorsal_Striatum_R", "MCC_R", "SupraMarginal_R", "Precuneus_R", "AMY_Bilateral", "Nacc_Bilateral", "mPFC")
  557. ROIs_CIGminNEU.t1 <- c("ACC_L_CIGminNEU.t1", "Angular_L_CIGminNEU.t1", "Thalamus_R_CIGminNEU.t1", "dorsal_Striatum_R_CIGminNEU.t1", "MCC_R_CIGminNEU.t1", "SupraMarginal_R_CIGminNEU.t1", "Precuneus_R_CIGminNEU.t1", "AMY_Bilateral_CIGminNEU.t1", "Nacc_Bilateral_CIGminNEU.t1", "mPFC_CIGminNEU.t1")
  558. ### N per group
  559. table(data_abstinent$group) # 0:18, 1:19, 2:19
  560. table(data_abstinent$group, !is.na(data_abstinent$ACC_L_CIGminNEU.t2)) # 0:17, 1:19, 2:19 #CBM308: NA for fMRI data post, but took part at main study t2
  561. ### AAT #n=116, because CBM287 excluded at t0 and no t1 participation
  562. res_AAT_t0t1 <- lmer(AAT_untrained ~ t1 * group + (1 | subject) + (1 | course), data = data_long2_abstinent)
  563. summary(res_AAT_t0t1)
  564. confint(res_AAT_t0t1)
  565. Anova(res_AAT_t0t1, type = 3, test.statistic = "F")
  566. plot_model_AAT_t0t1_2 <- interact_plot(res_AAT_t0t1, pred = t1, modx = group, plot.points = TRUE)
  567. plot_model_AAT_t0t1_2 # TAU-only: reduction in approach biases from t0 to t1, while training groups remained stable
  568. ### CRAVING RATING
  569. res_CRAVING_t0t1 <- lmer(Craving_Rating ~ t1 * group + (1 | subject) + (1 | course), data = data_long2_abstinent)
  570. summary(res_CRAVING_t0t1)
  571. confint(res_CRAVING_t0t1)
  572. Anova(res_CRAVING_t0t1, type = 3, test.statistic = "F")
  573. plot_model_CRAVING_t0t1 <- interact_plot(res_CRAVING_t0t1, pred = t1, modx = group, plot.points = TRUE)
  574. plot_model_CRAVING_t0t1
  575. ### fMRI smoking cue-reactivity
  576. results <- list()
  577. plots <- list()
  578. anova_results_smoking_cue_reactivity <- data.frame(Region = character(), Df_t1 = numeric(), Df_res_t1 = numeric(), F_value_t1 = numeric(), Pr_t1 = numeric(), Df_t1_group = numeric(), Df_res_t1_group = numeric(), F_value_t1_group = numeric(), Pr_t1_group = numeric(), stringsAsFactors = FALSE)
  579. for (region in ROIs) {
  580. formula <- as.formula(paste0(region, " ~ t1 * group + (1 | subject) + (1 | course)"))
  581. model <- lmer(formula, data = data_long2_abstinent)
  582. anova_res <- Anova(model, type = 3, test.statistic = "F")
  583. plot_model <- interact_plot(model, pred = t1, modx = group, plot.points = TRUE)
  584. results[[region]] <- list(summary = summary(model), anova = anova_res, plot = plot_model)
  585. anova_results_smoking_cue_reactivity <- rbind(anova_results_smoking_cue_reactivity, data.frame(
  586. Region = region,
  587. Df_time = anova_res["t1", "Df"],
  588. Df_res_time = anova_res["t1", "Df.res"],
  589. F_value_time = anova_res["t1", "F"],
  590. p_time = anova_res["t1", "Pr(>F)"],
  591. Df_inter_time_group = anova_res["t1:group", "Df"],
  592. Df_res_inter_time_group = anova_res["t1:group", "Df.res"],
  593. F_value_inter_time_group = anova_res["t1:group", "F"],
  594. p_inter_time_group = anova_res["t1:group", "Pr(>F)"]))
  595. print(plot_model)
  596. }
  597. print(anova_results_smoking_cue_reactivity)
  598. res_Nacc_Bilateral_abstinent <- lmer(Nacc_Bilateral ~ t1 * group + (1 | subject) + (1 | course), data = data_long2_abstinent)
  599. summary(res_Nacc_Bilateral_abstinent)
  600. ### Contrasts
  601. res_Nacc_Bilateral_abstinent_emtrends <- emtrends(res_Nacc_Bilateral_abstinent, ~ group, var = "t1")
  602. res_Nacc_Bilateral_abstinent_emtrends
  603. res_Nacc_Bilateral_abstinent_emtrends_contrasts <- contrast(res_Nacc_Bilateral_abstinent_emtrends, method = "pairwise", adjust = "none")
  604. res_Nacc_Bilateral_abstinent_emtrends_contrasts

063CBM ApBM Effects fMRI OSF.R, no license · at the source

Overview

Authors: Franziska Motka1,2, Haoye Tan3, Sabine Vollstädt-Klein3,4,5, Katja Bertsch2,6,7, Charlotte E. Wittekind1,2
  1. Division of Clinical Psychology and Psychological Treatment, Department of Psychology, Leopoldstraße 13, 80802 Munich, Germany
  2. NeuroImaging Core Unit Munich (NICUM), University Hospital, LMU Munich,Munich, Germany
  3. Central Institute of Mental Health, University of Heidelberg,Mannheim, Germany
  4. Mannheim Center of Translational Neurosciences (MCTN), Medical Faculty of Mannheim, University of Heidelberg,Mannheim, Germany
  5. German Center of Mental Health (DZPG), Partner Site Mannheim-Heidelberg-Ulm, Mannheim, Germany
  6. Department of Psychology I (Biological Psychology, Clinical Psychology, and Psychotherapy), University of Würzburg,Würzburg, Germany
  7. German Center for Mental Health (DZPG), Partner Site Munich/Augsburg,Munich, Germany
Journal: Scientific reports, volume 16, issue 1, article 10519
Dates: received 17 January 2026; accepted 20 March 2026; published online 28 March 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-45748-y · PMID 41904262 · PMCID PMC13035900 · OpenAlex W7142193417
Open access: gold, a free copy (OpenAlex)
Status: code verified (how the code is found and verified)
Categories: fMRI (modality), human (organism), other condition (population), clinical / translational (subfield)
Methods: Statistics
Keywords: approach bias modification, smoking, cue-reactivity, fMRI, addiction, smoking cessation, Diseases, Medical research, Neuroscience
MeSH: Cues*, Magnetic Resonance Imaging*, Smoking*, Smoking Cessation*, Tobacco Use Disorder*, Adult, Brain, Female, Humans, Male, Middle Aged (* major topic)
Topic: Smoking Behavior and Cessation (Public Health, Environmental and Occupational Health, Medicine), according to OpenAlex
Funding: Ludwig-Maximilians-Universität München (1024)
Citations: not cited yet (Europe PMC); 67 references in the paper

Abstract

Approach bias modification (ApBM), a computerized training designed to retrain involuntary approach action tendencies toward drug-related cues, has been shown to reduce relapse rates when added to treatment-as-usual (TAU) in alcohol use disorder. A potential working mechanism involves reduced neural drug cue-reactivity in reward-related brain regions. In smoking cessation, however, the efficacy and neural mechanisms of ApBM remain unclear. In this randomized-controlled trial, individuals with chronic, moderate-to-heavy tobacco dependence (N = 117, Mage = 41.5, 45.3% female) received a one-day smoking cessation intervention (TAU) and were subsequently randomized to complete seven sessions of ApBM (TAU+ApBM), Sham control training (TAU+Sham), or no training (TAU-only). Neural reactivity toward smoking-related versus neutral stimuli (smoking cue-reactivity) was assessed using functional magnetic resonance imaging (fMRI) before and after intervention. Abstinence was the primary clinical outcome. Results showed no significant group×time interactions on cue-reactivity, and ApBM did not enhance abstinence rates. In the precuneus (sensorimotor region), increased cue-reactivity following ApBM was associated with higher long-term abstinence probability, while the control groups showed the opposite descriptive pattern. In conclusion, ApBM did not reduce smoking cue-reactivity in reward-related regions, consistent with the lack of beneficial effects on clinical outcomes. Alternative neural target processes (e.g., sensorimotor-related) and respective training procedures should be explored.

Supplementary Information: The online version contains supplementary material available at 10.1038/s41598-026-45748-y.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.

OSF zcrbt

License: none: the authors keep all their rights
State: the link answers, verified on 30 September 2026
Evidence: files inventoried
Languages: R (7), MATLAB (5), SPSS (1)
Size: 40 files, 13 scripts
Software Heritage: not checked
Found in: “Data availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: tidyverse (6 files), data.table (4 files), SPM (4 files), emmeans (3 files), lmerTest (3 files), psych (3 files), broom (2 files), car (2 files), ggpubr (2 files), reshape2 (2 files), rstatix (2 files), easystats (1 file), ggplot2 (1 file), lavaan (1 file)
Availability: 1 check, the latest on 30 September 2026: the link answers (HTTP 200)
  • 30 September 2026: the link answers (HTTP 200)
13 files
At the source: osf.io/zcrbt

The paper's code and data availability statement is in the Data section.

Tracing map

Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.

What the map holds:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 13 scripts, each with its path and the digest of its content;
  • 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
  • neither the text of the paper nor the code itself.

Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.

Data

No dataset and no data link were found in the paper.

Data availability

Data and analysis code are available in the open science framework (OSF): https://osf.io/zcrbt.

Reproduced under the paper's license (CC BY), from the paper cited above.

Versions

The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.

Version 1, 30 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 9 keywords, 11 MeSH terms, 1 funder, 61 references.

Cite

This paper

Motka, F., Tan, H., Vollstädt-Klein, S., Bertsch, K., & Wittekind, C. E. (2026). The effects of approach bias modification on smoking cue-reactivity in individuals who smoke: A randomized controlled fMRI study. Scientific reports, 16(1), 10519. https://doi.org/10.1038/s41598-026-45748-y

BibTeX

@article{motka2026effects,
author = {Motka, Franziska and Tan, Haoye and Vollstädt-Klein, Sabine and Bertsch, Katja and Wittekind, Charlotte E.},
title = {{The effects of approach bias modification on smoking cue-reactivity in individuals who smoke: A randomized controlled fMRI study}},
journal = {Scientific reports},
year = {2026},
month = mar,
volume = {16},
number = {1},
pages = {10519},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-45748-y},
url = {https://doi.org/10.1038/s41598-026-45748-y},
pmid = {41904262},
pmcid = {PMC13035900}
}

RIS

TY - JOUR
AU - Motka, Franziska
AU - Tan, Haoye
AU - Vollstädt-Klein, Sabine
AU - Bertsch, Katja
AU - Wittekind, Charlotte E.
TI - The effects of approach bias modification on smoking cue-reactivity in individuals who smoke: A randomized controlled fMRI study
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/03/28
VL - 16
IS - 1
SP - 10519
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-45748-y
UR - https://doi.org/10.1038/s41598-026-45748-y
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-45748-y",
"type": "article-journal",
"title": "The effects of approach bias modification on smoking cue-reactivity in individuals who smoke: A randomized controlled fMRI study",
"container-title": "Scientific reports",
"author": [
{
"family": "Motka",
"given": "Franziska"
},
{
"family": "Tan",
"given": "Haoye"
},
{
"family": "Vollstädt-Klein",
"given": "Sabine"
},
{
"family": "Bertsch",
"given": "Katja"
},
{
"family": "Wittekind",
"given": "Charlotte E."
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "10519",
"DOI": "10.1038/s41598-026-45748-y",
"PMID": "41904262",
"PMCID": "PMC13035900",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-45748-y",
"language": "en",
"issued": {
"date-parts": [
[
2026,
3,
28
]
]
}
}

The tracing map gets a citation of its own once an author has validated it and it has a DOI.

Similar papers

The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.

[1] doi:10.1111/add.70283 [code]
Appetitive responses toward smoking-related stimuli in abstinence-motivated, non-deprived individuals with chronic tobacco dependence: A multi-methodological investigation.
Journal: Addiction (Abingdon, England)
In common: lavaan, rstatix, psych, 6 other tools, fMRI, other condition, 22 references
[2] doi:10.1093/brain/awaf302 [code]
Parkinson's disease progression is shaped by longitudinal changes in cerebral compensation.
Journal: Brain : a journal of neurology
In common: lavaan, broom, easystats, 10 other tools, fMRI, clinical / translational, 1 reference
[3] doi:10.1162/imag_a_00547 [code]
Reliability of structural brain change in cognitively healthy adult samples.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: broom, easystats, psych, 5 other tools, 5 references
[4] doi:10.1073/pnas.2603114123 [code]
The human hippocampus can pattern separate memories by meaning.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: broom, easystats, rstatix, 6 other tools, 4 references
[5] doi:10.1038/s41398-026-04010-9 [code]
Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.
Journal: Translational psychiatry
In common: lavaan, broom, easystats, 8 other tools, 1 reference
[6] doi:10.1093/scan/nsae071 [code]
A beautiful face is good when we're judged by others, a moral character is better.
Journal: Social cognitive and affective neuroscience
In common: lavaan, easystats, psych, 7 other tools, 2 references
[7] doi:10.1093/scan/nsae072 [code]
Proximity within adolescent peer networks predicts neural similarity during affective experience.
Journal: Social cognitive and affective neuroscience
In common: easystats, psych, car, 3 other tools, 7 references
[8] doi:10.1016/j.neuroimage.2023.120373 [code]
Adaptive short-term plasticity in the typical reading network.
Journal: NeuroImage
In common: easystats, emmeans, car, 3 other tools, fMRI, other condition, 5 references
[9] doi:10.64898/2026.03.20.713139 [code]
Dissociable contributions of cortical thickness and surface area to cognitive ageing: evidence from multiple longitudinal cohorts
Journal: bioRxiv (preprint)
In common: lavaan, broom, easystats, 7 other tools
[10] doi:10.1038/s41398-026-04122-2 [code]
Multi-session CBM-I for social anxiety: examining psychopathology, cognitive, neural, and psychophysiological effects in a randomized controlled trial.
Journal: Translational psychiatry
In common: lavaan, broom, psych, 4 other tools, clinical / translational, other condition, 2 references

Contribute

The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.

Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.

Add the badge to the code's README

OSCR: the badge of this paper

If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.

Markdown
<!-- oscr-badge:start -->
[![OSCR](https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y.svg)](https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y)
<!-- oscr-badge:end -->
reStructuredText
.. oscr-badge:start

.. image:: https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y.svg
   :target: https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y
   :alt: OSCR

.. oscr-badge:end
HTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y"><img src="https://openscicode.org/badge/doi/10.1038/s41598-026-45748-y.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->

If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.

Request its removal

To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).

Discussion, reproductions, activity

Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.

Report a mismatch between the code and the paper · Report a code error (signed in)

Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.

Report a reproduction failure (signed in)

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.