OSCR

Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.

Code ↔ Paper

2 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 2 matches
  1. [1] § Results › Sex differences in the associations of bullying victimization on brain development ↔ LME_Model_Metrics.R, lines 2599–2658 · score 0.69 · Female Low, Female High, quartile, bullying victim, score, predicted
  2. [2] § Results › Sex differences in the associations of bullying victimization on brain development ↔ LME_Model_Metrics.R, lines 157–209 · score 0.55 · left cerebellar cortex, right caudate, left putamen, left ventral, supramarginal, parahippocampal

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC

The paper is loaded when this pane is shown.

The authors' code

R · 2,880 lines · 195 KB · no license · 2 matches

  1. # Load the gamm4 library
  2. {
  3. library(gamm4)
  4. library(mediation)
  5. library(tidyverse)
  6. library(lmerTest)
  7. library(knitr)
  8. library(lavaan)
  9. library(psych)
  10. library(MBESS)
  11. library(greybox)
  12. library(lme4)
  13. library(haven)
  14. library(tidyverse)
  15. library(dplyr)
  16. library(ggplot2)
  17. library(ggseg)
  18. library(effects)
  19. library(rstatix)
  20. library(broom)
  21. library(ggpubr)
  22. library(effectsize)
  23. library(ggeffects)
  24. library(plyr)
  25. library(methods)
  26. library(stargazer)
  27. library(sjPlot)
  28. library(nlme)
  29. library(data.table)
  30. library(MuMIn)
  31. library(lmerTest)
  32. library(lmtest)
  33. library(officer)
  34. library(knitr)
  35. library(readxl)
  36. library(RColorBrewer)
  37. library(dvmisc)
  38. library(qwraps2)
  39. library(AICcmodavg)
  40. library(simr)
  41. library(emmeans)
  42. library(stats)
  43. library(mutoss)
  44. library(powerlmm)
  45. }
  46. #Load Data
  47. {
  48. # read in excel file
  49. IMAGEN_bully <- read_excel("/Users/michaelconnaughton/Desktop/IMAGEN/MASTER_FILE/IMAGEN_MASTER.xlsx", na = ".")
  50. # read in csv file - read.csv() or read.csv2() functions. The former function is used if the separator is a ,, the latter if ; is used to separate the values in your data file.
  51. IMAGEN_bully <- as.data.frame(IMAGEN_bully)
  52. # convert to r dataframe
  53. IMAGEN_bully <- as.data.frame(IMAGEN_bully)
  54. # Find the index of the row with the lowest age
  55. index_of_lowest_age <- which.min(IMAGEN_bully$age_years)
  56. # Remove the row with the lowest age
  57. IMAGEN_bully <- IMAGEN_bully[-index_of_lowest_age, ]
  58. # Verify the row removal (optional)
  59. print(data)
  60. # List of failed QC IDs to be removed (include all variations of the IDs)
  61. outliers <- c("10400245_1", "12645188_1", "12953830_1", "20015942_1",
  62. "22888407_1", "26135259_1", "28852607_1", "29257136_1",
  63. "30276332_1", "30383377_1", "32506627_1", "35587656_1",
  64. "38976393_1", "41748802_1", "47975799_1", "54552397_1",
  65. "64999269_1", "82654000_1", "83308215_1", "90579038_1",
  66. "93239552_1", "95136410_1", "98720163_1", "99550415_1",
  67. "3328367_2", "20418061_2", "6272781_3", "22053782_2",
  68. "10646873_3", "61507009_2", "13361778_3", "68802565_2",
  69. "20015942_3", "68849025_2", "25193415_3", "30276332_2",
  70. "30276332_3", "87961112_2", "38916315_3", "35587656_2",
  71. "80627914_3", "75438006_2", "95958758_3", "97329782_2",
  72. "97555742_2", "3504454_2", "67766736_2", "73628015_2",
  73. "18632052_2", "69895644_2")
  74. # Removed failed QC IDs from data frame
  75. IMAGEN_bully <- IMAGEN_bully %>%
  76. filter(!(ID %in% outliers))
  77. # mutate factors
  78. IMAGEN_bully <- IMAGEN_bully%>%
  79. mutate(sex = factor(sex,levels = c(1,2),labels = c("female", "male")))
  80. IMAGEN_bully <- IMAGEN_bully%>%
  81. mutate(scan_site = factor(scan_site,levels = c(1,2,3,4,5,6,7,8),labels = c("London", "Northamptom", "Dublin", "Berlin", "Hamberg", "Mannheim", "Paris", "Dresden")))
  82. IMAGEN_bully <- IMAGEN_bully%>%
  83. mutate(p_bully = factor(p_bully,levels = c(0,1),labels = c("No", "Yes")))
  84. IMAGEN_bully <- IMAGEN_bully%>%
  85. mutate(timepoint = factor(timepoint,levels = c(1,2,3),labels = c("1", "2", "3")))
  86. summary(IMAGEN_bully$lh_cuneus_volume)
  87. IMAGEN_bully <- IMAGEN_bully%>%
  88. mutate(p_perpetrator = factor(p_perpetrator,levels = c(0,1),labels = c("No", "Yes")))
  89. IMAGEN_bully <- IMAGEN_bully%>%
  90. mutate(has_a_good_friend = factor(has_a_good_friend,levels = c(0,1,2),labels = c("Not True", "Partially True", "Certainly True")))
  91. IMAGEN_bully <- IMAGEN_bully%>%
  92. mutate(attached_to_parent = factor(attached_to_parent,levels = c(0,1,2),labels = c("Not True", "Partially True", "Certainly True")))
  93. #Exclude entries with bully status of "2"
  94. #IMAGEN_bully <- IMAGEN_bully %>%
  95. #filter(bully_status != 2)
  96. #code factor variables
  97. contrasts(IMAGEN_bully$sex) <- c(-.5, .5)
  98. contrasts(IMAGEN_bully$p_bully) <- c(-.5, .5)
  99. #contrasts(IMAGEN_bully$p_perpetrator) <- c(-.5, .5)
  100. #diff_LMM <- na.omit(diff_LMM, diff_local_eff_log_c)
  101. summary(IMAGEN_bully)
  102. # Define your dependent variable
  103. IMAGEN_bully$EstimatedTotalIntraCranialVol<- as.numeric(IMAGEN_bully$EstimatedTotalIntraCranialVol)
  104. IMAGEN_bully$age<- as.numeric(IMAGEN_bully$age)
  105. IMAGEN_bully$bully_victim<- as.numeric(IMAGEN_bully$bully_victim)
  106. IMAGEN_bully$SES<- as.numeric(IMAGEN_bully$SES)
  107. IMAGEN_bully$age_baseline<- as.numeric(IMAGEN_bully$age_baseline)
  108. IMAGEN_bully$mode_c_pds<- as.numeric(IMAGEN_bully$mode_c_pds)
  109. IMAGEN_bully$age_years<- as.numeric(IMAGEN_bully$age_years)
  110. IMAGEN_bully$WHO_Total<- as.numeric(IMAGEN_bully$WHO_Total)
  111. IMAGEN_bully$LEQ<- as.numeric(IMAGEN_bully$LEQ)
  112. IMAGEN_bully$MatrixReasoning_Baseline<- as.numeric(IMAGEN_bully$MatrixReasoning_Baseline)
  113. IMAGEN_bully$bmi_Baseline<- as.numeric(IMAGEN_bully$bmi_Baseline)
  114. # Scale Variables
  115. IMAGEN_bully$age <- scale(IMAGEN_bully$age)
  116. IMAGEN_bully$bully_victim <- scale(IMAGEN_bully$bully_victim)
  117. IMAGEN_bully$SES <- scale(IMAGEN_bully$SES)
  118. IMAGEN_bully$mode_c_pds <- scale(IMAGEN_bully$mode_c_pds)
  119. IMAGEN_bully$age_baseline <- scale(IMAGEN_bully$age_baseline)
  120. IMAGEN_bully$EstimatedTotalIntraCranialVol <- scale(IMAGEN_bully$EstimatedTotalIntraCranialVol)
  121. IMAGEN_bully$WHO_Total <- scale(IMAGEN_bully$WHO_Total)
  122. IMAGEN_bully$LEQ <- scale(IMAGEN_bully$LEQ)
  123. IMAGEN_bully$MatrixReasoning_Baseline <- scale(IMAGEN_bully$MatrixReasoning_Baseline)
  124. IMAGEN_bully$bmi_Baseline <- scale(IMAGEN_bully$bmi_Baseline)
  125. # Scale Variables
  126. # Create the interaction term and scale it
  127. #IMAGEN_bully$bully_victim_age_interaction <- scale(IMAGEN_bully$age * IMAGEN_bully$bully_victim)
  128. # Remove Missing Data
  129. missing_bully_victim <- is.na(IMAGEN_bully$bully_victim)
  130. missing_scan_site <- is.na(IMAGEN_bully$scan_site)
  131. # Remove observations with missing bully_victim values
  132. IMAGEN_bully <- IMAGEN_bully[complete.cases(IMAGEN_bully$bully_victim), ]
  133. IMAGEN_bully <- IMAGEN_bully[complete.cases(IMAGEN_bully$scan_site), ]
  134. sum(is.na(IMAGEN_bully$bully_victim))
  135. sum(is.na(IMAGEN_bully$scan_site))
  136. DVlist <- c(
  137. "lh_bankssts_volume", "lh_caudalanteriorcingulate_volume", "lh_caudalmiddlefrontal_volume",
  138. "lh_cuneus_volume", "lh_entorhinal_volume", "lh_fusiform_volume",
  139. "lh_inferiorparietal_volume", "lh_inferiortemporal_volume", "lh_isthmuscingulate_volume",
  140. "lh_lateraloccipital_volume", "lh_lateralorbitofrontal_volume", "lh_lingual_volume",
  141. "lh_medialorbitofrontal_volume", "lh_middletemporal_volume", "lh_parahippocampal_volume",
  142. "lh_paracentral_volume", "lh_parsopercularis_volume", "lh_parsorbitalis_volume",
  143. "lh_parstriangularis_volume", "lh_pericalcarine_volume", "lh_postcentral_volume",
  144. "lh_posteriorcingulate_volume", "lh_precentral_volume", "lh_precuneus_volume",
  145. "lh_rostralanteriorcingulate_volume", "lh_rostralmiddlefrontal_volume", "lh_superiorfrontal_volume",
  146. "lh_superiorparietal_volume", "lh_superiortemporal_volume", "lh_supramarginal_volume",
  147. "lh_frontalpole_volume", "lh_temporalpole_volume", "lh_transversetemporal_volume",
  148. "lh_insula_volume", "rh_bankssts_volume", "rh_caudalanteriorcingulate_volume",
  149. "rh_caudalmiddlefrontal_volume", "rh_cuneus_volume", "rh_entorhinal_volume",
  150. "rh_fusiform_volume", "rh_inferiorparietal_volume", "rh_inferiortemporal_volume",
  151. "rh_isthmuscingulate_volume", "rh_lateraloccipital_volume", "rh_lateralorbitofrontal_volume",
  152. "rh_lingual_volume", "rh_medialorbitofrontal_volume", "rh_middletemporal_volume",
  153. "rh_parahippocampal_volume", "rh_paracentral_volume", "rh_parsopercularis_volume",
  154. "rh_parsorbitalis_volume", "rh_parstriangularis_volume", "rh_pericalcarine_volume",
  155. "rh_postcentral_volume", "rh_posteriorcingulate_volume", "rh_precentral_volume",
  156. "rh_precuneus_volume", "rh_rostralanteriorcingulate_volume", "rh_rostralmiddlefrontal_volume",
  157. "rh_superiorfrontal_volume", "rh_superiorparietal_volume", "rh_superiortemporal_volume",
  158. "rh_supramarginal_volume", "rh_frontalpole_volume", "rh_temporalpole_volume",
  159. "rh_transversetemporal_volume", "rh_insula_volume", "Left_Cerebellum_Cortex",
  160. "Left_Thalamus_Proper", "Left_Caudate", "Left_Putamen",
  161. "Left_Pallidum", "Brain_Stem", "Left_Hippocampus",
  162. "Left_Amygdala","Left_Accumbens_area", "Left_VentralDC",
  163. "Right_Cerebellum_Cortex", "Right_Thalamus_Proper",
  164. "Right_Caudate", "Right_Putamen", "Right_Pallidum",
  165. "Right_Hippocampus", "Right_Amygdala", "Right_Accumbens_area",
  166. "Right_VentralDC", "TotalGrayVol")
  167. for (dv in DVlist) {
  168. IMAGEN_bully[[dv]] <- scale(IMAGEN_bully[[dv]])
  169. }
  170. # Initialize a list to store outlier information
  171. outlier_info <- list()
  172. # Loop through each DV
  173. for (dv in DVlist) {
  174. # Convert to numeric
  175. IMAGEN_bully[[dv]] <- as.numeric(IMAGEN_bully[[dv]])
  176. # Calculate mean and standard deviation
  177. mean_DV <- mean(IMAGEN_bully[[dv]], na.rm = TRUE)
  178. sd_DV <- sd(IMAGEN_bully[[dv]], na.rm = TRUE)
  179. # Define cutoffs for outliers
  180. lower_bound <- mean_DV - 3 * sd_DV
  181. upper_bound <- mean_DV + 3 * sd_DV
  182. # Identify outliers
  183. outliers <- which(IMAGEN_bully[[dv]] < lower_bound | IMAGEN_bully[[dv]] > upper_bound)
  184. # Store outlier information
  185. outlier_info[[dv]] <- IMAGEN_bully[outliers, dv]
  186. # Replace outliers with NA
  187. IMAGEN_bully[[dv]][outliers] <- NA
  188. }
  189. }
  190. # The outlier_info list now contains the outliers for each DV
  191. # frames
  192. {
  193. AIC_fit_1 <- c();
  194. AIC_fit_2 <- c();
  195. AIC_Q_RFX_1 <- c();
  196. AIC_Q_RFX_2 <- c();
  197. AIC_L_RFX_1 <- c();
  198. AIC_L_RFX_2 <- c();
  199. AIC_FFX_null_Q <- c();
  200. AIC_FFX_simple_Q <- c();
  201. AIC_FFX_complex_Q <- c();
  202. AIC_FFX_null_L <- c();
  203. AIC_FFX_simple_L <- c();
  204. AIC_FFX_complex_L <- c();
  205. LL_fit_1 <- c();
  206. LL_fit_2 <- c();
  207. LL_Q_RFX_1 <- c();
  208. LL_Q_RFX_2 <- c();
  209. LL_L_RFX_1 <- c();
  210. LL_L_RFX_2 <- c();
  211. LL_FFX_null_Q <- c();
  212. LL_FFX_simple_Q <- c();
  213. LL_FFX_complex_Q <- c();
  214. LL_FFX_null_L <- c();
  215. LL_FFX_simple_L <- c();
  216. LL_FFX_complex_L <- c();
  217. BIC_fit_1 <- c();
  218. BIC_fit_2 <- c();
  219. BIC_Q_RFX_1 <- c();
  220. BIC_Q_RFX_2 <- c();
  221. BIC_L_RFX_1 <- c();
  222. BIC_L_RFX_2 <- c();
  223. BIC_FFX_null_Q <- c();
  224. BIC_FFX_simple_Q <- c();
  225. BIC_FFX_complex_Q <- c();
  226. BIC_FFX_null_L <- c();
  227. BIC_FFX_simple_L <- c();
  228. BIC_FFX_complex_L <- c();
  229. LL.Fit.pmat <- c();
  230. dif.1.2_Fit <- c();
  231. dif_Q_RFX <- c();
  232. dif.0.2_FFX_Q <- c();
  233. dif.2.2B_FFX_Q <- c();
  234. dif.0.2B_FFX_Q <- c();
  235. dif.0.2_FFX_L<- c();
  236. dif.2.2B_FFX_L <- c();
  237. dif.0.2B_FFX_L <- c();
  238. LL.FFX_Q.pmat <- c();
  239. LLcompare_Q_FFX <- c();
  240. AICcompare_Q_FFX <- c();
  241. BICcompare_Q_FFX <- c();
  242. LL.FFX_L.pmat <- c();
  243. LLcompare_L_FFX <- c();
  244. AICcompare_L_FFX <- c();
  245. BICcompare_L_FFX <- c();
  246. LL_Q_RFX.pmat <- c();
  247. LL_L_RFX.pmat <- c();
  248. LL_simple_Q_FFX.pmat <- c();
  249. LL_complex_Q_FFX.pmat <- c();
  250. LL_simple_L_FFX.pmat <- c();
  251. LL_complex_L_FFX.pmat <- c();
  252. AICccompare_fit <- c();
  253. BICccompare_fit <- c();
  254. LLccompare_fit <- c();
  255. AICccompare_Q_RFX <- c();
  256. BICccompare_Q_RFX <- c();
  257. LLccompare_Q_RFX <- c();
  258. AICccompare_L_RFX <- c();
  259. BICccompare_L_RFX <- c();
  260. LLccompare_L_RFX <- c();
  261. AICccompare_Q_FFX <- c();
  262. BICccompare_Q_FFX <- c();
  263. LLccompare_Q_FFX <- c();
  264. AICccompare_L_FFX <- c();
  265. BICccompare_L_FFX <- c();
  266. LLccompare_L_FFX <- c();
  267. }
  268. #QUAD_LINEAR
  269. {
  270. # Linear MODEL 1
  271. Linear.outcomes <- lapply(DVlist, function(x) {
  272. lme4::lmer(substitute(i ~ bully_victim * age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  273. for (outcome in 1:88) {
  274. LL_fit_1 <- append(LL_fit_1, logLik(Linear.outcomes[[outcome]], REML=T))
  275. AIC_fit_1 <- append(AIC_fit_1, AICc(Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  276. BIC_fit_1 <- append(BIC_fit_1, BICc(Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  277. }
  278. # Quadratic MODEL 1
  279. Quad.outcomes <- lapply(DVlist, function(x) {
  280. lme4::lmer(substitute(i ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  281. for (outcome in 1:88) {
  282. LL_fit_2 <- append(LL_fit_2, logLik(Quad.outcomes[[outcome]], REML=T))
  283. AIC_fit_2 <- append(AIC_fit_2, AICc(Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  284. BIC_fit_2 <- append(BIC_fit_2, BICc(Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  285. }
  286. # observe all intercept AICc in a table
  287. AICcompare_fit <- data.frame(DVlist, AIC_fit_1, AIC_fit_2)
  288. BICcompare_fit <- data.frame(DVlist, BIC_fit_1, BIC_fit_2)
  289. LLcompare_fit <- data.frame(DVlist, LL_fit_1, LL_fit_2)
  290. # LL.FFX.pmat <- c()
  291. for (outcome in 1:88) {
  292. # extract p-values only
  293. # do the interaction effect and the PE variable add anything to the null prediction model?
  294. dif.1.2_Fit <- anova(Linear.outcomes[[outcome]], Quad.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  295. LL.Fit.pmat <- append(LL.Fit.pmat,dif.1.2_Fit[2,1])
  296. }
  297. # create a list of FFX model comparisons (M0_M2 = null compared to full, M0_M2B = null compared to reduced model, M2_M2B = full compared to reduced)
  298. compared_Fit <- c("Linear_Quadratic")
  299. # IS create a dataframe with outcome scales as rows, and 3 columns showing model comparisons
  300. # Create a dataframe with the p-values for different variables
  301. LL_Fit.pvals <- data.frame(
  302. compared_Fit,
  303. "lh_bankssts_volume" = LL.Fit.pmat[1],
  304. "lh_caudalanteriorcingulate_volume" = LL.Fit.pmat[2],
  305. "lh_caudalmiddlefrontal_volume" = LL.Fit.pmat[3],
  306. "lh_cuneus_volume" = LL.Fit.pmat[4],
  307. "lh_entorhinal_volume" = LL.Fit.pmat[5],
  308. "lh_fusiform_volume" = LL.Fit.pmat[6],
  309. "lh_inferiorparietal_volume" = LL.Fit.pmat[7],
  310. "lh_inferiortemporal_volume" = LL.Fit.pmat[8],
  311. "lh_isthmuscingulate_volume" = LL.Fit.pmat[9],
  312. "lh_lateraloccipital_volume" = LL.Fit.pmat[10],
  313. "lh_lateralorbitofrontal_volume" = LL.Fit.pmat[11],
  314. "lh_lingual_volume" = LL.Fit.pmat[12],
  315. "lh_medialorbitofrontal_volume" = LL.Fit.pmat[13],
  316. "lh_middletemporal_volume" = LL.Fit.pmat[14],
  317. "lh_parahippocampal_volume" = LL.Fit.pmat[15],
  318. "lh_paracentral_volume" = LL.Fit.pmat[16],
  319. "lh_parsopercularis_volume" = LL.Fit.pmat[17],
  320. "lh_parsorbitalis_volume" = LL.Fit.pmat[18],
  321. "lh_parstriangularis_volume" = LL.Fit.pmat[19],
  322. "lh_pericalcarine_volume" = LL.Fit.pmat[20],
  323. "lh_postcentral_volume" = LL.Fit.pmat[21],
  324. "lh_posteriorcingulate_volume" = LL.Fit.pmat[22],
  325. "lh_precentral_volume" = LL.Fit.pmat[23],
  326. "lh_precuneus_volume" = LL.Fit.pmat[24],
  327. "lh_rostralanteriorcingulate_volume" = LL.Fit.pmat[25],
  328. "lh_rostralmiddlefrontal_volume" = LL.Fit.pmat[26],
  329. "lh_superiorfrontal_volume" = LL.Fit.pmat[27],
  330. "lh_superiorparietal_volume" = LL.Fit.pmat[28],
  331. "lh_superiortemporal_volume" = LL.Fit.pmat[29],
  332. "lh_supramarginal_volume" = LL.Fit.pmat[30],
  333. "lh_frontalpole_volume" = LL.Fit.pmat[31],
  334. "lh_temporalpole_volume" = LL.Fit.pmat[32],
  335. "lh_transversetemporal_volume" = LL.Fit.pmat[33],
  336. "lh_insula_volume" = LL.Fit.pmat[34],
  337. "rh_bankssts_volume" = LL.Fit.pmat[35],
  338. "rh_caudalanteriorcingulate_volume" = LL.Fit.pmat[36],
  339. "rh_caudalmiddlefrontal_volume" = LL.Fit.pmat[37],
  340. "rh_cuneus_volume" = LL.Fit.pmat[38],
  341. "rh_entorhinal_volume" = LL.Fit.pmat[39],
  342. "rh_fusiform_volume" = LL.Fit.pmat[40],
  343. "rh_inferiorparietal_volume" = LL.Fit.pmat[41],
  344. "rh_inferiortemporal_volume" = LL.Fit.pmat[42],
  345. "rh_isthmuscingulate_volume" = LL.Fit.pmat[43],
  346. "rh_lateraloccipital_volume" = LL.Fit.pmat[44],
  347. "rh_lateralorbitofrontal_volume" = LL.Fit.pmat[45],
  348. "rh_lingual_volume" = LL.Fit.pmat[46],
  349. "rh_medialorbitofrontal_volume" = LL.Fit.pmat[47],
  350. "rh_middletemporal_volume" = LL.Fit.pmat[48],
  351. "rh_parahippocampal_volume" = LL.Fit.pmat[49],
  352. "rh_paracentral_volume" = LL.Fit.pmat[50],
  353. "rh_parsopercularis_volume" = LL.Fit.pmat[51],
  354. "rh_parsorbitalis_volume" = LL.Fit.pmat[52],
  355. "rh_parstriangularis_volume" = LL.Fit.pmat[53],
  356. "rh_pericalcarine_volume" = LL.Fit.pmat[54],
  357. "rh_postcentral_volume" = LL.Fit.pmat[55],
  358. "rh_posteriorcingulate_volume" = LL.Fit.pmat[56],
  359. "rh_precentral_volume" = LL.Fit.pmat[57],
  360. "rh_precuneus_volume" = LL.Fit.pmat[58],
  361. "rh_rostralanteriorcingulate_volume" = LL.Fit.pmat[59],
  362. "rh_rostralmiddlefrontal_volume" = LL.Fit.pmat[60],
  363. "rh_superiorfrontal_volume" = LL.Fit.pmat[61],
  364. "rh_superiorparietal_volume" = LL.Fit.pmat[62],
  365. "rh_superiortemporal_volume" = LL.Fit.pmat[63],
  366. "rh_supramarginal_volume" = LL.Fit.pmat[64],
  367. "rh_frontalpole_volume" = LL.Fit.pmat[65],
  368. "rh_temporalpole_volume" = LL.Fit.pmat[66],
  369. "rh_transversetemporal_volume" = LL.Fit.pmat[67],
  370. "rh_insula_volume" = LL.Fit.pmat[68],
  371. "Left_Cerebellum_Cortex" = LL.Fit.pmat[69],
  372. "Left_Thalamus_Proper" = LL.Fit.pmat[70],
  373. "Left_Caudate" = LL.Fit.pmat[71],
  374. "Left_Putamen" = LL.Fit.pmat[72],
  375. "Left_Pallidum" = LL.Fit.pmat[73],
  376. "Brain_Stem" = LL.Fit.pmat[74],
  377. "Left_Hippocampus" = LL.Fit.pmat[75],
  378. "Left_Amygdala" = LL.Fit.pmat[76],
  379. "Left_Accumbens_area" = LL.Fit.pmat[77],
  380. "Left_VentralDC" = LL.Fit.pmat[78],
  381. "Right_Cerebellum_Cortex" = LL.Fit.pmat[79],
  382. "Right_Thalamus_Proper" = LL.Fit.pmat[80],
  383. "Right_Caudate" = LL.Fit.pmat[81],
  384. "Right_Putamen" = LL.Fit.pmat[82],
  385. "Right_Pallidum" = LL.Fit.pmat[83],
  386. "Right_Hippocampus" = LL.Fit.pmat[84],
  387. "Right_Amygdala" = LL.Fit.pmat[85],
  388. "Right_Accumbens_area" = LL.Fit.pmat[86],
  389. "Right_VentralDC" = LL.Fit.pmat[87],
  390. "TotalGrayVol" = LL.Fit.pmat[88]
  391. )
  392. # transpose
  393. LL_Fit.pvals<-t(LL_Fit.pvals)
  394. #save IS output
  395. saveRDS(LL_Fit.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/LL.Fit.pvals.Rds")
  396. saveRDS(LLcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/LLcompare_fit.Rds")
  397. saveRDS(AICcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/AICccompare_fit.Rds")
  398. saveRDS(BICcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/AICccompare_fit.Rds")
  399. write.table(LL_Fit.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/LL.Fit.pval.txt", quote = F, sep=",", col.names = F)
  400. write.table(LLcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/LLcompare_fit.txt", quote = F, sep=",", row.names = F, col.names = T)
  401. write.table(AICcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/AICcompare_fit.txt", quote = F, sep=",", row.names = F, col.names = T)
  402. write.table(BICcompare_fit, file = "/Users/michaelconnaughton/Desktop/IMAGEN/BICcompare_fit.txt", quote = F, sep=",", row.names = F, col.names = T)
  403. }
  404. #Quad_MODEL_RFX
  405. {
  406. # Quad_RFX_1
  407. Quad_RFX_1.outcomes <- lapply(DVlist, function(x) {
  408. lme4::lmer(substitute(i ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  409. for (outcome in 1:88) {
  410. LL_Q_RFX_1 <- append(LL_fit_1, logLik(Quad_RFX_1.outcomes[[outcome]], REML=T))
  411. AIC_Q_RFX_1 <- append(AIC_fit_1, AICc(Quad_RFX_1.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  412. BIC_Q_RFX_1 <- append(BIC_fit_1, BICc(Quad_RFX_1.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  413. }
  414. # Quad_RFX_2
  415. Quad_RFX_2.outcomes <- lapply(DVlist, function(x) {
  416. lme4::lmer(substitute(i ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  417. for (outcome in 1:88) {
  418. LL_Q_RFX_2 <- append(LL_Q_RFX_2, logLik(Quad.outcomes[[outcome]], REML=T))
  419. AIC_Q_RFX_2 <- append(AIC_Q_RFX_2, AICc(Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  420. BIC_Q_RFX_2 <- append(BIC_Q_RFX_2, BICc(Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  421. }
  422. # observe all intercept AICc in a table
  423. AICcompare_Q_RFX <- data.frame(DVlist, AIC_Q_RFX_1, AIC_Q_RFX_2)
  424. BICcompare_Q_RFX <- data.frame(DVlist, BIC_Q_RFX_1, BIC_Q_RFX_2)
  425. LLcompare_Q_RFX <- data.frame(DVlist, LL_Q_RFX_1, LL_Q_RFX_2)
  426. # LL.FFX.pmat <- c()
  427. for (outcome in 1:88) {
  428. # extract p-values only
  429. # do the interaction effect and the PE variable add anything to the null prediction model?
  430. dif_Q_RFX <- anova(Quad_RFX_1.outcomes[[outcome]], Quad_RFX_2.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  431. LL_Q_RFX.pmat <- append(LL_Q_RFX.pmat,dif_Q_RFX[2,1])
  432. }
  433. # create a list of FFX model comparisons (M0_M2 = null compared to full, M0_M2B = null compared to reduced model, M2_M2B = full compared to reduced)
  434. compared_Q_RFX <- c("Quad_RFX1_Quad_RFX2")
  435. # IS create a dataframe with outcome scales as rows, and 3 columns showing model comparisons
  436. # Create a dataframe with the p-values for different variables
  437. LL_Q_RFX.pvals <- data.frame(
  438. compared_Q_RFX,
  439. "lh_bankssts_volume" = LL_Q_RFX.pmat[1],
  440. "lh_caudalanteriorcingulate_volume" = LL_Q_RFX.pmat[2],
  441. "lh_caudalmiddlefrontal_volume" = LL_Q_RFX.pmat[3],
  442. "lh_cuneus_volume" = LL_Q_RFX.pmat[4],
  443. "lh_entorhinal_volume" = LL_Q_RFX.pmat[5],
  444. "lh_fusiform_volume" = LL_Q_RFX.pmat[6],
  445. "lh_inferiorparietal_volume" = LL_Q_RFX.pmat[7],
  446. "lh_inferiortemporal_volume" = LL_Q_RFX.pmat[8],
  447. "lh_isthmuscingulate_volume" = LL_Q_RFX.pmat[9],
  448. "lh_lateraloccipital_volume" = LL_Q_RFX.pmat[10],
  449. "lh_lateralorbitofrontal_volume" = LL_Q_RFX.pmat[11],
  450. "lh_lingual_volume" = LL_Q_RFX.pmat[12],
  451. "lh_medialorbitofrontal_volume" = LL_Q_RFX.pmat[13],
  452. "lh_middletemporal_volume" = LL_Q_RFX.pmat[14],
  453. "lh_parahippocampal_volume" = LL_Q_RFX.pmat[15],
  454. "lh_paracentral_volume" = LL_Q_RFX.pmat[16],
  455. "lh_parsopercularis_volume" = LL_Q_RFX.pmat[17],
  456. "lh_parsorbitalis_volume" = LL_Q_RFX.pmat[18],
  457. "lh_parstriangularis_volume" = LL_Q_RFX.pmat[19],
  458. "lh_pericalcarine_volume" = LL_Q_RFX.pmat[20],
  459. "lh_postcentral_volume" = LL_Q_RFX.pmat[21],
  460. "lh_posteriorcingulate_volume" = LL_Q_RFX.pmat[22],
  461. "lh_precentral_volume" = LL_Q_RFX.pmat[23],
  462. "lh_precuneus_volume" = LL_Q_RFX.pmat[24],
  463. "lh_rostralanteriorcingulate_volume" = LL_Q_RFX.pmat[25],
  464. "lh_rostralmiddlefrontal_volume" = LL_Q_RFX.pmat[26],
  465. "lh_superiorfrontal_volume" = LL_Q_RFX.pmat[27],
  466. "lh_superiorparietal_volume" = LL_Q_RFX.pmat[28],
  467. "lh_superiortemporal_volume" = LL_Q_RFX.pmat[29],
  468. "lh_supramarginal_volume" = LL_Q_RFX.pmat[30],
  469. "lh_frontalpole_volume" = LL_Q_RFX.pmat[31],
  470. "lh_temporalpole_volume" = LL_Q_RFX.pmat[32],
  471. "lh_transversetemporal_volume" = LL_Q_RFX.pmat[33],
  472. "lh_insula_volume" = LL_Q_RFX.pmat[34],
  473. "rh_bankssts_volume" = LL_Q_RFX.pmat[35],
  474. "rh_caudalanteriorcingulate_volume" = LL_Q_RFX.pmat[36],
  475. "rh_caudalmiddlefrontal_volume" = LL_Q_RFX.pmat[37],
  476. "rh_cuneus_volume" = LL_Q_RFX.pmat[38],
  477. "rh_entorhinal_volume" = LL_Q_RFX.pmat[39],
  478. "rh_fusiform_volume" = LL_Q_RFX.pmat[40],
  479. "rh_inferiorparietal_volume" = LL_Q_RFX.pmat[41],
  480. "rh_inferiortemporal_volume" = LL_Q_RFX.pmat[42],
  481. "rh_isthmuscingulate_volume" = LL_Q_RFX.pmat[43],
  482. "rh_lateraloccipital_volume" = LL_Q_RFX.pmat[44],
  483. "rh_lateralorbitofrontal_volume" = LL_Q_RFX.pmat[45],
  484. "rh_lingual_volume" = LL_Q_RFX.pmat[46],
  485. "rh_medialorbitofrontal_volume" = LL_Q_RFX.pmat[47],
  486. "rh_middletemporal_volume" = LL_Q_RFX.pmat[48],
  487. "rh_parahippocampal_volume" = LL_Q_RFX.pmat[49],
  488. "rh_paracentral_volume" = LL_Q_RFX.pmat[50],
  489. "rh_parsopercularis_volume" = LL_Q_RFX.pmat[51],
  490. "rh_parsorbitalis_volume" = LL_Q_RFX.pmat[52],
  491. "rh_parstriangularis_volume" = LL_Q_RFX.pmat[53],
  492. "rh_pericalcarine_volume" = LL_Q_RFX.pmat[54],
  493. "rh_postcentral_volume" = LL_Q_RFX.pmat[55],
  494. "rh_posteriorcingulate_volume" = LL_Q_RFX.pmat[56],
  495. "rh_precentral_volume" = LL_Q_RFX.pmat[57],
  496. "rh_precuneus_volume" = LL_Q_RFX.pmat[58],
  497. "rh_rostralanteriorcingulate_volume" = LL_Q_RFX.pmat[59],
  498. "rh_rostralmiddlefrontal_volume" = LL_Q_RFX.pmat[60],
  499. "rh_superiorfrontal_volume" = LL_Q_RFX.pmat[61],
  500. "rh_superiorparietal_volume" = LL_Q_RFX.pmat[62],
  501. "rh_superiortemporal_volume" = LL_Q_RFX.pmat[63],
  502. "rh_supramarginal_volume" = LL_Q_RFX.pmat[64],
  503. "rh_frontalpole_volume" = LL_Q_RFX.pmat[65],
  504. "rh_temporalpole_volume" = LL_Q_RFX.pmat[66],
  505. "rh_transversetemporal_volume" = LL_Q_RFX.pmat[67],
  506. "rh_insula_volume" = LL_Q_RFX.pmat[68],
  507. "Left_Cerebellum_Cortex" = LL_Q_RFX.pmat[69],
  508. "Left_Thalamus_Proper" = LL_Q_RFX.pmat[70],
  509. "Left_Caudate" = LL_Q_RFX.pmat[71],
  510. "Left_Putamen" = LL_Q_RFX.pmat[72],
  511. "Left_Pallidum" = LL_Q_RFX.pmat[73],
  512. "Brain_Stem" = LL_Q_RFX.pmat[74],
  513. "Left_Hippocampus" = LL_Q_RFX.pmat[75],
  514. "Left_Amygdala" = LL_Q_RFX.pmat[76],
  515. "Left_Accumbens_area" = LL_Q_RFX.pmat[77],
  516. "Left_VentralDC" = LL_Q_RFX.pmat[78],
  517. "Right_Cerebellum_Cortex" = LL_Q_RFX.pmat[79],
  518. "Right_Thalamus_Proper" = LL_Q_RFX.pmat[80],
  519. "Right_Caudate" = LL_Q_RFX.pmat[81],
  520. "Right_Putamen" = LL_Q_RFX.pmat[82],
  521. "Right_Pallidum" = LL_Q_RFX.pmat[83],
  522. "Right_Hippocampus" = LL_Q_RFX.pmat[84],
  523. "Right_Amygdala" = LL_Q_RFX.pmat[85],
  524. "Right_Accumbens_area" = LL_Q_RFX.pmat[86],
  525. "Right_VentralDC" = LL_Q_RFX.pmat[87],
  526. "TotalGrayVol" = LL_Q_RFX.pmat[88]
  527. )
  528. # transpose
  529. LL_Q_RFX.pvals<-t(LL_Q_RFX.pvals)
  530. #save IS output
  531. saveRDS(LL_Q_RFX.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.Q_RFX.pvals.Rds")
  532. saveRDS(LLcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_Q_RFX.Rds")
  533. saveRDS(AICcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICccompare_Q_RFX.Rds")
  534. saveRDS(BICcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICccompare_Q_RFX.Rds")
  535. write.table(LL_Q_RFX.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.Q_RFX.pval.txt", quote = F, sep=",", col.names = F)
  536. write.table(LLcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_Q_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  537. write.table(AICcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_Q_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  538. write.table(BICcompare_Q_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_Q_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  539. }
  540. #Linear_MODEL_RFX
  541. {
  542. # Linear_RFX_1
  543. Linear_RFX_1.outcomes <- lapply(DVlist, function(x) {
  544. lme4::lmer(substitute(i ~ bully_victim * age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  545. for (outcome in 1:88) {
  546. LL_L_RFX_1 <- append(LL_L_RFX_1, logLik(Linear_RFX_1.outcomes[[outcome]], REML=T))
  547. AIC_L_RFX_1 <- append(AIC_L_RFX_1, AICc(Linear_RFX_1.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  548. BIC_L_RFX_1 <- append(BIC_L_RFX_1, BICc(Linear_RFX_1.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  549. }
  550. # Linear_RFX_2
  551. Linear_RFX_2.outcomes <- lapply(DVlist, function(x) {
  552. lme4::lmer(substitute(i ~ bully_victim * age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  553. for (outcome in 1:88) {
  554. LL_L_RFX_2 <- append(LL_L_RFX_2, logLik(Linear_RFX_2.outcomes[[outcome]], REML=T))
  555. AIC_L_RFX_2 <- append(AIC_L_RFX_2, AICc(Linear_RFX_2.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  556. BIC_L_RFX_2 <- append(BIC_L_RFX_2, BICc(Linear_RFX_2.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  557. }
  558. # observe all intercept AICc in a table
  559. AICcompare_L_RFX <- data.frame(DVlist, AIC_L_RFX_1, AIC_L_RFX_2)
  560. BICcompare_L_RFX <- data.frame(DVlist, BIC_L_RFX_1, BIC_L_RFX_2)
  561. LLcompare_L_RFX <- data.frame(DVlist, LL_L_RFX_1, LL_L_RFX_2)
  562. # LL.FFX.pmat <- c()
  563. for (outcome in 1:88) {
  564. # extract p-values only
  565. # do the interaction effect and the PE variable add anything to the null prediction model?
  566. dif_L_RFX <- anova(Linear_RFX_1.outcomes[[outcome]], Linear_RFX_2.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  567. LL_L_RFX.pmat <- append(LL_L_RFX.pmat,dif_L_RFX[2,1])
  568. }
  569. # create a list of FFX model comparisons (M0_M2 = null compared to full, M0_M2B = null compared to reduced model, M2_M2B = full compared to reduced)
  570. compared_L_RFX <- c("Linear_RFX1_Linear_RFX2")
  571. # IS create a dataframe with outcome scales as rows, and 3 columns showing model comparisons
  572. # Create a dataframe with the p-values for different variables
  573. LL_L_RFX.pvals <- data.frame(
  574. compared_L_RFX,
  575. "lh_bankssts_volume" = LL_L_RFX.pmat[1],
  576. "lh_caudalanteriorcingulate_volume" = LL_L_RFX.pmat[2],
  577. "lh_caudalmiddlefrontal_volume" = LL_L_RFX.pmat[3],
  578. "lh_cuneus_volume" = LL_L_RFX.pmat[4],
  579. "lh_entorhinal_volume" = LL_L_RFX.pmat[5],
  580. "lh_fusiform_volume" = LL_L_RFX.pmat[6],
  581. "lh_inferiorparietal_volume" = LL_L_RFX.pmat[7],
  582. "lh_inferiortemporal_volume" = LL_L_RFX.pmat[8],
  583. "lh_isthmuscingulate_volume" = LL_L_RFX.pmat[9],
  584. "lh_lateraloccipital_volume" = LL_L_RFX.pmat[10],
  585. "lh_lateralorbitofrontal_volume" = LL_L_RFX.pmat[11],
  586. "lh_lingual_volume" = LL_L_RFX.pmat[12],
  587. "lh_medialorbitofrontal_volume" = LL_L_RFX.pmat[13],
  588. "lh_middletemporal_volume" = LL_L_RFX.pmat[14],
  589. "lh_parahippocampal_volume" = LL_L_RFX.pmat[15],
  590. "lh_paracentral_volume" = LL_L_RFX.pmat[16],
  591. "lh_parsopercularis_volume" = LL_L_RFX.pmat[17],
  592. "lh_parsorbitalis_volume" = LL_L_RFX.pmat[18],
  593. "lh_parstriangularis_volume" = LL_L_RFX.pmat[19],
  594. "lh_pericalcarine_volume" = LL_L_RFX.pmat[20],
  595. "lh_postcentral_volume" = LL_L_RFX.pmat[21],
  596. "lh_posteriorcingulate_volume" = LL_L_RFX.pmat[22],
  597. "lh_precentral_volume" = LL_L_RFX.pmat[23],
  598. "lh_precuneus_volume" = LL_L_RFX.pmat[24],
  599. "lh_rostralanteriorcingulate_volume" = LL_L_RFX.pmat[25],
  600. "lh_rostralmiddlefrontal_volume" = LL_L_RFX.pmat[26],
  601. "lh_superiorfrontal_volume" = LL_L_RFX.pmat[27],
  602. "lh_superiorparietal_volume" = LL_L_RFX.pmat[28],
  603. "lh_superiortemporal_volume" = LL_L_RFX.pmat[29],
  604. "lh_supramarginal_volume" = LL_L_RFX.pmat[30],
  605. "lh_frontalpole_volume" = LL_L_RFX.pmat[31],
  606. "lh_temporalpole_volume" = LL_L_RFX.pmat[32],
  607. "lh_transversetemporal_volume" = LL_L_RFX.pmat[33],
  608. "lh_insula_volume" = LL_L_RFX.pmat[34],
  609. "rh_bankssts_volume" = LL_L_RFX.pmat[35],
  610. "rh_caudalanteriorcingulate_volume" = LL_L_RFX.pmat[36],
  611. "rh_caudalmiddlefrontal_volume" = LL_L_RFX.pmat[37],
  612. "rh_cuneus_volume" = LL_L_RFX.pmat[38],
  613. "rh_entorhinal_volume" = LL_L_RFX.pmat[39],
  614. "rh_fusiform_volume" = LL_L_RFX.pmat[40],
  615. "rh_inferiorparietal_volume" = LL_L_RFX.pmat[41],
  616. "rh_inferiortemporal_volume" = LL_L_RFX.pmat[42],
  617. "rh_isthmuscingulate_volume" = LL_L_RFX.pmat[43],
  618. "rh_lateraloccipital_volume" = LL_L_RFX.pmat[44],
  619. "rh_lateralorbitofrontal_volume" = LL_L_RFX.pmat[45],
  620. "rh_lingual_volume" = LL_L_RFX.pmat[46],
  621. "rh_medialorbitofrontal_volume" = LL_L_RFX.pmat[47],
  622. "rh_middletemporal_volume" = LL_L_RFX.pmat[48],
  623. "rh_parahippocampal_volume" = LL_L_RFX.pmat[49],
  624. "rh_paracentral_volume" = LL_L_RFX.pmat[50],
  625. "rh_parsopercularis_volume" = LL_L_RFX.pmat[51],
  626. "rh_parsorbitalis_volume" = LL_L_RFX.pmat[52],
  627. "rh_parstriangularis_volume" = LL_L_RFX.pmat[53],
  628. "rh_pericalcarine_volume" = LL_L_RFX.pmat[54],
  629. "rh_postcentral_volume" = LL_L_RFX.pmat[55],
  630. "rh_posteriorcingulate_volume" = LL_L_RFX.pmat[56],
  631. "rh_precentral_volume" = LL_L_RFX.pmat[57],
  632. "rh_precuneus_volume" = LL_L_RFX.pmat[58],
  633. "rh_rostralanteriorcingulate_volume" = LL_L_RFX.pmat[59],
  634. "rh_rostralmiddlefrontal_volume" = LL_L_RFX.pmat[60],
  635. "rh_superiorfrontal_volume" = LL_L_RFX.pmat[61],
  636. "rh_superiorparietal_volume" = LL_L_RFX.pmat[62],
  637. "rh_superiortemporal_volume" = LL_L_RFX.pmat[63],
  638. "rh_supramarginal_volume" = LL_L_RFX.pmat[64],
  639. "rh_frontalpole_volume" = LL_L_RFX.pmat[65],
  640. "rh_temporalpole_volume" = LL_L_RFX.pmat[66],
  641. "rh_transversetemporal_volume" = LL_L_RFX.pmat[67],
  642. "rh_insula_volume" = LL_L_RFX.pmat[68],
  643. "Left_Cerebellum_Cortex" = LL_L_RFX.pmat[69],
  644. "Left_Thalamus_Proper" = LL_L_RFX.pmat[70],
  645. "Left_Caudate" = LL_L_RFX.pmat[71],
  646. "Left_Putamen" = LL_L_RFX.pmat[72],
  647. "Left_Pallidum" = LL_L_RFX.pmat[73],
  648. "Brain_Stem" = LL_L_RFX.pmat[74],
  649. "Left_Hippocampus" = LL_L_RFX.pmat[75],
  650. "Left_Amygdala" = LL_L_RFX.pmat[76],
  651. "Left_Accumbens_area" = LL_L_RFX.pmat[77],
  652. "Left_VentralDC" = LL_L_RFX.pmat[78],
  653. "Right_Cerebellum_Cortex" = LL_L_RFX.pmat[79],
  654. "Right_Thalamus_Proper" = LL_L_RFX.pmat[80],
  655. "Right_Caudate" = LL_L_RFX.pmat[81],
  656. "Right_Putamen" = LL_L_RFX.pmat[82],
  657. "Right_Pallidum" = LL_L_RFX.pmat[83],
  658. "Right_Hippocampus" = LL_L_RFX.pmat[84],
  659. "Right_Amygdala" = LL_L_RFX.pmat[85],
  660. "Right_Accumbens_area" = LL_L_RFX.pmat[86],
  661. "Right_VentralDC" = LL_L_RFX.pmat[87],
  662. "TotalGrayVol" = LL_L_RFX.pmat[88]
  663. )
  664. # transpose
  665. LL_L_RFX.pvals<-t(LL_L_RFX.pvals)
  666. #save IS output
  667. saveRDS(LL_L_RFX.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.L_RFX.pvals.Rds")
  668. saveRDS(LLcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_L_RFX.Rds")
  669. saveRDS(AICcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICccompare_L_RFX.Rds")
  670. saveRDS(BICcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICccompare_L_RFX.Rds")
  671. write.table(LL_L_RFX.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.L_RFX.pval.txt", quote = F, sep=",", col.names = F)
  672. write.table(LLcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_L_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  673. write.table(AICcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_L_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  674. write.table(BICcompare_L_RFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_L_RFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  675. }
  676. #Quad_MODEL_FFX
  677. {
  678. # Null Quad MODEL
  679. Null_Quad.outcomes <- lapply(DVlist, function(x) {
  680. lme4::lmer(substitute(i ~ age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  681. for (outcome in 1:88) {
  682. LL_FFX_null_Q <- append(LL_FFX_null_Q, logLik(Null_Quad.outcomes[[outcome]], REML=T))
  683. AIC_FFX_null_Q <- append(AIC_FFX_null_Q, AICc(Null_Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  684. BIC_FFX_null_Q <- append(BIC_FFX_null_Q, BICc(Null_Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  685. }
  686. # Quad_Simple MODEL 1
  687. Quad_simple.outcomes <- lapply(DVlist, function(x) {
  688. lme4::lmer(substitute(i ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  689. for (outcome in 1:88) {
  690. LL_FFX_simple_Q <- append(LL_FFX_simple_Q, logLik(Quad_simple.outcomes[[outcome]], REML=T))
  691. AIC_FFX_simple_Q <- append(AIC_FFX_simple_Q, AICc(Quad_simple.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  692. BIC_FFX_simple_Q <- append(BIC_FFX_simple_Q, BICc(Null_Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  693. }
  694. # Quad MODEL 1
  695. Quad_complex.outcomes <- lapply(DVlist, function(x) {
  696. lme4::lmer(substitute(i ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  697. for (outcome in 1:88) {
  698. LL_FFX_complex_Q <- append(LL_FFX_complex_Q, logLik(Quad_complex.outcomes[[outcome]], REML=T))
  699. AIC_FFX_complex_Q <- append(AIC_FFX_complex_Q, AICc(Quad_complex.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  700. BIC_FFX_complex_Q <- append(BIC_FFX_complex_Q, BICc(Null_Quad.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  701. }
  702. # observe all log likelihoods in a table
  703. LLcompare_Q_FFX <- data.frame(DVlist, LL_FFX_null_Q, LL_FFX_simple_Q, LL_FFX_complex_Q)
  704. AICcompare_Q_FFX <- data.frame(DVlist, AIC_FFX_null_Q, AIC_FFX_simple_Q, AIC_FFX_complex_Q)
  705. BICcompare_Q_FFX <- data.frame(DVlist, BIC_FFX_null_Q, BIC_FFX_simple_Q, BIC_FFX_complex_Q)
  706. compared_FFX_IS_Q <- c("Null_Simple", "Null_Complex", "Simple_Complex")
  707. # LL.FFX.pmat <- c()
  708. for (outcome in 1:88) {
  709. # extract p-values only
  710. # do the interaction effect and the PE variable add anything to the null prediction model?
  711. dif.0.2_FFX_Q <- anova(Null_Quad.outcomes[[outcome]], Quad_simple.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  712. LL.FFX_Q.pmat <- append(LL.FFX_Q.pmat,dif.0.2_FFX_Q[2,1])
  713. dif.0.2B_FFX_Q <- anova(Null_Quad.outcomes[[outcome]], Quad_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  714. LL.FFX_Q.pmat <- append(LL.FFX_Q.pmat,dif.0.2B_FFX_Q[2,1])
  715. dif.2.2B_FFX_Q <- anova(Quad_simple.outcomes[[outcome]], Quad_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  716. LL.FFX_Q.pmat <- append(LL.FFX_Q.pmat,dif.2.2B_FFX_Q[2,1])
  717. }
  718. LL.FFX_Q.pvals <- data.frame(
  719. compared_FFX_IS_Q,
  720. "lh_bankssts_volume" = LL.FFX_Q.pmat[1:3],
  721. "lh_caudalanteriorcingulate_volume" = LL.FFX_Q.pmat[4:6],
  722. "lh_caudalmiddlefrontal_volume" = LL.FFX_Q.pmat[7:9],
  723. "lh_cuneus_volume" = LL.FFX_Q.pmat[10:12],
  724. "lh_entorhinal_volume" = LL.FFX_Q.pmat[13:15],
  725. "lh_fusiform_volume" = LL.FFX_Q.pmat[16:18],
  726. "lh_inferiorparietal_volume" = LL.FFX_Q.pmat[19:21],
  727. "lh_inferiortemporal_volume" = LL.FFX_Q.pmat[22:24],
  728. "lh_isthmuscingulate_volume" = LL.FFX_Q.pmat[25:27],
  729. "lh_lateraloccipital_volume" = LL.FFX_Q.pmat[28:30],
  730. "lh_lateralorbitofrontal_volume" = LL.FFX_Q.pmat[31:33],
  731. "lh_lingual_volume" = LL.FFX_Q.pmat[34:36],
  732. "lh_medialorbitofrontal_volume" = LL.FFX_Q.pmat[37:39],
  733. "lh_middletemporal_volume" = LL.FFX_Q.pmat[40:42],
  734. "lh_parahippocampal_volume" = LL.FFX_Q.pmat[43:45],
  735. "lh_paracentral_volume" = LL.FFX_Q.pmat[46:48],
  736. "lh_parsopercularis_volume" = LL.FFX_Q.pmat[49:51],
  737. "lh_parsorbitalis_volume" = LL.FFX_Q.pmat[52:54],
  738. "lh_parstriangularis_volume" = LL.FFX_Q.pmat[55:57],
  739. "lh_pericalcarine_volume" = LL.FFX_Q.pmat[58:60],
  740. "lh_postcentral_volume" = LL.FFX_Q.pmat[61:63],
  741. "lh_posteriorcingulate_volume" = LL.FFX_Q.pmat[64:66],
  742. "lh_precentral_volume" = LL.FFX_Q.pmat[67:69],
  743. "lh_precuneus_volume" = LL.FFX_Q.pmat[70:72],
  744. "lh_rostralanteriorcingulate_volume" = LL.FFX_Q.pmat[73:75],
  745. "lh_rostralmiddlefrontal_volume" = LL.FFX_Q.pmat[76:78],
  746. "lh_superiorfrontal_volume" = LL.FFX_Q.pmat[79:81],
  747. "lh_superiorparietal_volume" = LL.FFX_Q.pmat[82:84],
  748. "lh_superiortemporal_volume" = LL.FFX_Q.pmat[85:87],
  749. "lh_supramarginal_volume" = LL.FFX_Q.pmat[88:90],
  750. "lh_frontalpole_volume" = LL.FFX_Q.pmat[91:93],
  751. "lh_temporalpole_volume" = LL.FFX_Q.pmat[94:96],
  752. "lh_transversetemporal_volume" = LL.FFX_Q.pmat[97:99],
  753. "lh_insula_volume" = LL.FFX_Q.pmat[100:102],
  754. "rh_bankssts_volume" = LL.FFX_Q.pmat[103:105],
  755. "rh_caudalanteriorcingulate_volume" = LL.FFX_Q.pmat[106:108],
  756. "rh_caudalmiddlefrontal_volume" = LL.FFX_Q.pmat[109:111],
  757. "rh_cuneus_volume" = LL.FFX_Q.pmat[112:114],
  758. "rh_entorhinal_volume" = LL.FFX_Q.pmat[115:117],
  759. "rh_fusiform_volume" = LL.FFX_Q.pmat[118:120],
  760. "rh_inferiorparietal_volume" = LL.FFX_Q.pmat[121:123],
  761. "rh_inferiortemporal_volume" = LL.FFX_Q.pmat[124:126],
  762. "rh_isthmuscingulate_volume" = LL.FFX_Q.pmat[127:129],
  763. "rh_lateraloccipital_volume" = LL.FFX_Q.pmat[130:132],
  764. "rh_lateralorbitofrontal_volume" = LL.FFX_Q.pmat[133:135],
  765. "rh_lingual_volume" = LL.FFX_Q.pmat[136:138],
  766. "rh_medialorbitofrontal_volume" = LL.FFX_Q.pmat[139:141],
  767. "rh_middletemporal_volume" = LL.FFX_Q.pmat[142:144],
  768. "rh_parahippocampal_volume" = LL.FFX_Q.pmat[145:147],
  769. "rh_paracentral_volume" = LL.FFX_Q.pmat[148:150],
  770. "rh_parsopercularis_volume" = LL.FFX_Q.pmat[151:153],
  771. "rh_parsorbitalis_volume" = LL.FFX_Q.pmat[154:156],
  772. "rh_parstriangularis_volume" = LL.FFX_Q.pmat[157:159],
  773. "rh_pericalcarine_volume" = LL.FFX_Q.pmat[160:162],
  774. "rh_postcentral_volume" = LL.FFX_Q.pmat[163:165],
  775. "rh_posteriorcingulate_volume" = LL.FFX_Q.pmat[166:168],
  776. "rh_precentral_volume" = LL.FFX_Q.pmat[169:171],
  777. "rh_precuneus_volume" = LL.FFX_Q.pmat[172:174],
  778. "rh_rostralanteriorcingulate_volume" = LL.FFX_Q.pmat[175:177],
  779. "rh_rostralmiddlefrontal_volume" = LL.FFX_Q.pmat[178:180],
  780. "rh_superiorfrontal_volume" = LL.FFX_Q.pmat[181:183],
  781. "rh_superiorparietal_volume" = LL.FFX_Q.pmat[184:186],
  782. "rh_superiortemporal_volume" = LL.FFX_Q.pmat[187:189],
  783. "rh_supramarginal_volume" = LL.FFX_Q.pmat[190:192],
  784. "rh_frontalpole_volume" = LL.FFX_Q.pmat[193:195],
  785. "rh_temporalpole_volume" = LL.FFX_Q.pmat[196:198],
  786. "rh_transversetemporal_volume" = LL.FFX_Q.pmat[199:201],
  787. "rh_insula_volume" = LL.FFX_Q.pmat[202:204],
  788. "Left_Cerebellum_Cortex" = LL.FFX_Q.pmat[205:207],
  789. "Left_Thalamus_Proper" = LL.FFX_Q.pmat[208:210],
  790. "Left_Caudate" = LL.FFX_Q.pmat[211:213],
  791. "Left_Putamen" = LL.FFX_Q.pmat[214:216],
  792. "Left_Pallidum" = LL.FFX_Q.pmat[217:219],
  793. "Brain_Stem" = LL.FFX_Q.pmat[220:222],
  794. "Left_Hippocampus" = LL.FFX_Q.pmat[223:225],
  795. "Left_Amygdala" = LL.FFX_Q.pmat[226:228],
  796. "Left_Accumbens_area" = LL.FFX_Q.pmat[229:231],
  797. "Left_VentralDC" = LL.FFX_Q.pmat[232:234],
  798. "Right_Cerebellum_Cortex" = LL.FFX_Q.pmat[235:237],
  799. "Right_Thalamus_Proper" = LL.FFX_Q.pmat[238:240],
  800. "Right_Caudate" = LL.FFX_Q.pmat[241:243],
  801. "Right_Putamen" = LL.FFX_Q.pmat[244:246],
  802. "Right_Pallidum" = LL.FFX_Q.pmat[247:249],
  803. "Right_Hippocampus" = LL.FFX_Q.pmat[250:252],
  804. "Right_Amygdala" = LL.FFX_Q.pmat[253:255],
  805. "Right_Accumbens_area" = LL.FFX_Q.pmat[256:258],
  806. "Right_VentralDC" = LL.FFX_Q.pmat[259:261],
  807. "TotalGrayVol" = LL.FFX_Q.pmat[262:264]
  808. )
  809. LL.FFX_Q.pvals<-t(LL.FFX_Q.pvals)
  810. #save IS output
  811. saveRDS(LL.FFX_Q.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.Q_FFX.pvals.Rds")
  812. saveRDS(LLcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_Q_FFX.Rds")
  813. saveRDS(AICcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_Q_FFX.Rds")
  814. saveRDS(BICcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_Q_FFX.Rds")
  815. write.table(LL.FFX_Q.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.Q_FFX.pval.txt", quote = F, sep=",", col.names = F)
  816. write.table(LLcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_Q_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  817. write.table(AICcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_Q_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  818. write.table(BICcompare_Q_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_Q_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  819. }
  820. #Linear_MODEL_FFX
  821. {
  822. # Null Linear MODEL
  823. Null_Linear.outcomes <- lapply(DVlist, function(x) {
  824. lme4::lmer(substitute(i ~ age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  825. for (outcome in 1:88) {
  826. LL_FFX_null_L <- append(LL_FFX_null_L, logLik(Null_Linear.outcomes[[outcome]], REML=T))
  827. AIC_FFX_null_L <- append(AIC_FFX_null_L, AICc(Null_Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  828. BIC_FFX_null_L <- append(BIC_FFX_null_L, BICc(Null_Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  829. }
  830. # Linear_Simple MODEL 1
  831. Linear_simple.outcomes <- lapply(DVlist, function(x) {
  832. lme4::lmer(substitute(i ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  833. for (outcome in 1:88) {
  834. LL_FFX_simple_L <- append(LL_FFX_simple_L, logLik(Linear_simple.outcomes[[outcome]], REML=T))
  835. AIC_FFX_simple_L <- append(AIC_FFX_simple_L, AICc(Linear_simple.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  836. BIC_FFX_simple_L <- append(BIC_FFX_simple_L, BICc(Null_Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  837. }
  838. # Linear MODEL 1
  839. Linear_complex.outcomes <- lapply(DVlist, function(x) {
  840. lme4::lmer(substitute(i ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), list(i = as.name(x))), data=IMAGEN_bully, control = lmerControl(optimizer ="bobyqa"))})
  841. for (outcome in 1:88) {
  842. LL_FFX_complex_L <- append(LL_FFX_complex_L, logLik(Linear_complex.outcomes[[outcome]], REML=T))
  843. AIC_FFX_complex_L <- append(AIC_FFX_complex_L, AICc(Linear_complex.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  844. BIC_FFX_complex_L <- append(BIC_FFX_complex_L, BICc(Null_Linear.outcomes[[outcome]], second.ord = TRUE, refit = TRUE))
  845. }
  846. # observe all log likelihoods in a table
  847. LLcompare_L_FFX <- data.frame(DVlist, LL_FFX_null_L, LL_FFX_simple_L, LL_FFX_complex_L)
  848. AICcompare_L_FFX <- data.frame(DVlist, AIC_FFX_null_L, AIC_FFX_simple_L, AIC_FFX_complex_L)
  849. BICcompare_L_FFX <- data.frame(DVlist, BIC_FFX_null_L, BIC_FFX_simple_L, BIC_FFX_complex_L)
  850. compared_FFX_L <- c("Null_Simple", "Null_Complex", "Simple_Complex")
  851. # LL.FFX.pmat <- c()
  852. for (outcome in 1:88) {
  853. # extract p-values only
  854. # do the interaction effect and the PE variable add anything to the null prediction model?
  855. dif.0.2_FFX_L <- anova(Null_Linear.outcomes[[outcome]], Linear_simple.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  856. LL.FFX_L.pmat <- append(LL.FFX_L.pmat,dif.0.2_FFX_L[2,1])
  857. dif.0.2B_FFX_L <- anova(Null_Linear.outcomes[[outcome]], Linear_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  858. LL.FFX_L.pmat <- append(LL.FFX_L.pmat,dif.0.2B_FFX_L[2,1])
  859. dif.2.2B_FFX_L <- anova(Linear_simple.outcomes[[outcome]], Linear_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  860. LL.FFX_L.pmat <- append(LL.FFX_L.pmat,dif.2.2B_FFX_L[2,1])
  861. }
  862. LL.FFX_L.pvals <- data.frame(
  863. compared_FFX_L,
  864. "lh_bankssts_volume" = LL.FFX_L.pmat[1:3],
  865. "lh_caudalanteriorcingulate_volume" = LL.FFX_L.pmat[4:6],
  866. "lh_caudalmiddlefrontal_volume" = LL.FFX_L.pmat[7:9],
  867. "lh_cuneus_volume" = LL.FFX_L.pmat[10:12],
  868. "lh_entorhinal_volume" = LL.FFX_L.pmat[13:15],
  869. "lh_fusiform_volume" = LL.FFX_L.pmat[16:18],
  870. "lh_inferiorparietal_volume" = LL.FFX_L.pmat[19:21],
  871. "lh_inferiortemporal_volume" = LL.FFX_L.pmat[22:24],
  872. "lh_isthmuscingulate_volume" = LL.FFX_L.pmat[25:27],
  873. "lh_lateraloccipital_volume" = LL.FFX_L.pmat[28:30],
  874. "lh_lateralorbitofrontal_volume" = LL.FFX_L.pmat[31:33],
  875. "lh_lingual_volume" = LL.FFX_L.pmat[34:36],
  876. "lh_medialorbitofrontal_volume" = LL.FFX_L.pmat[37:39],
  877. "lh_middletemporal_volume" = LL.FFX_L.pmat[40:42],
  878. "lh_parahippocampal_volume" = LL.FFX_L.pmat[43:45],
  879. "lh_paracentral_volume" = LL.FFX_L.pmat[46:48],
  880. "lh_parsopercularis_volume" = LL.FFX_L.pmat[49:51],
  881. "lh_parsorbitalis_volume" = LL.FFX_L.pmat[52:54],
  882. "lh_parstriangularis_volume" = LL.FFX_L.pmat[55:57],
  883. "lh_pericalcarine_volume" = LL.FFX_L.pmat[58:60],
  884. "lh_postcentral_volume" = LL.FFX_L.pmat[61:63],
  885. "lh_posteriorcingulate_volume" = LL.FFX_L.pmat[64:66],
  886. "lh_precentral_volume" = LL.FFX_L.pmat[67:69],
  887. "lh_precuneus_volume" = LL.FFX_L.pmat[70:72],
  888. "lh_rostralanteriorcingulate_volume" = LL.FFX_L.pmat[73:75],
  889. "lh_rostralmiddlefrontal_volume" = LL.FFX_L.pmat[76:78],
  890. "lh_superiorfrontal_volume" = LL.FFX_L.pmat[79:81],
  891. "lh_superiorparietal_volume" = LL.FFX_L.pmat[82:84],
  892. "lh_superiortemporal_volume" = LL.FFX_L.pmat[85:87],
  893. "lh_supramarginal_volume" = LL.FFX_L.pmat[88:90],
  894. "lh_frontalpole_volume" = LL.FFX_L.pmat[91:93],
  895. "lh_temporalpole_volume" = LL.FFX_L.pmat[94:96],
  896. "lh_transversetemporal_volume" = LL.FFX_L.pmat[97:99],
  897. "lh_insula_volume" = LL.FFX_L.pmat[100:102],
  898. "rh_bankssts_volume" = LL.FFX_L.pmat[103:105],
  899. "rh_caudalanteriorcingulate_volume" = LL.FFX_L.pmat[106:108],
  900. "rh_caudalmiddlefrontal_volume" = LL.FFX_L.pmat[109:111],
  901. "rh_cuneus_volume" = LL.FFX_L.pmat[112:114],
  902. "rh_entorhinal_volume" = LL.FFX_L.pmat[115:117],
  903. "rh_fusiform_volume" = LL.FFX_L.pmat[118:120],
  904. "rh_inferiorparietal_volume" = LL.FFX_L.pmat[121:123],
  905. "rh_inferiortemporal_volume" = LL.FFX_L.pmat[124:126],
  906. "rh_isthmuscingulate_volume" = LL.FFX_L.pmat[127:129],
  907. "rh_lateraloccipital_volume" = LL.FFX_L.pmat[130:132],
  908. "rh_lateralorbitofrontal_volume" = LL.FFX_L.pmat[133:135],
  909. "rh_lingual_volume" = LL.FFX_L.pmat[136:138],
  910. "rh_medialorbitofrontal_volume" = LL.FFX_L.pmat[139:141],
  911. "rh_middletemporal_volume" = LL.FFX_L.pmat[142:144],
  912. "rh_parahippocampal_volume" = LL.FFX_L.pmat[145:147],
  913. "rh_paracentral_volume" = LL.FFX_L.pmat[148:150],
  914. "rh_parsopercularis_volume" = LL.FFX_L.pmat[151:153],
  915. "rh_parsorbitalis_volume" = LL.FFX_L.pmat[154:156],
  916. "rh_parstriangularis_volume" = LL.FFX_L.pmat[157:159],
  917. "rh_pericalcarine_volume" = LL.FFX_L.pmat[160:162],
  918. "rh_postcentral_volume" = LL.FFX_L.pmat[163:165],
  919. "rh_posteriorcingulate_volume" = LL.FFX_L.pmat[166:168],
  920. "rh_precentral_volume" = LL.FFX_L.pmat[169:171],
  921. "rh_precuneus_volume" = LL.FFX_L.pmat[172:174],
  922. "rh_rostralanteriorcingulate_volume" = LL.FFX_L.pmat[175:177],
  923. "rh_rostralmiddlefrontal_volume" = LL.FFX_L.pmat[178:180],
  924. "rh_superiorfrontal_volume" = LL.FFX_L.pmat[181:183],
  925. "rh_superiorparietal_volume" = LL.FFX_L.pmat[184:186],
  926. "rh_superiortemporal_volume" = LL.FFX_L.pmat[187:189],
  927. "rh_supramarginal_volume" = LL.FFX_L.pmat[190:192],
  928. "rh_frontalpole_volume" = LL.FFX_L.pmat[193:195],
  929. "rh_temporalpole_volume" = LL.FFX_L.pmat[196:198],
  930. "rh_transversetemporal_volume" = LL.FFX_L.pmat[199:201],
  931. "rh_insula_volume" = LL.FFX_L.pmat[202:204],
  932. "Left_Cerebellum_Cortex" = LL.FFX_L.pmat[205:207],
  933. "Left_Thalamus_Proper" = LL.FFX_L.pmat[208:210],
  934. "Left_Caudate" = LL.FFX_L.pmat[211:213],
  935. "Left_Putamen" = LL.FFX_L.pmat[214:216],
  936. "Left_Pallidum" = LL.FFX_L.pmat[217:219],
  937. "Brain_Stem" = LL.FFX_L.pmat[220:222],
  938. "Left_Hippocampus" = LL.FFX_L.pmat[223:225],
  939. "Left_Amygdala" = LL.FFX_L.pmat[226:228],
  940. "Left_Accumbens_area" = LL.FFX_L.pmat[229:231],
  941. "Left_VentralDC" = LL.FFX_L.pmat[232:234],
  942. "Right_Cerebellum_Cortex" = LL.FFX_L.pmat[235:237],
  943. "Right_Thalamus_Proper" = LL.FFX_L.pmat[238:240],
  944. "Right_Caudate" = LL.FFX_L.pmat[241:243],
  945. "Right_Putamen" = LL.FFX_L.pmat[244:246],
  946. "Right_Pallidum" = LL.FFX_L.pmat[247:249],
  947. "Right_Hippocampus" = LL.FFX_L.pmat[250:252],
  948. "Right_Amygdala" = LL.FFX_L.pmat[253:255],
  949. "Right_Accumbens_area" = LL.FFX_L.pmat[256:258],
  950. "Right_VentralDC" = LL.FFX_L.pmat[259:261],
  951. "TotalGrayVol" = LL.FFX_L.pmat[262:264]
  952. )
  953. LL.FFX_L.pvals<-t(LL.FFX_L.pvals)
  954. #save IS output
  955. saveRDS(LL.FFX_L.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.FFX_L.pvals.Rds")
  956. saveRDS(LLcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_L_FFX.Rds")
  957. saveRDS(AICcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_L_FFX.Rds")
  958. saveRDS(BICcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_L_FFX.Rds")
  959. write.table(LL.FFX_L.pvals, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LL.FFX_L.pvals.txt", quote = F, sep=",", col.names = F)
  960. write.table(LLcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/LLcompare_L_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  961. write.table(AICcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/AICcompare_L_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  962. write.table(BICcompare_L_FFX, file = "/Users/michaelconnaughton/Desktop/IMAGEN/Model_Performance_results/BICcompare_L_FFX.txt", quote = F, sep=",", row.names = F, col.names = T)
  963. # observe all log likelihoods in a table
  964. LLcompare_Quad_model <- data.frame(DVlist, LL_FFX_simple_1, LL_FFX_complex_1)
  965. # observe all AICc in a table
  966. AICccompare_Quad_model <- data.frame(DVlist, AIC_FFX_simple_1, AIC_FFX_complex_1)
  967. compared_FFX_IS_Q <- c("Null_Simple", "Null_Complex", "Simple_Complex")
  968. # LL.FFX.pmat <- c()
  969. for (outcome in 1:88) {
  970. # extract p-values only
  971. # do the interaction effect and the PE variable add anything to the null prediction model?
  972. dif.0.2_IS_Q <- anova(Null_Quad.outcomes[[outcome]], Quad_simple.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  973. LL.FFX_IS_Q.pmat <- append(LL.FFX_IS_Q.pmat,dif.0.2_IS_Q[2,1])
  974. dif.0.2B_IS_Q <- anova(Null_Quad.outcomes[[outcome]], Quad_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  975. LL.FFX_IS_Q.pmat <- append(LL.FFX_IS_Q.pmat,dif.0.2B_IS_Q[2,1])
  976. dif.2.2B_IS_Q <- anova(Quad_simple.outcomes[[outcome]], Quad_complex.outcomes[[outcome]], refit = TRUE)["Pr(>Chisq)"]
  977. LL.FFX_IS_Q.pmat <- append(LL.FFX_IS_Q.pmat,dif.2.2B_IS_Q[2,1])
  978. }
  979. }
  980. #LL.FFX_IS_Q.pvals_DATA_FRAME
  981. {
  982. LL.FFX_IS_Q.pvals <- data.frame(
  983. compared_FFX_IS_Q,
  984. "lh_bankssts_volume" = LL.FFX_IS_Q.pmat[1:3],
  985. "lh_caudalanteriorcingulate_volume" = LL.FFX_IS_Q.pmat[4:6],
  986. "lh_caudalmiddlefrontal_volume" = LL.FFX_IS_Q.pmat[7:9],
  987. "lh_cuneus_volume" = LL.FFX_IS_Q.pmat[10:12],
  988. "lh_entorhinal_volume" = LL.FFX_IS_Q.pmat[13:15],
  989. "lh_fusiform_volume" = LL.FFX_IS_Q.pmat[16:18],
  990. "lh_inferiorparietal_volume" = LL.FFX_IS_Q.pmat[19:21],
  991. "lh_inferiortemporal_volume" = LL.FFX_IS_Q.pmat[22:24],
  992. "lh_isthmuscingulate_volume" = LL.FFX_IS_Q.pmat[25:27],
  993. "lh_lateraloccipital_volume" = LL.FFX_IS_Q.pmat[28:30],
  994. "lh_lateralorbitofrontal_volume" = LL.FFX_IS_Q.pmat[31:33],
  995. "lh_lingual_volume" = LL.FFX_IS_Q.pmat[34:36],
  996. "lh_medialorbitofrontal_volume" = LL.FFX_IS_Q.pmat[37:39],
  997. "lh_middletemporal_volume" = LL.FFX_IS_Q.pmat[40:42],
  998. "lh_parahippocampal_volume" = LL.FFX_IS_Q.pmat[43:45],
  999. "lh_paracentral_volume" = LL.FFX_IS_Q.pmat[46:48],
  1000. "lh_parsopercularis_volume" = LL.FFX_IS_Q.pmat[49:51],
  1001. "lh_parsorbitalis_volume" = LL.FFX_IS_Q.pmat[52:54],
  1002. "lh_parstriangularis_volume" = LL.FFX_IS_Q.pmat[55:57],
  1003. "lh_pericalcarine_volume" = LL.FFX_IS_Q.pmat[58:60],
  1004. "lh_postcentral_volume" = LL.FFX_IS_Q.pmat[61:63],
  1005. "lh_posteriorcingulate_volume" = LL.FFX_IS_Q.pmat[64:66],
  1006. "lh_precentral_volume" = LL.FFX_IS_Q.pmat[67:69],
  1007. "lh_precuneus_volume" = LL.FFX_IS_Q.pmat[70:72],
  1008. "lh_rostralanteriorcingulate_volume" = LL.FFX_IS_Q.pmat[73:75],
  1009. "lh_rostralmiddlefrontal_volume" = LL.FFX_IS_Q.pmat[76:78],
  1010. "lh_superiorfrontal_volume" = LL.FFX_IS_Q.pmat[79:81],
  1011. "lh_superiorparietal_volume" = LL.FFX_IS_Q.pmat[82:84],
  1012. "lh_superiortemporal_volume" = LL.FFX_IS_Q.pmat[85:87],
  1013. "lh_supramarginal_volume" = LL.FFX_IS_Q.pmat[88:90],
  1014. "lh_frontalpole_volume" = LL.FFX_IS_Q.pmat[91:93],
  1015. "lh_temporalpole_volume" = LL.FFX_IS_Q.pmat[94:96],
  1016. "lh_transversetemporal_volume" = LL.FFX_IS_Q.pmat[97:99],
  1017. "lh_insula_volume" = LL.FFX_IS_Q.pmat[100:102],
  1018. "rh_bankssts_volume" = LL.FFX_IS_Q.pmat[103:105],
  1019. "rh_caudalanteriorcingulate_volume" = LL.FFX_IS_Q.pmat[106:108],
  1020. "rh_caudalmiddlefrontal_volume" = LL.FFX_IS_Q.pmat[109:111],
  1021. "rh_cuneus_volume" = LL.FFX_IS_Q.pmat[112:114],
  1022. "rh_entorhinal_volume" = LL.FFX_IS_Q.pmat[115:117],
  1023. "rh_fusiform_volume" = LL.FFX_IS_Q.pmat[118:120],
  1024. "rh_inferiorparietal_volume" = LL.FFX_IS_Q.pmat[121:123],
  1025. "rh_inferiortemporal_volume" = LL.FFX_IS_Q.pmat[124:126],
  1026. "rh_isthmuscingulate_volume" = LL.FFX_IS_Q.pmat[127:129],
  1027. "rh_lateraloccipital_volume" = LL.FFX_IS_Q.pmat[130:132],
  1028. "rh_lateralorbitofrontal_volume" = LL.FFX_IS_Q.pmat[133:135],
  1029. "rh_lingual_volume" = LL.FFX_IS_Q.pmat[136:138],
  1030. "rh_medialorbitofrontal_volume" = LL.FFX_IS_Q.pmat[139:141],
  1031. "rh_middletemporal_volume" = LL.FFX_IS_Q.pmat[142:144],
  1032. "rh_parahippocampal_volume" = LL.FFX_IS_Q.pmat[145:147],
  1033. "rh_paracentral_volume" = LL.FFX_IS_Q.pmat[148:150],
  1034. "rh_parsopercularis_volume" = LL.FFX_IS_Q.pmat[151:153],
  1035. "rh_parsorbitalis_volume" = LL.FFX_IS_Q.pmat[154:156],
  1036. "rh_parstriangularis_volume" = LL.FFX_IS_Q.pmat[157:159],
  1037. "rh_pericalcarine_volume" = LL.FFX_IS_Q.pmat[160:162],
  1038. "rh_postcentral_volume" = LL.FFX_IS_Q.pmat[163:165],
  1039. "rh_posteriorcingulate_volume" = LL.FFX_IS_Q.pmat[166:168],
  1040. "rh_precentral_volume" = LL.FFX_IS_Q.pmat[169:171],
  1041. "rh_precuneus_volume" = LL.FFX_IS_Q.pmat[172:174],
  1042. "rh_rostralanteriorcingulate_volume" = LL.FFX_IS_Q.pmat[175:177],
  1043. "rh_rostralmiddlefrontal_volume" = LL.FFX_IS_Q.pmat[178:180],
  1044. "rh_superiorfrontal_volume" = LL.FFX_IS_Q.pmat[181:183],
  1045. "rh_superiorparietal_volume" = LL.FFX_IS_Q.pmat[184:186],
  1046. "rh_superiortemporal_volume" = LL.FFX_IS_Q.pmat[187:189],
  1047. "rh_supramarginal_volume" = LL.FFX_IS_Q.pmat[190:192],
  1048. "rh_frontalpole_volume" = LL.FFX_IS_Q.pmat[193:195],
  1049. "rh_temporalpole_volume" = LL.FFX_IS_Q.pmat[196:198],
  1050. "rh_transversetemporal_volume" = LL.FFX_IS_Q.pmat[199:201],
  1051. "rh_insula_volume" = LL.FFX_IS_Q.pmat[202:204],
  1052. "Left_Cerebellum_Cortex" = LL.FFX_IS_Q.pmat[205:207],
  1053. "Left_Thalamus_Proper" = LL.FFX_IS_Q.pmat[208:210],
  1054. "Left_Caudate" = LL.FFX_IS_Q.pmat[211:213],
  1055. "Left_Putamen" = LL.FFX_IS_Q.pmat[214:216],
  1056. "Left_Pallidum" = LL.FFX_IS_Q.pmat[217:219],
  1057. "Brain_Stem" = LL.FFX_IS_Q.pmat[220:222],
  1058. "Left_Hippocampus" = LL.FFX_IS_Q.pmat[223:225],
  1059. "Left_Amygdala" = LL.FFX_IS_Q.pmat[226:228],
  1060. "Left_Accumbens_area" = LL.FFX_IS_Q.pmat[229:231],
  1061. "Left_VentralDC" = LL.FFX_IS_Q.pmat[232:234],
  1062. "Right_Cerebellum_Cortex" = LL.FFX_IS_Q.pmat[235:237],
  1063. "Right_Thalamus_Proper" = LL.FFX_IS_Q.pmat[238:240],
  1064. "Right_Caudate" = LL.FFX_IS_Q.pmat[241:243],
  1065. "Right_Putamen" = LL.FFX_IS_Q.pmat[244:246],
  1066. "Right_Pallidum" = LL.FFX_IS_Q.pmat[247:249],
  1067. "Right_Hippocampus" = LL.FFX_IS_Q.pmat[250:252],
  1068. "Right_Amygdala" = LL.FFX_IS_Q.pmat[253:255],
  1069. "Right_Accumbens_area" = LL.FFX_IS_Q.pmat[256:258],
  1070. "Right_VentralDC" = LL.FFX_IS_Q.pmat[259:261],
  1071. "TotalGrayVol" = LL.FFX_IS_Q.pmat[262:264]
  1072. )
  1073. LL.FFX_IS_Q.pvals<-t(LL.FFX_IS_Q.pvals)
  1074. }
  1075. #Get Model Metrics
  1076. IMAGEN_bully$MatrixReasoning_Baseline <- scale(IMAGEN_bully$MatrixReasoning_Baseline)
  1077. IMAGEN_bully$bmi_Baseline <- scale(IMAGEN_bully$bmi_Baseline)
  1078. {
  1079. Linear_complex_results <- list()
  1080. # Loop through each DV
  1081. for (dv in DVlist) {
  1082. # Construct the formula
  1083. formula <- as.formula(paste(dv, "~ bully_victim + age + MatrixReasoning_Baseline + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site)"))
  1084. # Fit the model
  1085. model <- lmer(formula, data=IMAGEN_bully, REML=T, control=lmerControl(optimizer="bobyqa"))
  1086. # Get summary
  1087. model_summary <- summary(model)
  1088. # Extract estimates, standard errors, t-values, and p-values
  1089. coefficients <- data.frame(Effect = rownames(model_summary$coefficients),
  1090. Estimate = model_summary$coefficients[, "Estimate"],
  1091. Std_Error = model_summary$coefficients[, "Std. Error"],
  1092. T_Value = model_summary$coefficients[, "t value"],
  1093. P_Value = model_summary$coefficients[, "Pr(>|t|)"])
  1094. # Store results
  1095. Linear_complex_results[[dv]] <- coefficients
  1096. # Combine results into a single data frame
  1097. final_results <- bind_rows(Linear_complex_results, .id = "DV")
  1098. # Export results to a CSV file (can be opened in Word)
  1099. write.csv(final_results, "/Users/michaelconnaughton/Desktop/IMAGEN/sensitivity/Linear_simple_MatrixReasoning_Baseline.csv", row.names = FALSE)
  1100. }
  1101. }
  1102. #No RFX Models
  1103. {
  1104. Left_Thalamus_Proper_null <- lmer(Left_Thalamus_Proper ~ age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1105. Left_Thalamus_Proper_simple <- lmer(Left_Thalamus_Proper ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1106. Left_Thalamus_Proper_complex <- lmer(Left_Thalamus_Proper ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1107. lrtest(Left_Thalamus_Proper_simple, Left_Thalamus_Proper_null)
  1108. lrtest(Left_Thalamus_Proper_complex, Left_Thalamus_Proper_null)
  1109. lrtest(Left_Thalamus_Proper_simple, Left_Thalamus_Proper_complex)
  1110. BIC(Left_Thalamus_Proper_null)
  1111. BIC(Left_Thalamus_Proper_simple)
  1112. BIC(Left_Thalamus_Proper_complex)
  1113. AIC(Left_Thalamus_Proper_null)
  1114. AIC(Left_Thalamus_Proper_simple)
  1115. AIC(Left_Thalamus_Proper_complex)
  1116. #######
  1117. Right_Cerebellum_Cortex_null <- lmer(Right_Cerebellum_Cortex ~ age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1118. Right_Cerebellum_Cortex_simple <- lmer(Right_Cerebellum_Cortex ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1119. Right_Cerebellum_Cortex_complex <- lmer(Right_Cerebellum_Cortex ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data=IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer ="bobyqa"))
  1120. lrtest(Right_Cerebellum_Cortex_simple, Right_Cerebellum_Cortex_null)
  1121. lrtest(Right_Cerebellum_Cortex_complex, Right_Cerebellum_Cortex_null)
  1122. lrtest(Right_Cerebellum_Cortex_simple, Right_Cerebellum_Cortex_complex)
  1123. BIC(Right_Cerebellum_Cortex_null)
  1124. BIC(Right_Cerebellum_Cortex_simple)
  1125. BIC(Right_Cerebellum_Cortex_complex)
  1126. AIC(Right_Cerebellum_Cortex_null)
  1127. AIC(Right_Cerebellum_Cortex_simple)
  1128. AIC(Right_Cerebellum_Cortex_complex)
  1129. }
  1130. #Post Hoc Pval
  1131. {
  1132. # Numbers from the given list
  1133. Quad_complex_bully_age <- c(0.505623701, 2.45e-06, 0.198773759, 4.89e-05, 1.58e-05, 0.265626004, 0.197911997, 0.021335117, 0.537914697, 1.77e-06, 0.277460992, 0.199783815, 4.74e-05, 0.450645531, 0.006041167, 0.471654501, 0.212289872, 0.000591639, 0.715736216, 0.000452553, 0.636675949, 0.118869511, 0.815526581, 0.770498423, 0.03438106, 0.31982337, 0.783639694, 0.212788264, 0.200641608, 0.000805438, 1.41e-06, 0.850931688, 0.621632386, 1.09e-12, 3.39e-05, 5.79e-05, 0.850253806, 1.47e-07, 6.31e-12, 0.071025554, 0.057351558, 0.986682604, 0.035022542, 3.23e-09, 0.134260495, 2.42e-05, 7.85e-08, 0.10010147, 0.000469328, 0.131948909, 0.423869214, 0.099990689, 0.125202078, 0.025319366, 0.870933767, 0.281587122, 0.242311931, 0.043334594, 0.142890518, 0.585764865, 0.081953139, 0.656114872, 0.920863021, 0.814207777, 3.83e-07, 0.00371681, 0.490274083, 1.37e-09, 4.80e-20, 0.001678205, 0.003121806, 2.48e-26, 1.12e-12, 0.734695633, 0.000721844, 0.000951893, 1.16e-05, 1.28e-09, 1.12e-08, 0.324926341, 0.000109885, 2.10e-24, 1.30e-09, 2.18e-09, 0.000358824, 0.191677499, 0.021657286, 0.182665553)
  1134. Quad_complex_bully <- c(0.959560151, 0.026494022, 0.010017234, 0.018973174, 1.95e-05, 0.101492471, 0.785362659, 0.152013468, 0.967615577, 9.73e-08, 0.010649991, 0.029233599, 5.75e-05, 0.504689162, 0.017990783, 0.005779313, 0.190600519, 0.000833704, 0.025438035, 0.180307908, 0.100749946, 0.979511563, 0.001995369, 0.263055383, 0.118653915, 0.001051699, 0.003106154, 0.020796692, 0.000738825, 6.23e-07, 2.87e-07, 0.441909229, 0.200472262, 8.13e-18, 0.034441015, 0.031211289, 0.407183363, 9.41e-07, 2.08e-12, 0.624074873, 0.639362304, 0.517321052, 0.346223873, 0.000246323, 0.002190363, 2.26e-05, 1.79e-10, 0.47677441, 3.27e-05, 0.017678136, 0.54661916, 0.006207351, 0.102310016, 0.038855287, 0.017255026, 0.377809636, 0.120499776, 0.030343461, 0.506935849, 0.024958176, 0.000151797, 0.351720904, 0.509259273, 0.561800187, 5.50e-05, 0.001631626, 0.480598508, 1.42e-13, 1.33e-18, 0.080896176, 0.006194732, 6.49e-22, 7.83e-18, 0.590223909, 0.00067338, 0.003270591, 1.66e-07, 4.47e-11, 2.32e-09, 0.162015489, 6.31e-09, 5.46e-30, 2.06e-08, 5.92e-07, 0.000913152, 1.34e-05, 2.74e-05, 0.000254576)
  1135. Quad_simple_bully <- c(0.867073405, 0.21697344, 0.004664747, 0.223031524, 2.35e-03, 0.129540735, 6.09e-01, 0.319151761, 8.68e-01, 3.41e-05, 0.015832085, 5.31e-02, 1.51e-03, 5.89e-01, 7.37e-02, 3.23e-03, 1.18e-01, 0.010312099, 0.027184673, 0.773878473, 0.07795941, 0.728119955, 0.001135231, 0.231842375, 0.038609673, 4.23e-04, 0.001720944, 3.73e-02, 0.001521935, 1.87e-05, 8.77e-05, 0.397435286, 0.231282327, 1.69e-11, 0.126565964, 0.171809967, 0.378386648, 0.000854956, 4.06e-07, 0.829376447, 0.379859831, 0.514174312, 0.587786574, 0.040883818, 0.004588848, 0.001584751, 3.07e-07, 0.64327322, 0.000598356, 0.035609942, 0.435039966, 0.014930018, 0.171723705, 0.156678592, 0.01388322, 0.260335748, 0.056258761, 0.069995762, 0.317095263, 0.029367006, 4.87e-04, 0.281060647, 0.491783686, 0.587015143, 0.00503075, 0.014254203, 0.551636286, 3.47e-09, 6.34e-10, 0.470566356, 0.026465373, 3.31e-13, 9.83e-13, 0.494677248, 0.008021067, 0.036042515, 1.92e-05, 2.03e-06, 5.68e-06, 0.069088018, 2.70e-07, 5.43e-19, 0.00024012, 0.000293536, 0.016379827, 3.22e-05, 0.00027983, 0.000391517)
  1136. Linear_complex_bully <- c(0.049360101, 1.87e-07, 0.020665151, 5.03e-11, 1.02e-16, 9.78e-08, 0.709296517, 0.98884133, 0.035088618, 6.74e-27, 1.24e-06, 0.185611516, 4.26e-21, 0.499351137, 2.63e-13, 1.62e-08, 0.550308441, 1.19e-18, 2.80e-10, 0.000215386, 0.000230872, 0.734122159, 5.03e-08, 0.000228054, 0.554726643, 2.41e-06, 2.76e-07, 3.55e-07, 8.96e-14, 6.54e-19, 3.31e-34, 0.046882697, 0.024113462, 2.12e-65, 1.84e-05, 5.25e-11, 0.219135369, 1.10e-26, 9.84e-38, 0.00028152, 0.376209909, 0.980186117, 0.000104277, 1.61e-23, 1.67e-08, 7.51e-12, 8.27e-33, 0.581473011, 2.18e-16, 6.86e-05, 0.406846789, 3.22e-13, 0.000217102, 4.55e-05, 1.11e-08, 0.019991468, 0.000219087, 0.000535843, 0.003016076, 0.004438129, 4.60e-06, 0.028505214, 0.012180172, 0.728980997, 4.32e-12, 1.44e-10, 0.011863099, 4.91e-57, 2.89e-59, 3.19e-08, 3.41e-19, 1.15e-75, 9.11e-71, 0.064209034, 1.69e-15, 3.52e-05, 1.03e-25, 1.53e-53, 8.29e-37, 0.004048904, 3.66e-40, 7.25e-115, 5.38e-68, 7.96e-23, 2.27e-06, 5.35e-30, 1.41e-23, 1.59e-11)
  1137. Linear_complex_bully_age <- c(2.77e-07, 9.60e-33, 0.002444818, 1.38e-37, 2.73e-35, 1.85e-21, 0.087100824, 0.948518376, 0.001053434, 2.15e-54, 4.29e-09, 0.713573018, 4.66e-52, 0.355543305, 1.29e-37, 1.49e-05, 0.000332527, 3.22e-48, 7.51e-16, 8.87e-20, 0.001787736, 0.101646326, 0.000511364, 3.24e-06, 1.11e-07, 0.379307782, 0.001707982, 1.18e-11, 4.86e-20, 1.34e-28, 2.59e-74, 0.050539229, 0.02345656, 3.30e-117, 2.06e-23, 6.47e-43, 0.717644428, 7.60e-60, 3.10e-73, 6.23e-19, 0.03880478, 0.11704502, 7.08e-18, 7.58e-79, 7.53e-12, 7.50e-23, 1.31e-60, 0.072763053, 1.73e-31, 1.56e-06, 0.396356701, 5.43e-27, 1.40e-09, 4.58e-10, 2.78e-09, 0.2583291, 0.037690655, 3.27e-07, 4.37e-20, 0.121504925, 0.001369375, 0.115894519, 0.000352616, 0.088204751, 1.82e-30, 5.75e-21, 7.59e-06, 1.25e-110, 3.27e-119, 2.20e-25, 4.85e-56, 1.52e-170, 1.07e-135, 9.03e-07, 4.50e-36, 8.15e-10, 1.34e-48, 2.72e-103, 2.68e-72, 0.436896743, 1.40e-78, 2.84e-216, 3.30e-151, 2.27e-58, 1.26e-11, 7.06e-44, 1.57e-34, 1.83e-17)
  1138. Linear_simple_bully <- c(0.001841273, 1.51e-12, 0.103376595, 8.18e-14, 3.15e-16, 9.63e-14, 0.987529115, 0.979258137, 0.004840689, 3.32e-30, 3.87e-09, 0.201237142, 5.75e-22, 0.39184371, 2.18e-17, 6.35e-11, 0.807538237, 6.65e-22, 1.77e-14, 5.02e-07, 9.87e-06, 0.986193407, 2.05e-09, 2.75e-06, 0.768699183, 6.33e-07, 8.49e-09, 2.79e-10, 2.50e-18, 8.88e-25, 4.36e-29, 0.029958095, 0.006281061, 8.74e-51, 2.15e-10, 2.86e-18, 0.180980093, 5.29e-25, 3.33e-30, 4.13e-07, 0.669040515, 0.709467917, 3.15e-08, 6.42e-22, 6.12e-11, 3.20e-16, 4.11e-32, 0.349365443, 4.00e-20, 1.53e-06, 0.504844612, 2.06e-18, 3.68e-07, 3.47e-06, 1.22e-11, 0.008709649, 4.77e-05, 3.16e-06, 4.77e-05, 0.0011133, 1.57e-07, 0.013720909, 0.000805557, 0.487848523, 3.87e-13, 3.58e-11, 0.000597321, 1.62e-45, 1.51e-50, 1.87e-07, 5.28e-29, 5.95e-67, 1.66e-57, 0.015606933, 1.04e-18, 6.82e-06, 3.97e-26, 3.60e-40, 8.02e-39, 0.003067314, 2.33e-46, 1.77e-88, 3.99e-42, 4.24e-26, 5.52e-07, 1.52e-28, 5.83e-23, 2.82e-17)
  1139. Quad_sex_bully_age_simple <- c(0.887747894, 0.925620026, 0.00052688, 0.452481702, 0.36014146, 0.837441107, 3.30E-07, 0.12137398, 6.90E-06, 0.02963273, 0.001364031, 0.00238828, 0.170322143, 0.137207516, 0.006908485, 0.026769835, 0.165897457, 0.319414536, 0.081070065, 0.002575782, 0.00390065, 0.450248793, 0.028493164, 0.000712734, 0.182106415, 0.686795052, 0.223902528, 0.000187869, 0.848724456, 0.291580468, 0.867475796, 0.85124788, 0.009915836, 0.792346297, 6.96E-05, 0.983394315, 0.001930183, 0.455173905, 0.309129159, 0.65866872, 0.046516604, 0.149704009, 0.006278389, 0.318488579, 0.894342884, 0.648130463, 0.743758842, 0.872941643, 2.31E-07, 0.000303726, 0.422645413, 0.886807444, 0.242197405, 0.010000973, 0.000868774, 0.470107819, 8.35E-05, 0.002416943, 0.066596711, 0.677948381, 0.069271614, 0.000585776, 0.232057728, 0.078735784, 0.065453644, 0.234377592, 0.001208223, 0.022529527, 0.098151476, 0.922545377, 0.084195068, 0.585501813, 0.332793036, 0.000448911, 0.864609316, 0.015554019, 0.000141508, 4.23E-07, 0.178543521, 0.40286421, 0.268058175, 0.006692774, 0.131972466, 0.247020465, 0.006079444, 0.115246438, 7.46E-08, 0.181430045)
  1140. Quad_sex_bully_age_complex <- c(0.894782793, 0.945236759, 0.000499554, 0.455049639, 0.411113041, 0.818745925, 2.89E-07, 0.109236944, 6.80E-06, 0.032452336, 0.001502326, 0.002450623, 0.137705682, 0.133755183, 0.00635687, 0.02592859, 0.162331972, 0.293021114, 0.081653209, 0.002507509, 0.003855694, 0.441665747, 0.02822474, 0.000698318, 0.191771023, 0.669328294, 0.222051496, 0.000204815, 0.864653728, 0.273791683, 0.78750864, 0.847416845, 0.010035637, 0.884560343, 4.80E-05, 0.959546771, 0.001905383, 0.486746764, 0.376596535, 0.683546041, 0.044231753, 0.149492664, 0.006528989, 0.354213524, 0.928721397, 0.625385942, 0.667069114, 0.840460249, 1.66E-07, 0.000327996, 0.415933184, 0.906478217, 0.251554388, 0.010318252, 0.000863976, 0.463669867, 7.76E-05, 0.002673183, 0.068962614, 0.686025804, 0.075102018, 0.000568692, 0.231150203, 0.077957407, 0.086740746, 0.201808429, 0.001242554, 0.01678691, 0.100498936, 0.900891465, 0.081188043, 0.465962989, 0.237803674, 0.000449867, 0.907735853, 0.018024499, 0.000192989, 2.14E-07, 0.183859119, 0.407667341, 0.251504165, 0.004722837, 0.158682291, 0.263326124, 0.007377224, 0.120564553, 5.75E-08, 0.197077917)
  1141. Linear_sex_bully_age_complex <- c(0.955771706, 0.983863597, 0.00046293, 0.470226126, 0.472783385, 0.648873298, 2.97E-07, 0.129569602, 8.42E-06, 0.041844841, 0.00242477, 0.00226086, 0.089937118, 0.134322068, 0.00458465, 0.035328738, 0.155212534, 0.232302403, 0.099543008, 0.002572197, 0.004549664, 0.447384688, 0.033220544, 0.001066577, 0.205087008, 0.705247555, 0.244426016, 0.000310484, 0.956684065, 0.243804897, 0.611346294, 0.892948413, 0.010553781, 0.954195559, 3.40E-05, 0.871840647, 0.00199834, 0.534878757, 0.461419789, 0.811059937, 0.045415033, 0.161220833, 0.008106005, 0.397730116, 0.966675367, 0.601303627, 0.577491886, 0.850893244, 1.04E-07, 0.00040435, 0.419164761, 0.998506085, 0.278856105, 0.010934704, 0.001299438, 0.489885266, 0.00010046, 0.003071845, 0.091079644, 0.697395963, 0.077315151, 0.000670019, 0.260625476, 0.08442438, 0.10875662, 0.160201275, 0.001566581, 0.014542468, 0.111098129, 0.820930414, 0.060221339, 0.304022128, 0.095383473, 0.000469989, 0.975394604, 0.019628424, 0.000531253, 4.03E-07, 0.211449556, 0.395892475, 0.169205238, 0.003547114, 0.298722783, 0.314018443, 0.008373548, 0.218004788, 4.73E-08, 0.286127938)
  1142. Linear_sex_bully_age_simple <- list(0.965904933, 0.975700113, 0.00044561, 0.438635216, 0.327238911, 0.650230588, 3.01E-07, 0.129407263, 8.36E-06, 0.024326848, 0.00183257, 0.002248677, 0.164295535, 0.135439979, 0.003039059, 0.034128334, 0.153433838, 0.291992808, 0.102131949, 0.002667102, 0.004426717, 0.444036827, 0.031200596, 0.000950542, 0.203083253, 0.696332099, 0.236085534, 0.000251442, 0.884750789, 0.284359506, 0.699978181, 0.875087641, 0.010610153, 0.512088273, 4.12E-05, 0.788793794, 0.001983885, 0.418124077, 0.24439556, 0.793287422, 0.04508123, 0.153125246, 0.008816723, 0.293363386, 0.927216729, 0.590873464, 0.786212669, 0.865349339, 1.54E-07, 0.000408769, 0.419992272, 0.915130147, 0.263861774, 0.010994653, 0.001167369, 0.491351725, 9.52E-05, 0.002889564, 0.096962773, 0.688495613, 0.072383467, 0.000646593, 0.249508576, 0.081162371, 0.077826983, 0.229066652, 0.001536325, 0.047841228, 0.125313541, 0.807658782, 0.082195819, 0.407819399, 0.247616821, 0.000427879, 0.931338284, 0.018511352, 0.00049907, 1.42E-06, 0.267235281, 0.395938494, 0.248359841, 0.009018565, 0.266711084, 0.280458372, 0.00769199, 0.173287729, 5.07E-08, 0.211148145)
  1143. Quad_complex_bully_LEQ <- c(0.95847686, 0.03271316, 0.022891991, 0.037464224, 2.83e-05, 0.077958182, 0.975052641, 0.209, 0.558, 4.29e-07, 0.0271, 0.070867793, 0.00065683, 0.658848297, 0.00319, 0.022187065, 0.265495201, 0.00221, 0.061999122, 0.522564143, 0.132261827, 0.590734355, 4.35e-03, 3.99e-01, 3.18e-01, 4.80e-03, 8.19e-03, 3.67e-02, 0.0020904, 4.34e-06, 5.84e-06, 0.610540803, 3.79e-01, 2.45e-16, 0.029900174, 0.012528577, 0.589396822, 6.52e-06, 3.74e-12, 5.23e-01, 0.734695707, 0.709875961, 6.16e-01, 0.00100788, 7.74e-03, 3.05e-04, 3.63e-08, 0.383498803, 4.68e-06, 5.99e-02, 8.76e-01, 6.97e-03, 0.259865434, 1.32e-01, 0.040279749, 0.559264225, 0.154414918, 0.063242606, 0.643813908, 0.048142266, 0.000832993, 0.424972381, 0.742083484, 0.396499836, 0.000183571, 0.002212774, 0.572749869, 7.08e-12, 6.07e-17, 0.044093648, 0.010965147, 1.24e-19, 5.16e-15, 0.650523256, 0.000653437, 0.000991564, 2.58e-08, 6.41e-10, 3.53e-08, 0.203061721, 1.48e-08, 1.34e-29, 3.99e-07, 9.93e-08, 0.000499763, 3.83e-06, 0.00011749, 0.001106536)
  1144. Quad_complex_bully_INT_LEQ <- c(0.457844812, 1.82e-06, 0.116342564, 0.000100224, 1.30e-05, 1.82e-01, 9.17e-02, 4.76e-02, 2.65e-01, 2.15e-05, 0.583127731, 0.424263594, 0.000102164, 0.617367023, 0.011079255, 0.36203837, 0.095482216, 1.14e-03, 0.975732302, 1.79e-03, 0.360453563, 4.77e-02, 5.88e-01, 5.82e-01, 7.86e-03, 1.99e-01, 6.18e-01, 3.86e-01, 5.26e-01, 2.60e-03, 2.48e-05, 0.668139762, 8.46e-01, 1.23e-11, 4.94e-06, 0.000174804, 6.77e-01, 9.61e-07, 3.12e-11, 4.22e-02, 0.025066888, 0.945157772, 0.054537312, 7.16e-08, 2.25e-01, 0.000168379, 2.42e-06, 0.059601008, 5.55e-04, 1.96e-01, 3.44e-01, 1.97e-01, 2.03e-01, 0.044600403, 0.591816453, 0.170492652, 0.12305281, 0.080093341, 0.128354011, 0.914111831, 0.157336191, 0.515710127, 0.58894848, 0.656986846, 1.69e-06, 0.009302644, 0.938523772, 1.25e-08, 2.56e-19, 0.000856246, 0.001614797, 7.64e-25, 9.79e-12, 0.789188815, 0.001809917, 0.000403335, 2.88e-05, 6.08e-09, 1.16e-08, 0.199916497, 1.27e-05, 6.59e-24, 3.18e-08, 1.10e-08, 0.000323555, 0.132346633, 0.032430291, 0.348539152)
  1145. Quad_simple_bully_LEQ <- c(0.862949833, 0.220768959, 0.010651499, 0.29681636, 0.003315968, 0.104851637, 0.796768066, 0.371919385, 0.698687769, 5.18e-05, 0.031410277, 0.094388329, 0.009564045, 0.718715164, 0.013715234, 0.013122481, 0.156695222, 0.019070996, 0.057334285, 0.791949242, 0.090381001, 0.86886211, 0.002082252, 0.336760578, 0.11483787, 0.001906973, 0.004086081, 0.051618978, 0.002604271, 7.00e-05, 0.000475456, 0.522388362, 0.391111371, 1.29e-10, 0.119654944, 0.065126216, 0.531300306, 0.002044107, 3.56e-07, 0.7302149, 0.431269272, 0.714551366, 0.87217275, 0.06082252, 0.013145689, 0.006941571, 9.63e-06, 0.550388692, 9.48e-05, 0.098235374, 0.72950735, 0.013134958, 0.359475564, 0.355199844, 0.028935136, 0.390381593, 0.063655646, 0.117233108, 0.430591037, 0.046706683, 0.001916706, 0.323839748, 0.672682527, 0.438783987, 0.008876492, 0.014232471, 0.576421014, 4.30e-08, 3.79e-09, 0.335710292, 0.040304074, 6.93e-12, 9.52e-11, 0.575569808, 0.005631387, 0.015777362, 2.53e-06, 8.52e-06, 3.42e-05, 0.077327078, 7.27e-07, 3.53e-19, 0.000846082, 3.80e-05, 0.009842282, 1.19e-05, 0.000838146, 0.001437121)
  1146. Linear_simple_bully_LEQ <- c(0.021337028, 3.39e-08, 0.223363007, 1.32e-07, 9.40e-11, 2.42e-09, 0.514992847, 0.84070655, 0.405632816, 1.26e-19, 1.78e-05, 0.623936612, 5.88e-13, 0.860332856, 1.26e-13, 4.11e-06, 0.831416274, 1.55e-13, 7.70e-08, 0.021471935, 0.001981895, 0.292693125, 5.52e-06, 0.002428352, 0.592371348, 0.00022381, 1.74e-05, 9.50e-06, 8.44e-11, 2.14e-14, 4.10e-18, 0.126437532, 0.153236321, 3.97e-35, 1.79e-07, 8.09e-14, 0.593241027, 6.24e-16, 2.54e-22, 8.44e-05, 0.977102418, 0.567039629, 0.00070545, 1.07e-13, 1.22e-06, 6.52e-08, 3.24e-20, 0.200055202, 2.09e-16, 0.001542507, 0.950421751, 1.14e-11, 0.003306759, 0.014420674, 1.62e-06, 0.139011106, 0.002327167, 0.002275796, 0.001780892, 0.01862203, 9.16e-05, 0.105970928, 0.060743173, 0.683442524, 8.78e-09, 4.57e-08, 0.033313383, 1.67e-32, 6.34e-34, 1.60e-05, 3.31e-19, 2.64e-46, 1.83e-38, 0.085290112, 2.15e-13, 1.08e-05, 2.25e-21, 4.39e-26, 4.93e-24, 0.01686153, 8.49e-33, 5.27e-66, 2.02e-26, 4.87e-21, 6.73e-06, 9.74e-22, 6.33e-15, 2.60e-10)
  1147. Linear_complex_bully_LEQ <- c(0.099195168, 5.58e-06, 0.077017816, 3.54e-07, 4.70e-13, 2.11e-06, 0.801137009, 0.88850492, 0.505282942, 2.05e-19, 0.000122285, 0.510199591, 9.83e-14, 0.861368671, 3.76e-12, 2.02e-05, 0.69823406, 4.59e-13, 1.88e-06, 0.062986602, 0.003990614, 0.501707048, 9.93e-06, 0.007661242, 0.989746674, 0.000218438, 3.29e-05, 6.44e-05, 1.94e-09, 5.81e-13, 4.84e-24, 0.132012392, 0.188215677, 4.83e-50, 6.28e-05, 4.84e-10, 0.549547773, 2.02e-18, 8.09e-31, 0.001683747, 0.702353789, 0.723171659, 0.0114698, 3.38e-15, 5.85e-06, 7.69e-07, 3.15e-22, 0.338303513, 2.66e-15, 0.004049959, 0.836401275, 6.72e-10, 0.018925655, 0.015996392, 1.23e-05, 0.139584883, 0.002873762, 0.01034989, 0.009300334, 0.022813971, 0.000196783, 0.114873496, 0.111138461, 0.652848741, 2.77e-09, 8.57e-09, 0.074753882, 9.93e-42, 1.14e-44, 4.23e-07, 1.10e-13, 6.97e-58, 4.37e-50, 0.115127726, 1.73e-12, 7.28e-06, 9.41e-24, 3.89e-39, 8.75e-26, 0.01689583, 1.25e-30, 1.74e-91, 1.78e-47, 1.90e-20, 3.12e-06, 6.43e-25, 9.87e-17, 5.48e-08)
  1148. Linear_complex_bully_INT_LEQ <- c(1.85e-06, 4.53e-28, 0.000212804, 1.85e-26, 2.70e-28, 3.86e-18, 0.005270096, 0.516078847, 0.20623306, 2.32e-36, 3.28e-05, 0.106952893, 1.06e-38, 0.997915608, 5.52e-29, 0.005734287, 5.02e-05, 2.54e-35, 7.57e-09, 4.63e-11, 0.139706281, 0.003754819, 0.053618973, 0.001862784, 3.22e-09, 0.790673493, 0.059214633, 1.47e-06, 8.19e-11, 1.41e-17, 5.05e-56, 0.150603379, 0.328688852, 7.61e-92, 4.91e-23, 9.37e-35, 0.586819233, 1.86e-42, 9.10e-60, 3.62e-16, 0.002057818, 0.099644056, 1.10e-11, 3.59e-54, 7.21e-08, 1.89e-12, 4.14e-43, 0.01054666, 2.12e-26, 0.000423269, 0.222952451, 6.08e-18, 2.82e-05, 3.91e-05, 9.32e-05, 0.937967546, 0.421764443, 0.000302282, 4.12e-17, 0.640660352, 0.034923889, 0.577315854, 0.043427493, 0.674804909, 3.88e-24, 6.26e-17, 0.008148056, 1.46e-84, 2.56e-95, 2.78e-22, 1.92e-44, 1.48e-142, 8.16e-109, 1.85e-05, 3.15e-28, 7.45e-11, 2.53e-43, 1.97e-80, 3.77e-56, 0.987410248, 4.57e-65, 1.31e-179, 5.36e-118, 2.23e-47, 7.57e-11, 2.38e-36, 2.66e-25, 1.41e-10)
  1149. Linear_complex_bully_IQ <- c(0.048446345, 4.11e-06, 0.105643534, 5.54e-11, 8.85e-17, 3.19e-07, 0.915842414, 0.584226379, 0.035774721, 1.66e-26, 9.21e-06, 0.102590825, 3.01e-18, 0.481378156, 2.29e-11, 3.24e-09, 0.919028565, 3.75e-18, 1.14e-11, 0.000131137, 2.27e-05, 0.74620228, 2.36e-07, 0.000161599, 0.505853511, 2.17e-06, 5.46e-06, 2.13e-07, 3.59e-14, 4.79e-19, 1.64e-35, 0.164447203, 0.004090238, 2.28e-62, 9.48e-07, 2.24e-10, 0.267328199, 1.08e-27, 5.95e-40, 7.37e-05, 0.458586918, 0.826589945, 0.00039262, 2.56e-23, 3.56e-08, 2.11e-11, 3.65e-30, 0.828007014, 5.87e-14, 0.000375044, 0.629617454, 6.92e-13, 0.000745747, 3.63e-06, 5.90e-08, 0.013562997, 0.000319161, 0.003404487, 0.001311809, 0.003170769, 2.33e-05, 0.020069009, 0.020046649, 0.365779232, 1.76e-12, 6.75e-12, 0.022637745, 7.59e-53, 4.86e-60, 5.43e-07, 1.18e-18, 2.82e-77, 4.55e-67, 0.087442284, 9.16e-16, 3.29e-05, 4.16e-25, 2.82e-51, 1.84e-38, 0.016996635, 1.51e-37, 2.15e-117, 1.34e-67, 7.17e-23, 2.05e-06, 2.53e-29, 1.07e-23, 1.60e-11)
  1150. Linear_complex_bully_INT_IQ <- c(9.76e-08, 2.37e-31, 0.009206728, 1.64e-34, 3.77e-36, 2.91e-19, 0.051277191, 0.735691631, 0.001309778, 1.50e-52, 5.85e-10, 0.729587954, 1.07e-51, 0.539112745, 3.27e-36, 7.32e-06, 0.002118735, 2.68e-46, 1.77e-15, 9.85e-18, 0.004770896, 0.058827242, 0.000880123, 1.20e-06, 1.50e-07, 0.322470539, 0.000621372, 2.11e-11, 1.68e-19, 1.01e-26, 1.85e-69, 0.035969115, 0.116534246, 2.44e-113, 8.92e-19, 1.21e-38, 0.380497402, 1.80e-52, 7.18e-74, 1.06e-16, 0.055050958, 0.19543903, 8.74e-17, 6.43e-77, 6.24e-11, 1.29e-19, 3.33e-58, 0.099503633, 1.26e-27, 7.83e-07, 0.625969035, 5.12e-27, 4.35e-10, 6.23e-07, 8.64e-09, 0.480685177, 0.01693886, 2.78e-07, 3.69e-18, 0.040979523, 0.000820557, 0.120083901, 0.000274682, 0.087720981, 7.44e-30, 9.80e-21, 1.57e-05, 5.52e-112, 8.63e-113, 5.99e-26, 4.44e-53, 8.18e-163, 5.48e-134, 4.62e-08, 4.73e-35, 4.29e-11, 1.45e-49, 2.16e-95, 2.72e-69, 0.474260872, 5.31e-79, 1.16e-217, 1.92e-153, 1.36e-62, 5.57e-12, 2.35e-46, 2.26e-30, 2.30e-17)
  1151. Linear_complex_bully_bmi <- c(0.048446345, 4.11e-06, 0.105643534, 5.54e-11, 8.85e-17, 3.19e-07, 0.915842414, 0.584226379, 0.035774721, 1.66e-26, 9.21e-06, 0.102590825, 3.01e-18, 0.481378156, 2.29e-11, 3.24e-09, 0.919028565, 3.75e-18, 1.14e-11, 0.000131137, 2.27e-05, 0.74620228, 2.36e-07, 0.000161599, 0.505853511, 2.17e-06, 5.46e-06, 2.13e-07, 3.59e-14, 4.79e-19, 1.64e-35, 0.164447203, 0.004090238, 2.28e-62, 9.48e-07, 2.24e-10, 0.267328199, 1.08e-27, 5.95e-40, 7.37e-05, 0.458586918, 0.826589945, 0.00039262, 2.56e-23, 3.56e-08, 2.11e-11, 3.65e-30, 0.828007014, 5.87e-14, 0.000375044, 0.629617454, 6.92e-13, 0.000745747, 3.63e-06, 5.90e-08, 0.013562997, 0.000319161, 0.003404487, 0.001311809, 0.003170769, 2.33e-05, 0.020069009, 0.020046649, 0.365779232, 1.76e-12, 6.75e-12, 0.022637745, 7.59e-53, 4.86e-60, 5.43e-07, 1.18e-18, 2.82e-77, 4.55e-67, 0.087442284, 9.16e-16, 3.29e-05, 4.16e-25, 2.82e-51, 1.84e-38, 0.016996635, 1.51e-37, 2.15e-117, 1.34e-67, 7.17e-23, 2.05e-06, 2.53e-29, 1.07e-23, 1.60e-11)
  1152. Linear_complex_bully_bmi_INT <- c(9.76e-08, 2.37e-31, 0.009206728, 1.64e-34, 3.77e-36, 2.91e-19, 0.051277191, 0.735691631, 0.001309778, 1.50e-52, 5.85e-10, 0.729587954, 1.07e-51, 0.539112745, 3.27e-36, 7.32e-06, 0.002118735, 2.68e-46, 1.77e-15, 9.85e-18, 0.004770896, 0.058827242, 0.000880123, 1.20e-06, 1.50e-07, 0.322470539, 0.000621372, 2.11e-11, 1.68e-19, 1.01e-26, 1.85e-69, 0.035969115, 0.116534246, 2.44e-113, 8.92e-19, 1.21e-38, 0.380497402, 1.80e-52, 7.18e-74, 1.06e-16, 0.055050958, 0.19543903, 8.74e-17, 6.43e-77, 6.24e-11, 1.29e-19, 3.33e-58, 0.099503633, 1.26e-27, 7.83e-07, 0.625969035, 5.12e-27, 4.35e-10, 6.23e-07, 8.64e-09, 0.480685177, 0.01693886, 2.78e-07, 3.69e-18, 0.040979523, 0.000820557, 0.120083901, 0.000274682, 0.087720981, 7.44e-30, 9.80e-21, 1.57e-05, 5.52e-112, 8.63e-113, 5.99e-26, 4.44e-53, 8.18e-163, 5.48e-134, 4.62e-08, 4.73e-35, 4.29e-11, 1.45e-49, 2.16e-95, 2.72e-69, 0.474260872, 5.31e-79, 1.16e-217, 1.92e-153, 1.36e-62, 5.57e-12, 2.35e-46, 2.26e-30, 2.30e-17)
  1153. # Your existing code
  1154. # Your existing code
  1155. # Assuming 'Quad_complex_bully' is already defined
  1156. # Adjust p-values using False Discovery Rate (FDR) method
  1157. p_adjusted_Linear_complex_bully_bmi_INT <- p.adjust(Linear_complex_bully_bmi_INT, method = "fdr")
  1158. # Print adjusted p-values
  1159. # print(p_adjusted_Quad_complex_bully_age)
  1160. # Significance threshold after FDR correction
  1161. alpha <- 0.05
  1162. # Identify significant p-values
  1163. significant_indices <- p_adjusted_Linear_complex_bully_bmi_INT <= alpha
  1164. # Create a DataFrame with DVlist, adjusted p-values, and significance information
  1165. data <- data.frame(
  1166. DV = DVlist,
  1167. Adjusted_p_value = p_adjusted_Linear_complex_bully_bmi_INT,
  1168. Significant = significant_indices
  1169. )
  1170. # Write data to CSV file
  1171. write.csv(data, file = "/Users/michaelconnaughton/Desktop/IMAGEN/sensitivity/p_adjusted_Linear_complex_bully_bmi_INT", row.names = FALSE)
  1172. }
  1173. # PLOTS_REMEBER_FIX_AGE
  1174. #define_predictions
  1175. {
  1176. mean_bully_victim <- mean(IMAGEN_bully$bully_victim, na.rm = TRUE)
  1177. p25_bully_victim <- quantile(IMAGEN_bully$bully_victim, 0.25, na.rm = TRUE)
  1178. p75_bully_victim <- quantile(IMAGEN_bully$bully_victim, 0.75, na.rm = TRUE)
  1179. newdata <- expand.grid(
  1180. EstimatedTotalIntraCranialVol = mean(IMAGEN_bully$EstimatedTotalIntraCranialVol, na.rm = TRUE),
  1181. sex = factor(levels(IMAGEN_bully$sex)[1]),
  1182. age = seq(min(IMAGEN_bully$age, na.rm = TRUE), max(IMAGEN_bully$age, na.rm = TRUE), length.out = 100),
  1183. SES = mean(IMAGEN_bully$SES, na.rm = TRUE),
  1184. mode_c_pds = mean(IMAGEN_bully$mode_c_pds, na.rm = TRUE),
  1185. bully_victim = c(mean_bully_victim, p25_bully_victim, p75_bully_victim),
  1186. subID = unique(IMAGEN_bully$subID)[1]
  1187. )
  1188. }
  1189. #Optimal Models Effect Sizes
  1190. #Quad_Complex
  1191. {
  1192. lh_caudalanteriorcingulate_volume <- lmer(lh_caudalanteriorcingulate_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1193. effectsize(lh_caudalanteriorcingulate_volume)
  1194. lh_cuneus_volume <- lmer(lh_cuneus_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1195. effectsize(lh_cuneus_volume)
  1196. lh_entorhinal_volume <- lmer(lh_entorhinal_volume ~ bully_victim * age + I(age^2) + bully_victim*sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1197. summary(lh_entorhinal_volume)
  1198. effectsize(lh_entorhinal_volume)
  1199. lh_frontalpole_volume <- lmer(lh_frontalpole_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1200. lh_lateraloccipital_volume <- lmer(lh_lateraloccipital_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1201. effectsize(lh_lateraloccipital_volume)
  1202. lh_medialorbitofrontal_volume <- lmer(lh_medialorbitofrontal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1203. effectsize(lh_medialorbitofrontal_volume)
  1204. lh_parahippocampal_volume <- lmer(lh_parahippocampal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1205. effectsize(lh_parahippocampal_volume)
  1206. lh_parsorbitalis_volume <- lmer(lh_parsorbitalis_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1207. effectsize(lh_parsorbitalis_volume)
  1208. lh_pericalcarine_volume <- lmer(lh_pericalcarine_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1209. effectsize(lh_pericalcarine_volume)
  1210. lh_precentral_volume <- lmer(lh_precentral_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1211. effectsize(lh_precentral_volume)
  1212. lh_rostralanteriorcingulate_volume <- lmer(lh_rostralanteriorcingulate_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1213. effectsize(lh_rostralanteriorcingulate_volume)
  1214. lh_rostralmiddlefrontal_volume <- lmer(lh_rostralmiddlefrontal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1215. effectsize(lh_rostralmiddlefrontal_volume)
  1216. lh_superiorfrontal_volume <- lmer(lh_superiorfrontal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1217. effectsize(lh_superiorfrontal_volume)
  1218. lh_superiortemporal_volume <- lmer(lh_superiortemporal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1219. effectsize(lh_superiortemporal_volume)
  1220. lh_supramarginal_volume <- lmer(lh_supramarginal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1221. effectsize(lh_supramarginal_volume)
  1222. lh_transversetemporal_volume <- lmer(lh_transversetemporal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1223. effectsize(lh_transversetemporal_volume)
  1224. lh_insula_volume <- lmer(lh_insula_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1225. effectsize(lh_insula_volume)
  1226. rh_bankssts_volume <- lmer(rh_bankssts_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1227. effectsize(rh_bankssts_volume)
  1228. rh_caudalanteriorcingulate_volume <- lmer(rh_caudalanteriorcingulate_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1229. effectsize(rh_caudalanteriorcingulate_volume)
  1230. rh_cuneus_volume <- lmer(rh_cuneus_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1231. effectsize(rh_cuneus_volume)
  1232. rh_entorhinal_volume <- lmer(rh_entorhinal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1233. effectsize(rh_entorhinal_volume)
  1234. rh_lateraloccipital_volume <- lmer(rh_lateraloccipital_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1235. effectsize(rh_lateraloccipital_volume)
  1236. rh_lateralorbitofrontal_volume <- lmer(rh_lateralorbitofrontal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1237. effectsize(rh_lateralorbitofrontal_volume)
  1238. rh_lingual_volume <- lmer(rh_lingual_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1239. effectsize(rh_lingual_volume)
  1240. rh_medialorbitofrontal_volume <- lmer(rh_medialorbitofrontal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1241. effectsize(rh_medialorbitofrontal_volume)
  1242. rh_parahippocampal_volume <- lmer(rh_parahippocampal_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1243. effectsize(rh_parahippocampal_volume)
  1244. rh_pericalcarine_volume <- lmer(rh_pericalcarine_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1245. effectsize(rh_pericalcarine_volume)
  1246. rh_precuneus_volume <- lmer(rh_precuneus_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1247. effectsize(rh_precuneus_volume)
  1248. rh_temporalpole_volume <- lmer(rh_temporalpole_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1249. effectsize(rh_temporalpole_volume)
  1250. rh_insula_volume <- lmer(rh_insula_volume ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1251. effectsize(rh_insula_volume)
  1252. Left_Cerebellum_Cortex <- lmer(Left_Cerebellum_Cortex ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1253. effectsize(Left_Cerebellum_Cortex)
  1254. Left_Caudate <- lmer(Left_Caudate ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1255. effectsize(Left_Caudate)
  1256. Left_Putamen <- lmer(Left_Putamen ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1257. effectsize(Left_Putamen)
  1258. Left_Pallidum <- lmer(Left_Pallidum ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1259. effectsize(Left_Pallidum)
  1260. Left_Hippocampus <- lmer(Left_Hippocampus ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1261. effectsize(Left_Hippocampus)
  1262. Left_Accumbens_area <- lmer(Left_Accumbens_area ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1263. effectsize(Left_Accumbens_area)
  1264. Left_VentralDC <- lmer(Left_VentralDC ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1265. effectsize(Left_VentralDC)
  1266. Right_Cerebellum_Cortex <- lmer(Right_Cerebellum_Cortex ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1267. effectsize(Right_Cerebellum_Cortex)
  1268. Right_Caudate <- lmer(Right_Caudate ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1269. effectsize(Right_Caudate)
  1270. Right_Putamen <- lmer(Right_Putamen ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1271. effectsize(Right_Putamen)
  1272. Right_Pallidum <- lmer(Right_Pallidum ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1273. effectsize(Right_Pallidum)
  1274. Right_Hippocampus <- lmer(Right_Hippocampus ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1275. effectsize(Right_Hippocampus)
  1276. Right_Accumbens_area <- lmer(Right_Accumbens_area ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1277. effectsize(Right_Accumbens_area)
  1278. Right_VentralDC <- lmer(Right_VentralDC ~ bully_victim*age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1279. effectsize(Right_VentralDC)
  1280. }
  1281. #Quad_Simple
  1282. {
  1283. lh_bankssts_volume <- lmer(lh_bankssts_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1284. effectsize(lh_bankssts_volume)
  1285. lh_fusiform_volume <- lmer(lh_fusiform_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1286. effectsize(lh_fusiform_volume)
  1287. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim * age + I(age^2) + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1288. effectsize(lh_isthmuscingulate_volume)
  1289. lh_lateralorbitofrontal_volume <- lmer(lh_lateralorbitofrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1290. effectsize(lh_lateralorbitofrontal_volume)
  1291. lh_lingual_volume <- lmer(lh_lingual_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1292. effectsize(lh_lingual_volume)
  1293. lh_paracentral_volume <- lmer(lh_paracentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1294. effectsize(lh_paracentral_volume)
  1295. lh_parstriangularis_volume <- lmer(lh_parstriangularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1296. effectsize(lh_parstriangularis_volume)
  1297. lh_postcentral_volume <- lmer(lh_postcentral_volume ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1298. effectsize(lh_postcentral_volume)
  1299. lh_precuneus_volume <- lmer(lh_precuneus_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1300. effectsize(lh_precuneus_volume)
  1301. lh_superiorparietal_volume <- lmer(lh_superiorparietal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1302. effectsize(lh_superiorparietal_volume)
  1303. lh_temporalpole_volume <- lmer(lh_temporalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1304. effectsize(lh_temporalpole_volume)
  1305. rh_fusiform_volume <- lmer(rh_fusiform_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1306. effectsize(rh_fusiform_volume)
  1307. rh_isthmuscingulate_volume <- lmer(rh_isthmuscingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1308. effectsize(rh_isthmuscingulate_volume)
  1309. rh_paracentral_volume <- lmer(rh_paracentral_volume ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1310. effectsize(rh_paracentral_volume)
  1311. rh_parsorbitalis_volume <- lmer(rh_parsorbitalis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1312. effectsize(rh_parsorbitalis_volume)
  1313. rh_parstriangularis_volume <- lmer(rh_parstriangularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1314. effectsize(rh_parstriangularis_volume)
  1315. rh_postcentral_volume <- lmer(rh_postcentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1316. effectsize(rh_postcentral_volume)
  1317. rh_precentral_volume <- lmer(rh_precentral_volume ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1318. effectsize(rh_precentral_volume)
  1319. rh_rostralanteriorcingulate_volume <- lmer(rh_rostralanteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1320. effectsize(rh_rostralanteriorcingulate_volume)
  1321. rh_superiortemporal_volume <- lmer(rh_superiortemporal_volume ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1322. effectsize(rh_superiortemporal_volume)
  1323. rh_frontalpole_volume <- lmer(rh_frontalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1324. effectsize(rh_frontalpole_volume)
  1325. rh_transversetemporal_volume <- lmer(rh_transversetemporal_volume ~ bully_victim * age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1326. effectsize(rh_transversetemporal_volume)
  1327. Left_Thalamus_Proper <- lmer(Left_Thalamus_Proper ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1328. effectsize(Left_Thalamus_Proper)
  1329. Brain_Stem <- lmer(Brain_Stem ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1330. effectsize(Brain_Stem)
  1331. Right_Thalamus_Proper <- lmer(Right_Thalamus_Proper ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1332. effectsize(Right_Thalamus_Proper)
  1333. TotalGrayVol <- lmer(TotalGrayVol ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1334. effectsize(TotalGrayVol)
  1335. }
  1336. #Linear_Complex
  1337. {
  1338. lh_caudalmiddlefrontal_volume <- lmer(lh_caudalmiddlefrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1339. effectsize(lh_caudalmiddlefrontal_volume)
  1340. lh_parsopercularis_volume <- lmer(lh_parsopercularis_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1341. effectsize(lh_parsopercularis_volume)
  1342. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1343. effectsize(lh_isthmuscingulate_volume)
  1344. lh_pericalcarine_volume <- lmer(lh_pericalcarine_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1345. effectsize(lh_pericalcarine_volume)
  1346. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1347. effectsize(lh_isthmuscingulate_volume)
  1348. lh_postcentral_volume <- lmer(lh_postcentral_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1349. effectsize(lh_postcentral_volume)
  1350. lh_precentral_volume <- lmer(lh_precentral_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1351. effectsize(lh_precentral_volume)
  1352. lh_rostralanteriorcingulate_volume <- lmer(lh_rostralanteriorcingulate_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1353. effectsize(lh_rostralanteriorcingulate_volume)
  1354. rh_rostralmiddlefrontal_volume <- lmer(rh_rostralmiddlefrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1355. effectsize(rh_rostralmiddlefrontal_volume)
  1356. rh_superiorfrontal_volume <- lmer(rh_superiorfrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1357. effectsize(rh_superiorfrontal_volume)
  1358. rh_lingual_volume <- lmer(rh_lingual_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1359. effectsize(rh_lingual_volume)
  1360. rh_paracentral_volume <- lmer(rh_paracentral_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1361. effectsize(rh_paracentral_volume)
  1362. rh_pericalcarine_volume <- lmer(rh_pericalcarine_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1363. effectsize(rh_pericalcarine_volume)
  1364. rh_precentral_volume <- lmer(rh_precentral_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1365. effectsize(rh_precentral_volume)
  1366. rh_precuneus_volume <- lmer(rh_precuneus_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1367. effectsize(rh_precuneus_volume)
  1368. rh_superiorfrontal_volume <- lmer(rh_superiorfrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1369. effectsize(rh_superiorfrontal_volume)
  1370. lh_superiorfrontal_volume <- lmer(lh_superiorfrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1371. effectsize(lh_superiorfrontal_volume)
  1372. rh_superiorfrontal_volume <- lmer(rh_superiorfrontal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1373. effectsize(rh_superiorfrontal_volume)
  1374. rh_superiortemporal_volume <- lmer(rh_superiortemporal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1375. effectsize(rh_superiortemporal_volume)
  1376. rh_transversetemporal_volume <- lmer(rh_transversetemporal_volume ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1377. effectsize(rh_transversetemporal_volume)
  1378. Brain_Stem <- lmer(Brain_Stem ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1379. effectsize(Brain_Stem)
  1380. Left_Amygdala <- lmer(Left_Amygdala ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1381. effectsize(Left_Amygdala)
  1382. Right_Amygdala <- lmer(Right_Amygdala ~ bully_victim*age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1383. effectsize(Right_Amygdala)
  1384. }
  1385. #Linear_Simple
  1386. {
  1387. lh_temporalpole_volume <- lmer(lh_temporalpole_volume ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1388. effectsize(lh_temporalpole_volume)
  1389. rh_posteriorcingulate_volume <- lmer(rh_posteriorcingulate_volume ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1390. effectsize(rh_posteriorcingulate_volume)
  1391. rh_rostralmiddlefrontal_volume <- lmer(rh_rostralmiddlefrontal_volume ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1392. effectsize(rh_rostralmiddlefrontal_volume)
  1393. rh_superiorparietal_volume <- lmer(rh_superiorparietal_volume ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1394. effectsize(rh_superiorparietal_volume)
  1395. Right_Thalamus_Proper <- lmer(Right_Thalamus_Proper ~ bully_victim + age + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1396. effectsize(Right_Thalamus_Proper)
  1397. }
  1398. #Cohen's D
  1399. # Extract the coefficient and standard error for 'bully_victim'
  1400. coef_bully_victim <- fixef(TotalGrayVol)["bully_victim"]
  1401. se_bully_victim <- sqrt(diag(vcov(TotalGrayVol))["bully_victim"])
  1402. # Approximate the standard deviation of the dependent variable
  1403. # We use the residual standard Left_VentralDC as a proxy for the predictor's standard deviation
  1404. sigma_residual <- sigma(TotalGrayVol)
  1405. # Calculate Cohen's d
  1406. cohens_d <- coef_bully_victim / sigma_residual
  1407. print(cohens_d)
  1408. # Extract the coefficient and standard error for 'bully_victim:age' interaction
  1409. coef_interaction <- fixef(Right_Pallidum)["bully_victim:age"]
  1410. se_interaction <- sqrt(diag(vcov(Right_Pallidum))["bully_victim:age"])
  1411. # Approximate the standard deviation of the dependent variable
  1412. sigma_residual <- sigma(Right_Pallidum)
  1413. # Calculate Cohen's d for the interaction term
  1414. cohens_d_interaction <- coef_interaction / sigma_residual
  1415. print(cohens_d_interaction)
  1416. effectsize(Right_VentralDC)
  1417. #MODELS_TO_VISUALISE_
  1418. #Quad_Complex
  1419. {
  1420. lh_bankssts_volume <- lmer(lh_bankssts_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1421. summary(lh_bankssts_volume)
  1422. lh_bankssts_volume <- lmer(lh_bankssts_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1423. lh_caudalanteriorcingulate_volume <- lmer(lh_caudalanteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1424. lh_caudalmiddlefrontal_volume <- lmer(lh_caudalmiddlefrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1425. lh_cuneus_volume <- lmer(lh_cuneus_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1426. lh_entorhinal_volume <- lmer(lh_entorhinal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1427. lh_fusiform_volume <- lmer(lh_fusiform_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1428. lh_inferiorparietal_volume <- lmer(lh_inferiorparietal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1429. lh_inferiortemporal_volume <- lmer(lh_inferiortemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1430. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1431. lh_lateraloccipital_volume <- lmer(lh_lateraloccipital_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1432. lh_lateralorbitofrontal_volume <- lmer(lh_lateralorbitofrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1433. lh_lingual_volume <- lmer(lh_lingual_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1434. lh_medialorbitofrontal_volume <- lmer(lh_medialorbitofrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1435. lh_middletemporal_volume <- lmer(lh_middletemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1436. lh_parahippocampal_volume <- lmer(lh_parahippocampal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1437. lh_paracentral_volume <- lmer(lh_paracentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1438. lh_parsopercularis_volume <- lmer(lh_parsopercularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1439. lh_parsorbitalis_volume <- lmer(lh_parsorbitalis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1440. lh_parstriangularis_volume <- lmer(lh_parstriangularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1441. lh_pericalcarine_volume <- lmer(lh_pericalcarine_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1442. lh_postcentral_volume <- lmer(lh_postcentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1443. lh_posteriorcingulate_volume <- lmer(lh_posteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1444. lh_precentral_volume <- lmer(lh_precentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1445. lh_precuneus_volume <- lmer(lh_precuneus_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1446. lh_rostralanteriorcingulate_volume <- lmer(lh_rostralanteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1447. lh_rostralmiddlefrontal_volume <- lmer(lh_rostralmiddlefrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1448. lh_superiorfrontal_volume <- lmer(lh_superiorfrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1449. lh_superiorparietal_volume <- lmer(lh_superiorparietal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1450. lh_superiortemporal_volume <- lmer(lh_superiortemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1451. lh_supramarginal_volume <- lmer(lh_supramarginal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1452. lh_frontalpole_volume <- lmer(lh_frontalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1453. lh_temporalpole_volume <- lmer(lh_temporalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1454. lh_transversetemporal_volume <- lmer(lh_transversetemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1455. lh_insula_volume <- lmer(lh_insula_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1456. rh_bankssts_volume <- lmer(rh_bankssts_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1457. rh_caudalanteriorcingulate_volume <- lmer(rh_caudalanteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1458. rh_caudalmiddlefrontal_volume <- lmer(rh_caudalmiddlefrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1459. rh_cuneus_volume <- lmer(rh_cuneus_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1460. rh_entorhinal_volume <- lmer(rh_entorhinal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1461. rh_fusiform_volume <- lmer(rh_fusiform_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1462. rh_inferiorparietal_volume <- lmer(rh_inferiorparietal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1463. rh_inferiortemporal_volume <- lmer(rh_inferiortemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1464. rh_isthmuscingulate_volume <- lmer(rh_isthmuscingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1465. rh_lateraloccipital_volume <- lmer(rh_lateraloccipital_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1466. rh_lateralorbitofrontal_volume <- lmer(rh_lateralorbitofrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1467. rh_lingual_volume <- lmer(rh_lingual_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1468. rh_medialorbitofrontal_volume <- lmer(rh_medialorbitofrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1469. rh_middletemporal_volume <- lmer(rh_middletemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1470. rh_parahippocampal_volume <- lmer(rh_parahippocampal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1471. rh_paracentral_volume <- lmer(rh_paracentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1472. rh_parsopercularis_volume <- lmer(rh_parsopercularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1473. rh_parsorbitalis_volume <- lmer(rh_parsorbitalis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1474. rh_parstriangularis_volume <- lmer(rh_parstriangularis_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1475. rh_pericalcarine_volume <- lmer(rh_pericalcarine_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1476. rh_postcentral_volume <- lmer(rh_postcentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1477. rh_posteriorcingulate_volume <- lmer(rh_posteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1478. rh_precentral_volume <- lmer(rh_precentral_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1479. rh_precuneus_volume <- lmer(rh_precuneus_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1480. rh_rostralanteriorcingulate_volume <- lmer(rh_rostralanteriorcingulate_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1481. rh_rostralmiddlefrontal_volume <- lmer(rh_rostralmiddlefrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1482. rh_superiorfrontal_volume <- lmer(rh_superiorfrontal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1483. rh_superiorparietal_volume <- lmer(rh_superiorparietal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1484. rh_superiortemporal_volume <- lmer(rh_superiortemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1485. rh_supramarginal_volume <- lmer(rh_supramarginal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1486. rh_frontalpole_volume <- lmer(rh_frontalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1487. rh_temporalpole_volume <- lmer(rh_temporalpole_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1488. rh_transversetemporal_volume <- lmer(rh_transversetemporal_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1489. rh_insula_volume <- lmer(rh_insula_volume ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1490. Left_Cerebellum_Cortex <- lmer(Left_Cerebellum_Cortex ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1491. Left_Thalamus_Proper <- lmer(Left_Thalamus_Proper ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1492. Left_Caudate <- lmer(Left_Caudate ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1493. Left_Putamen <- lmer(Left_Putamen ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1494. Left_Pallidum <- lmer(Left_Pallidum ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1495. Brain_Stem <- lmer(Brain_Stem ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1496. Left_Hippocampus <- lmer(Left_Hippocampus ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1497. Left_Amygdala <- lmer(Left_Amygdala ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1498. Left_Accumbens_area <- lmer(Left_Accumbens_area ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1499. Left_VentralDC <- lmer(Left_VentralDC ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1500. Right_Cerebellum_Cortex <- lmer(Right_Cerebellum_Cortex ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1501. Right_Thalamus_Proper <- lmer(Right_Thalamus_Proper ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1502. Right_Caudate <- lmer(Right_Caudate ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1503. Right_Putamen <- lmer(Right_Putamen ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1504. Right_Pallidum <- lmer(Right_Pallidum ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1505. Right_Hippocampus <- lmer(Right_Hippocampus ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1506. Right_Amygdala <- lmer(Right_Amygdala ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1507. Right_Accumbens_area <- lmer(Right_Accumbens_area ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1508. Right_VentralDC <- lmer(Right_VentralDC ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1509. TotalGrayVol <- lmer(TotalGrayVol ~ bully_victim + age + I(age^2) + sex + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "bobyqa"))
  1510. #Quad_simple
  1511. #Linear_complex
  1512. #Linear_simple
  1513. # Predicting all dependent variables (DVs) and storing predictions in newdata
  1514. newdata$predicted_lh_bankssts_volume <- predict(lh_bankssts_volume, newdata = newdata, re.form = NA)
  1515. newdata$predicted_lh_caudalanteriorcingulate_volume <- predict(lh_caudalanteriorcingulate_volume, newdata = newdata, re.form = NA)
  1516. newdata$predicted_lh_caudalmiddlefrontal_volume <- predict(lh_caudalmiddlefrontal_volume, newdata = newdata, re.form = NA)
  1517. newdata$predicted_lh_cuneus_volume <- predict(lh_cuneus_volume, newdata = newdata, re.form = NA)
  1518. newdata$predicted_lh_entorhinal_volume <- predict(lh_entorhinal_volume, newdata = newdata, re.form = NA)
  1519. newdata$predicted_lh_fusiform_volume <- predict(lh_fusiform_volume, newdata = newdata, re.form = NA)
  1520. newdata$predicted_lh_inferiorparietal_volume <- predict(lh_inferiorparietal_volume, newdata = newdata, re.form = NA)
  1521. newdata$predicted_lh_inferiortemporal_volume <- predict(lh_inferiortemporal_volume, newdata = newdata, re.form = NA)
  1522. newdata$predicted_lh_isthmuscingulate_volume <- predict(lh_isthmuscingulate_volume, newdata = newdata, re.form = NA)
  1523. newdata$predicted_lh_lateraloccipital_volume <- predict(lh_lateraloccipital_volume, newdata = newdata, re.form = NA)
  1524. newdata$predicted_lh_lateralorbitofrontal_volume <- predict(lh_lateralorbitofrontal_volume, newdata = newdata, re.form = NA)
  1525. newdata$predicted_lh_lingual_volume <- predict(lh_lingual_volume, newdata = newdata, re.form = NA)
  1526. newdata$predicted_lh_medialorbitofrontal_volume <- predict(lh_medialorbitofrontal_volume, newdata = newdata, re.form = NA)
  1527. newdata$predicted_lh_middletemporal_volume <- predict(lh_middletemporal_volume, newdata = newdata, re.form = NA)
  1528. newdata$predicted_lh_parahippocampal_volume <- predict(lh_parahippocampal_volume, newdata = newdata, re.form = NA)
  1529. newdata$predicted_lh_paracentral_volume <- predict(lh_paracentral_volume, newdata = newdata, re.form = NA)
  1530. newdata$predicted_lh_parsopercularis_volume <- predict(lh_parsopercularis_volume, newdata = newdata, re.form = NA)
  1531. newdata$predicted_lh_parsorbitalis_volume <- predict(lh_parsorbitalis_volume, newdata = newdata, re.form = NA)
  1532. newdata$predicted_lh_parstriangularis_volume <- predict(lh_parstriangularis_volume, newdata = newdata, re.form = NA)
  1533. newdata$predicted_lh_pericalcarine_volume <- predict(lh_pericalcarine_volume, newdata = newdata, re.form = NA)
  1534. newdata$predicted_lh_postcentral_volume <- predict(lh_postcentral_volume, newdata = newdata, re.form = NA)
  1535. newdata$predicted_lh_posteriorcingulate_volume <- predict(lh_posteriorcingulate_volume, newdata = newdata, re.form = NA)
  1536. newdata$predicted_lh_precentral_volume <- predict(lh_precentral_volume, newdata = newdata, re.form = NA)
  1537. newdata$predicted_lh_precuneus_volume <- predict(lh_precuneus_volume, newdata = newdata, re.form = NA)
  1538. newdata$predicted_lh_rostralanteriorcingulate_volume <- predict(lh_rostralanteriorcingulate_volume, newdata = newdata, re.form = NA)
  1539. newdata$predicted_lh_rostralmiddlefrontal_volume <- predict(lh_rostralmiddlefrontal_volume, newdata = newdata, re.form = NA)
  1540. newdata$predicted_lh_superiorfrontal_volume <- predict(lh_superiorfrontal_volume, newdata = newdata, re.form = NA)
  1541. newdata$predicted_lh_superiorparietal_volume <- predict(lh_superiorparietal_volume, newdata = newdata, re.form = NA)
  1542. newdata$predicted_lh_superiortemporal_volume <- predict(lh_superiortemporal_volume, newdata = newdata, re.form = NA)
  1543. newdata$predicted_lh_supramarginal_volume <- predict(lh_supramarginal_volume, newdata = newdata, re.form = NA)
  1544. newdata$predicted_lh_frontalpole_volume <- predict(lh_frontalpole_volume, newdata = newdata, re.form = NA)
  1545. newdata$predicted_lh_temporalpole_volume <- predict(lh_temporalpole_volume, newdata = newdata, re.form = NA)
  1546. newdata$predicted_lh_transversetemporal_volume <- predict(lh_transversetemporal_volume, newdata = newdata, re.form = NA)
  1547. newdata$predicted_lh_insula_volume <- predict(lh_insula_volume, newdata = newdata, re.form = NA)
  1548. newdata$predicted_rh_bankssts_volume <- predict(rh_bankssts_volume, newdata = newdata, re.form = NA)
  1549. newdata$predicted_rh_caudalanteriorcingulate_volume <- predict(rh_caudalanteriorcingulate_volume, newdata = newdata, re.form = NA)
  1550. newdata$predicted_rh_caudalmiddlefrontal_volume <- predict(rh_caudalmiddlefrontal_volume, newdata = newdata, re.form = NA)
  1551. newdata$predicted_rh_cuneus_volume <- predict(rh_cuneus_volume, newdata = newdata, re.form = NA)
  1552. newdata$predicted_rh_entorhinal_volume <- predict(rh_entorhinal_volume, newdata = newdata, re.form = NA)
  1553. newdata$predicted_rh_fusiform_volume <- predict(rh_fusiform_volume, newdata = newdata, re.form = NA)
  1554. newdata$predicted_rh_inferiorparietal_volume <- predict(rh_inferiorparietal_volume, newdata = newdata, re.form = NA)
  1555. newdata$predicted_rh_inferiortemporal_volume <- predict(rh_inferiortemporal_volume, newdata = newdata, re.form = NA)
  1556. newdata$predicted_rh_isthmuscingulate_volume <- predict(rh_isthmuscingulate_volume, newdata = newdata, re.form = NA)
  1557. newdata$predicted_rh_lateraloccipital_volume <- predict(rh_lateraloccipital_volume, newdata = newdata, re.form = NA)
  1558. newdata$predicted_rh_lateralorbitofrontal_volume <- predict(rh_lateralorbitofrontal_volume, newdata = newdata, re.form = NA)
  1559. newdata$predicted_rh_lingual_volume <- predict(rh_lingual_volume, newdata = newdata, re.form = NA)
  1560. newdata$predicted_rh_medialorbitofrontal_volume <- predict(rh_medialorbitofrontal_volume, newdata = newdata, re.form = NA)
  1561. newdata$predicted_rh_middletemporal_volume <- predict(rh_middletemporal_volume, newdata = newdata, re.form = NA)
  1562. newdata$predicted_rh_parahippocampal_volume <- predict(rh_parahippocampal_volume, newdata = newdata, re.form = NA)
  1563. newdata$predicted_rh_paracentral_volume <- predict(rh_paracentral_volume, newdata = newdata, re.form = NA)
  1564. newdata$predicted_rh_parsopercularis_volume <- predict(rh_parsopercularis_volume, newdata = newdata, re.form = NA)
  1565. newdata$predicted_rh_parsorbitalis_volume <- predict(rh_parsorbitalis_volume, newdata = newdata, re.form = NA)
  1566. newdata$predicted_rh_parstriangularis_volume <- predict(rh_parstriangularis_volume, newdata = newdata, re.form = NA)
  1567. newdata$predicted_rh_pericalcarine_volume <- predict(rh_pericalcarine_volume, newdata = newdata, re.form = NA)
  1568. newdata$predicted_rh_postcentral_volume <- predict(rh_postcentral_volume, newdata = newdata, re.form = NA)
  1569. newdata$predicted_rh_posteriorcingulate_volume <- predict(rh_posteriorcingulate_volume, newdata = newdata, re.form = NA)
  1570. newdata$predicted_rh_precentral_volume <- predict(rh_precentral_volume, newdata = newdata, re.form = NA)
  1571. newdata$predicted_rh_precuneus_volume <- predict(rh_precuneus_volume, newdata = newdata, re.form = NA)
  1572. newdata$predicted_rh_rostralanteriorcingulate_volume <- predict(rh_rostralanteriorcingulate_volume, newdata = newdata, re.form = NA)
  1573. newdata$predicted_rh_rostralmiddlefrontal_volume <- predict(rh_rostralmiddlefrontal_volume, newdata = newdata, re.form = NA)
  1574. newdata$predicted_rh_superiorfrontal_volume <- predict(rh_superiorfrontal_volume, newdata = newdata, re.form = NA)
  1575. newdata$predicted_rh_superiorparietal_volume <- predict(rh_superiorparietal_volume, newdata = newdata, re.form = NA)
  1576. newdata$predicted_rh_superiortemporal_volume <- predict(rh_superiortemporal_volume, newdata = newdata, re.form = NA)
  1577. newdata$predicted_rh_supramarginal_volume <- predict(rh_supramarginal_volume, newdata = newdata, re.form = NA)
  1578. newdata$predicted_rh_frontalpole_volume <- predict(rh_frontalpole_volume, newdata = newdata, re.form = NA)
  1579. newdata$predicted_rh_temporalpole_volume <- predict(rh_temporalpole_volume, newdata = newdata, re.form = NA)
  1580. newdata$predicted_rh_transversetemporal_volume <- predict(rh_transversetemporal_volume, newdata = newdata, re.form = NA)
  1581. newdata$predicted_rh_insula_volume <- predict(rh_insula_volume, newdata = newdata, re.form = NA)
  1582. newdata$predicted_Left_Cerebellum_Cortex <- predict(Left_Cerebellum_Cortex, newdata = newdata, re.form = NA)
  1583. newdata$predicted_Left_Thalamus_Proper <- predict(Left_Thalamus_Proper, newdata = newdata, re.form = NA)
  1584. newdata$predicted_Left_Caudate <- predict(Left_Caudate, newdata = newdata, re.form = NA)
  1585. newdata$predicted_Left_Putamen <- predict(Left_Putamen, newdata = newdata, re.form = NA)
  1586. newdata$predicted_Left_Pallidum <- predict(Left_Pallidum, newdata = newdata, re.form = NA)
  1587. newdata$predicted_Brain_Stem <- predict(Brain_Stem, newdata = newdata, re.form = NA)
  1588. newdata$predicted_Left_Hippocampus <- predict(Left_Hippocampus, newdata = newdata, re.form = NA)
  1589. newdata$predicted_Left_Amygdala <- predict(Left_Amygdala, newdata = newdata, re.form = NA)
  1590. newdata$predicted_Left_Accumbens_area <- predict(Left_Accumbens_area, newdata = newdata, re.form = NA)
  1591. newdata$predicted_Left_VentralDC <- predict(Left_VentralDC, newdata = newdata, re.form = NA)
  1592. newdata$predicted_Right_Cerebellum_Cortex <- predict(Right_Cerebellum_Cortex, newdata = newdata, re.form = NA)
  1593. newdata$predicted_Right_Thalamus_Proper <- predict(Right_Thalamus_Proper, newdata = newdata, re.form = NA)
  1594. newdata$predicted_Right_Caudate <- predict(Right_Caudate, newdata = newdata, re.form = NA)
  1595. newdata$predicted_Right_Putamen <- predict(Right_Putamen, newdata = newdata, re.form = NA)
  1596. newdata$predicted_Right_Pallidum <- predict(Right_Pallidum, newdata = newdata, re.form = NA)
  1597. newdata$predicted_Right_Hippocampus <- predict(Right_Hippocampus, newdata = newdata, re.form = NA)
  1598. newdata$predicted_Right_Amygdala <- predict(Right_Amygdala, newdata = newdata, re.form = NA)
  1599. newdata$predicted_Right_Accumbens_area <- predict(Right_Accumbens_area, newdata = newdata, re.form = NA)
  1600. newdata$predicted_Right_VentralDC <- predict(Right_VentralDC, newdata = newdata, re.form = NA)
  1601. newdata$predicted_TotalGrayVol <- predict(TotalGrayVol, newdata = newdata, re.form = NA)
  1602. # Create a vector containing the names of all predicted volumes
  1603. predicted_volumes <- c(
  1604. "predicted_lh_bankssts_volume",
  1605. "predicted_lh_caudalanteriorcingulate_volume",
  1606. "predicted_lh_caudalmiddlefrontal_volume",
  1607. "predicted_lh_cuneus_volume",
  1608. "predicted_lh_entorhinal_volume",
  1609. "predicted_lh_fusiform_volume",
  1610. "predicted_lh_inferiorparietal_volume",
  1611. "predicted_lh_inferiortemporal_volume",
  1612. "predicted_lh_isthmuscingulate_volume",
  1613. "predicted_lh_lateraloccipital_volume",
  1614. "predicted_lh_lateralorbitofrontal_volume",
  1615. "predicted_lh_lingual_volume",
  1616. "predicted_lh_medialorbitofrontal_volume",
  1617. "predicted_lh_middletemporal_volume",
  1618. "predicted_lh_parahippocampal_volume",
  1619. "predicted_lh_paracentral_volume",
  1620. "predicted_lh_parsopercularis_volume",
  1621. "predicted_lh_parsorbitalis_volume",
  1622. "predicted_lh_parstriangularis_volume",
  1623. "predicted_lh_pericalcarine_volume",
  1624. "predicted_lh_postcentral_volume",
  1625. "predicted_lh_posteriorcingulate_volume",
  1626. "predicted_lh_precentral_volume",
  1627. "predicted_lh_precuneus_volume",
  1628. "predicted_lh_rostralanteriorcingulate_volume",
  1629. "predicted_lh_rostralmiddlefrontal_volume",
  1630. "predicted_lh_superiorfrontal_volume",
  1631. "predicted_lh_superiorparietal_volume",
  1632. "predicted_lh_superiortemporal_volume",
  1633. "predicted_lh_supramarginal_volume",
  1634. "predicted_lh_frontalpole_volume",
  1635. "predicted_lh_temporalpole_volume",
  1636. "predicted_lh_transversetemporal_volume",
  1637. "predicted_lh_insula_volume",
  1638. "predicted_rh_bankssts_volume",
  1639. "predicted_rh_caudalanteriorcingulate_volume",
  1640. "predicted_rh_caudalmiddlefrontal_volume",
  1641. "predicted_rh_cuneus_volume",
  1642. "predicted_rh_entorhinal_volume",
  1643. "predicted_rh_fusiform_volume",
  1644. "predicted_rh_inferiorparietal_volume",
  1645. "predicted_rh_inferiortemporal_volume",
  1646. "predicted_rh_isthmuscingulate_volume",
  1647. "predicted_rh_lateraloccipital_volume",
  1648. "predicted_rh_lateralorbitofrontal_volume",
  1649. "predicted_rh_lingual_volume",
  1650. "predicted_rh_medialorbitofrontal_volume",
  1651. "predicted_rh_middletemporal_volume",
  1652. "predicted_rh_parahippocampal_volume",
  1653. "predicted_rh_paracentral_volume",
  1654. "predicted_rh_parsopercularis_volume",
  1655. "predicted_rh_parsorbitalis_volume",
  1656. "predicted_rh_parstriangularis_volume",
  1657. "predicted_rh_pericalcarine_volume",
  1658. "predicted_rh_postcentral_volume",
  1659. "predicted_rh_posteriorcingulate_volume",
  1660. "predicted_rh_precentral_volume",
  1661. "predicted_rh_precuneus_volume",
  1662. "predicted_rh_rostralanteriorcingulate_volume",
  1663. "predicted_rh_rostralmiddlefrontal_volume",
  1664. "predicted_rh_superiorfrontal_volume",
  1665. "predicted_rh_superiorparietal_volume",
  1666. "predicted_rh_superiortemporal_volume",
  1667. "predicted_rh_supramarginal_volume",
  1668. "predicted_rh_frontalpole_volume",
  1669. "predicted_rh_temporalpole_volume",
  1670. "predicted_rh_transversetemporal_volume",
  1671. "predicted_rh_insula_volume",
  1672. "predicted_Left_Cerebellum_Cortex",
  1673. "predicted_Left_Thalamus_Proper",
  1674. "predicted_Left_Caudate",
  1675. "predicted_Left_Putamen",
  1676. "predicted_Left_Pallidum",
  1677. "predicted_Brain_Stem",
  1678. "predicted_Left_Hippocampus",
  1679. "predicted_Left_Amygdala",
  1680. "predicted_Left_Accumbens_area",
  1681. "predicted_Left_VentralDC",
  1682. "predicted_Right_Cerebellum_Cortex",
  1683. "predicted_Right_Thalamus_Proper",
  1684. "predicted_Right_Caudate",
  1685. "predicted_Right_Putamen",
  1686. "predicted_Right_Pallidum",
  1687. "predicted_Right_Hippocampus",
  1688. "predicted_Right_Amygdala",
  1689. "predicted_Right_Accumbens_area",
  1690. "predicted_Right_VentralDC",
  1691. "predicted_TotalGrayVol"
  1692. )
  1693. }
  1694. #Figure Loop
  1695. {
  1696. # Create plots for each predicted volume and save them to the desktop
  1697. for (volume in predicted_volumes) {
  1698. # Create plot
  1699. p <- ggplot(newdata, aes(x = age, y = !!sym(volume), color = as.factor(bully_victim))) +
  1700. geom_line(size = 1.5, alpha = 0.7) +
  1701. scale_color_manual(values = c("red", "green", "blue"),
  1702. labels = c("25th percentile", "Mean", "75th percentile"),
  1703. name = "Bully Victim Percentiles") +
  1704. labs(title = paste("Trajectory of", volume, "by Bully Victim Percentiles"),
  1705. x = "Age",
  1706. y = "Volume mm^3") +
  1707. theme_minimal() +
  1708. theme(
  1709. plot.title = element_text(hjust = 0.5),
  1710. legend.position = "bottom"
  1711. ) +
  1712. guides(color = guide_legend(reverse = TRUE))
  1713. # Save plot to desktop with appropriate filename
  1714. ggsave(filename = paste("~/Desktop/IMAGEN/results_graphs/Quad_simple/Graph_", volume, ".png", sep = ""), plot = p, dpi = 400, width = 8, height = 6, units = "in")
  1715. }
  1716. }
  1717. #Figure
  1718. # Find the minimum age
  1719. min_age <- min(IMAGEN_bully$age_years, na.rm = TRUE)
  1720. # Remove the youngest participant
  1721. IMAGEN_bully <- IMAGEN_bully[IMAGEN_bully$age_years != min_age, ]
  1722. # Check the dataset after removal
  1723. head(IMAGEN_bully)
  1724. #Quad
  1725. # Loop through brain volumes
  1726. for (volume in DVlist) {
  1727. # Plot the data with quadratic lines for each group
  1728. p <- ggplot(data = IMAGEN_bully, aes_string(x = "age_years", y = volume, color = "bully_group")) +
  1729. geom_point(alpha = 0.1) + # Scatter plot
  1730. geom_smooth(aes(group = bully_group), method = "lm", formula = y ~ poly(x, 2), se = FALSE) + # Add quadratic regression lines
  1731. scale_color_manual(values = colors) + # Assign colors to groups
  1732. labs(title = paste("Trajectory of", volume, "by Bully Victim Percentiles"),
  1733. x = "Age",
  1734. y = "Volume mm^3") +
  1735. theme_minimal() +
  1736. theme(
  1737. plot.title = element_text(hjust = 0.5),
  1738. legend.position = "bottom"
  1739. ) +
  1740. guides(color = guide_legend(reverse = TRUE))
  1741. # Save the plot
  1742. ggsave(filename = paste("~/Desktop/IMAGEN/results_graphs/Quad/Graph_lm_", volume, ".png", sep = ""),
  1743. plot = p, dpi = 400, width = 6, height = 6, units = "in")
  1744. }
  1745. #Linear
  1746. # Loop through brain volumes
  1747. for (volume in DVlist) {
  1748. # Plot the data with linear regression lines for each group
  1749. p <- ggplot(data = IMAGEN_bully, aes_string(x = "age_years", y = volume, color = "bully_group")) +
  1750. geom_point(alpha = 0.1) + # Scatter plot
  1751. geom_smooth(aes(group = bully_group), method = "lm", se = FALSE) + # Add linear regression lines
  1752. scale_color_manual(values = colors) + # Assign colors to groups
  1753. labs(title = paste("Trajectory of", volume, "by Bully Victim Percentiles"),
  1754. x = "Age",
  1755. y = "Volume mm^3") +
  1756. theme_minimal() +
  1757. theme(
  1758. plot.title = element_text(hjust = 0.5),
  1759. legend.position = "bottom"
  1760. ) +
  1761. guides(color = guide_legend(reverse = TRUE))
  1762. # Save the plot
  1763. ggsave(filename = paste("~/Desktop/IMAGEN/results_graphs/Linear/Graph_lm_", volume, ".png", sep = ""),
  1764. plot = p, dpi = 400, width = 6, height = 6, units = "in")
  1765. }
  1766. # Plot the data with quadratic lines for each group
  1767. ggplot(data = IMAGEN_bully, aes(x = age_years, y = Left_Amygdala, color = bully_group)) +
  1768. geom_point(alpha = 0.1) + # Scatter plot
  1769. geom_smooth(aes(group = bully_group), method = "lm", se = FALSE) + # Add quadratic regression lines
  1770. scale_color_manual(values = colors) + # Assign colors to groups
  1771. labs(x = "Age", y = "Brain Volume (lh_cuneus)", color = "Bullying Score") + # Set axis labels
  1772. theme_minimal() # Use a minimal theme
  1773. #Sex_Figures
  1774. {
  1775. # Calculate percentiles
  1776. p25_bully_victim <- quantile(IMAGEN_bully$bully_victim, 0.25, na.rm = TRUE)
  1777. p75_bully_victim <- quantile(IMAGEN_bully$bully_victim, 0.75, na.rm = TRUE)
  1778. # Categorize bully_victim variable into two groups based on percentiles
  1779. IMAGEN_bully$bully_victim_group <- ifelse(IMAGEN_bully$bully_victim < p25_bully_victim, "Low", "High")
  1780. }
  1781. #Quad_simple
  1782. lh_lateralorbitofrontal_volume <- lmer(lh_lateralorbitofrontal_volume ~ bully_victim + age + I(age^2) + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1783. summary(lh_lateralorbitofrontal_volume)
  1784. effectsize(lh_lateralorbitofrontal_volume)
  1785. lh_precuneus_volume <- lmer(lh_precuneus_volume ~ bully_victim + age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1786. lh_superiorparietal_volume <- lmer(lh_superiorparietal_volume ~ bully_victim + age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1787. rh_isthmuscingulate_volume <- lmer(rh_isthmuscingulate_volume ~ bully_victim + age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1788. rh_postcentral_volume <- lmer(rh_postcentral_volume ~ bully_victim + age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1789. #Quad_complex
  1790. lh_parahippocampal_volume <- lmer(lh_parahippocampal_volume ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1791. rh_parahippocampal_volume <- lmer(rh_parahippocampal_volume ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1792. effectsize(rh_parahippocampal_volume)
  1793. lh_transversetemporal_volume <- lmer(lh_transversetemporal_volume ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1794. rh_bankssts_volume <- lmer(rh_bankssts_volume ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1795. Left_Accumbens_area <- lmer(Left_Accumbens_area ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1796. Left_VentralDC <- lmer(Left_VentralDC ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1797. Right_VentralDC <- lmer(Right_VentralDC ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1798. Right_Putamen <- lmer(Right_Putamen ~ bully_victim * age + I(age^2) + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1799. #Linear_complex
  1800. lh_caudalmiddlefrontal_volume <- lmer(lh_caudalmiddlefrontal_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1801. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1802. lh_pericalcarine_volume <- lmer(lh_pericalcarine_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1803. lh_postcentral_volume <- lmer(lh_postcentral_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1804. rh_paracentral_volume <- lmer(rh_paracentral_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1805. rh_precentral_volume <- lmer(rh_precentral_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1806. rh_precuneus_volume <- lmer(rh_precuneus_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1807. rh_transversetemporal_volume <- lmer(rh_transversetemporal_volume ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1808. Brain_Stem <- lmer(Brain_Stem ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1809. Right_Amygdala <- lmer(Right_Amygdala ~ bully_victim * age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1810. #Linear_linear
  1811. lh_inferiorparietal_volume <- lmer(lh_inferiorparietal_volume ~ bully_victim + age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1812. lh_lingual_volume <- lmer(lh_lingual_volume ~ bully_victim + age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1813. rh_caudalmiddlefrontal_volume <- lmer(rh_caudalmiddlefrontal_volume ~ bully_victim + age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1814. rh_superiorparietal_volume <- lmer(rh_superiorparietal_volume ~ bully_victim + age + sex*bully_victim + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1 + age|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  1815. {
  1816. ggpredict(lh_precuneus_volume, terms = c("bully_victim[all]", "sex")) %>%
  1817. plot() +
  1818. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1819. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = lh_precuneus_volume, group = sex, color = bully_victim_group), alpha = 0.1, inherit.aes = F) +
  1820. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Left Lateral Orbitofrontal Volume") +
  1821. theme_minimal()
  1822. }
  1823. {
  1824. ggpredict(lh_lateralorbitofrontal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1825. plot() +
  1826. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1827. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = lh_lateralorbitofrontal_volume, group = subID, color = sex), inherit.aes = F, alpha = 0.1) +
  1828. labs(x = "Months post baseline", y = "Volume mm³", title = "Left Lateral Orbitofrontal Cortex") +
  1829. theme_minimal()
  1830. ggpredict(lh_precuneus_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1831. plot() +
  1832. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1833. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = lh_precuneus_volume, group = subID, color = sex), inherit.aes = F, alpha = 0.1) +
  1834. labs(x = "Months post baseline", y = "Volume mm³", title = "Left Precuneus") +
  1835. theme_minimal()
  1836. ggpredict(lh_superiorparietal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1837. plot() +
  1838. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1839. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = lh_superiorparietal_volume, group = subID, color = sex), inherit.aes = F, alpha = 0.1) +
  1840. labs(x = "Months post baseline", y = "Volume mm³", title = "Left Superior Parietal") +
  1841. theme_minimal()
  1842. ggpredict(rh_isthmuscingulate_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1843. plot() +
  1844. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1845. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = rh_isthmuscingulate_volume, group = subID, color = sex), inherit.aes = F, alpha = 0.1) +
  1846. labs(x = "Months post baseline", y = "Volume mm³", title = "Right Isthmus Cingulate") +
  1847. theme_minimal()
  1848. ggpredict(rh_postcentral_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1849. plot() +
  1850. scale_x_continuous(name="Months Post Baseline", breaks = seq(0, 20, 2)) +
  1851. geom_point(data=IMAGEN_bully, aes(x = bully_victim, y = rh_postcentral_volume, group = subID, color = sex), inherit.aes = F, alpha = 0.1) +
  1852. labs(x = "Months post baseline", y = "Volume mm³", title = "Right Post Cental") +
  1853. theme_minimal()
  1854. }
  1855. # Load necessary libraries
  1856. library(ggplot2)
  1857. library(patchwork)
  1858. #Quad_simple
  1859. {
  1860. # Generate predictions and plots for each brain region
  1861. plot1 <- ggpredict(lh_lateralorbitofrontal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1862. plot() +
  1863. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1864. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_lateralorbitofrontal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1865. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Lateral Orbitofrontal Cortex") +
  1866. theme_minimal()
  1867. plot2 <- ggpredict(lh_precuneus_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1868. plot() +
  1869. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1870. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_precuneus_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1871. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Precuneus") +
  1872. theme_minimal()
  1873. plot3 <- ggpredict(lh_superiorparietal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1874. plot() +
  1875. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1876. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_superiorparietal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1877. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Superior Parietal") +
  1878. theme_minimal()
  1879. plot4 <- ggpredict(rh_isthmuscingulate_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1880. plot() +
  1881. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1882. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_isthmuscingulate_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1883. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Isthmus Cingulate") +
  1884. theme_minimal()
  1885. plot5 <- ggpredict(rh_postcentral_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1886. plot() +
  1887. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1888. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_postcentral_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1889. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Post Central") +
  1890. theme_minimal()
  1891. # Combine all plots into one figure
  1892. combined_plots_Quad_simple <- plot1 + plot2 + plot3 + plot4 + plot5
  1893. # Print the combined figure
  1894. print(plot1)
  1895. # Save the combined figure with 400 DPI
  1896. ggsave("combined_plots_Quad_simple.png", combined_plots_Quad_simple, dpi = 400)
  1897. }
  1898. #Quad_complex
  1899. {
  1900. # Generate predictions and plots for each brain region
  1901. plot6 <- ggpredict(lh_parahippocampal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1902. plot() +
  1903. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1904. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_parahippocampal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1905. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Parahippocampal") +
  1906. theme_minimal()
  1907. plot7 <- ggpredict(rh_parahippocampal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1908. plot() +
  1909. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1910. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_parahippocampal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1911. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Parahippocampal") +
  1912. theme_minimal()
  1913. plot8 <- ggpredict(lh_transversetemporal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1914. plot() +
  1915. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1916. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_transversetemporal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1917. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Transverse Temporal") +
  1918. theme_minimal()
  1919. plot9 <- ggpredict(rh_bankssts_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1920. plot() +
  1921. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1922. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_bankssts_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1923. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Bankssts") +
  1924. theme_minimal()
  1925. plot10 <- ggpredict(Left_Accumbens_area, terms = c("bully_victim[all]", "sex[all]")) %>%
  1926. plot() +
  1927. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1928. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Left_Accumbens_area, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1929. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Accumbens") +
  1930. theme_minimal()
  1931. plot11 <- ggpredict(Left_VentralDC, terms = c("bully_victim[all]", "sex[all]")) %>%
  1932. plot() +
  1933. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1934. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Left_VentralDC, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1935. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Ventral DC") +
  1936. theme_minimal()
  1937. plot12 <- ggpredict(Right_VentralDC, terms = c("bully_victim[all]", "sex[all]")) %>%
  1938. plot() +
  1939. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1940. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Right_VentralDC, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1941. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Ventral DC") +
  1942. theme_minimal()
  1943. plot13 <- ggpredict(Right_Putamen, terms = c("bully_victim[all]", "sex[all]")) %>%
  1944. plot() +
  1945. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1946. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Right_Putamen, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1947. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Putamen") +
  1948. theme_minimal()
  1949. # Combine all plots into one figure
  1950. combined_plots_Quad_complex <- plot6 + plot7 + plot8 + plot9 + plot10 + plot11 + plot12 + plot13
  1951. # Print the combined figure
  1952. print(plot1)
  1953. # Save the combined figure with 400 DPI
  1954. ggsave("combined_plots_Quad_complex", combined_plots_Quad_simple, dpi = 400)
  1955. }
  1956. ggpredict(rh_parahippocampal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1957. plot() +
  1958. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1959. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_parahippocampal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1960. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Parahippocampal") +
  1961. theme_minimal() +
  1962. scale_color_manual(values = c("female" = "blue", "male" = "red")) # Specify the correct colors for females and males
  1963. #Linear_simple
  1964. {
  1965. # Generate predictions and plots for each brain region
  1966. plot14 <- ggpredict(lh_inferiorparietal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1967. plot() +
  1968. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1969. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_inferiorparietal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1970. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Inferior Parietal") +
  1971. theme_minimal()
  1972. plot15 <- ggpredict(lh_lingual_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1973. plot() +
  1974. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1975. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_lingual_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1976. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Lingual") +
  1977. theme_minimal()
  1978. plot16 <- ggpredict(rh_caudalmiddlefrontal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1979. plot() +
  1980. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1981. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_caudalmiddlefrontal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1982. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Caudal Middle Frontal") +
  1983. theme_minimal()
  1984. plot17 <- ggpredict(rh_superiorparietal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  1985. plot() +
  1986. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  1987. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_superiorparietal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  1988. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Superior Parietal") +
  1989. theme_minimal()
  1990. # Combine all plots into one figure
  1991. combined_plots_L_simple <- plot14 + plot15 + plot16 + plot17
  1992. # Print the combined figure
  1993. print(plot1)
  1994. # Save the combined figure with 400 DPI
  1995. ggsave("combined_plots_L_simple.png", combined_plots_L_simple, dpi = 400)
  1996. }
  1997. #Linear_complex
  1998. {
  1999. # Generate predictions and plots for each brain region
  2000. plot18 <- ggpredict(lh_caudalmiddlefrontal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2001. plot() +
  2002. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2003. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_caudalmiddlefrontal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2004. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Caudal Middle Frontal") +
  2005. theme_minimal()
  2006. plot19 <- ggpredict(lh_isthmuscingulate_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2007. plot() +
  2008. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2009. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_isthmuscingulate_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2010. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Isthmus Cingulate") +
  2011. theme_minimal()
  2012. plot20 <- ggpredict(lh_pericalcarine_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2013. plot() +
  2014. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2015. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_pericalcarine_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2016. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Pericalarine") +
  2017. theme_minimal()
  2018. plot21 <- ggpredict(lh_postcentral_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2019. plot() +
  2020. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2021. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = lh_postcentral_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2022. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Left Postcentral") +
  2023. theme_minimal()
  2024. plot22 <- ggpredict(rh_paracentral_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2025. plot() +
  2026. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2027. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_paracentral_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2028. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Paracentral") +
  2029. theme_minimal()
  2030. plot23 <- ggpredict(rh_precentral_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2031. plot() +
  2032. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2033. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_precentral_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2034. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Precentral") +
  2035. theme_minimal()
  2036. plot24 <- ggpredict(rh_precuneus_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2037. plot() +
  2038. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2039. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_precuneus_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2040. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Precuneus") +
  2041. theme_minimal()
  2042. plot25 <- ggpredict(rh_transversetemporal_volume, terms = c("bully_victim[all]", "sex[all]")) %>%
  2043. plot() +
  2044. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2045. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = rh_transversetemporal_volume, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2046. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Transverse Temporal") +
  2047. theme_minimal()
  2048. plot26 <- ggpredict(Brain_Stem, terms = c("bully_victim[all]", "sex[all]")) %>%
  2049. plot() +
  2050. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2051. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Brain_Stem, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2052. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Brain Stem") +
  2053. theme_minimal()
  2054. plot27 <- ggpredict(Right_Amygdala, terms = c("bully_victim[all]", "sex[all]")) %>%
  2055. plot() +
  2056. scale_x_continuous(name = "OB/VQ Score", breaks = seq(0, 20, 4)) +
  2057. geom_point(data = IMAGEN_bully, aes(x = bully_victim, y = Right_Amygdala, group = subID, color = sex), inherit.aes = FALSE, alpha = 0.1) +
  2058. labs(x = "OB/VQ Score", y = "Volume mm³", title = "Right Amygdala") +
  2059. theme_minimal()
  2060. # Combine all plots into one figure
  2061. combined_plots_L_complex <- plot18 + plot19 + plot20 + plot21 + plot22 + plot23 + plot24 + plot25 + plot26 + plot27
  2062. # Print the combined figure
  2063. print(plot7)
  2064. # Save the combined figure with 400 DPI
  2065. ggsave("combined_plots_L_complex.png", combined_plots_L_complex, dpi = 400)
  2066. }
  2067. {
  2068. # Calculate quartiles separately for males and females
  2069. male_bully <- IMAGEN_bully$bully_victim[IMAGEN_bully$sex == "male"]
  2070. female_bully <- IMAGEN_bully$bully_victim[IMAGEN_bully$sex == "female"]
  2071. p25_male <- quantile(male_bully, 0.25, na.rm = TRUE) # 25th percentile for males
  2072. p75_male <- quantile(male_bully, 0.75, na.rm = TRUE) # 75th percentile for males
  2073. p25_female <- quantile(female_bully, 0.25, na.rm = TRUE) # 25th percentile for females
  2074. p75_female <- quantile(female_bully, 0.75, na.rm = TRUE) # 75th percentile for females
  2075. # Create a factor variable for grouping the bullying scores into four groups based on gender and quartiles
  2076. IMAGEN_bully$bully_victim_group <- ifelse(IMAGEN_bully$sex == "male",
  2077. ifelse(IMAGEN_bully$bully_victim <= p25_male, "male_low",
  2078. ifelse(IMAGEN_bully$bully_victim <= p75_male, "male_high", NA)),
  2079. ifelse(IMAGEN_bully$bully_victim <= p25_female, "female_low",
  2080. ifelse(IMAGEN_bully$bully_victim <= p75_female, "female_high", NA)))
  2081. IMAGEN_bully$bully_victim_group <- factor(IMAGEN_bully$bully_victim_group,
  2082. levels = c("male_low", "male_high", "female_low", "female_high"),
  2083. labels = c("Male Low", "Male High", "Female Low", "Female High"))
  2084. IMAGEN_bully <- IMAGEN_bully[!is.na(IMAGEN_bully$bully_victim_group), ]
  2085. # Create a color palette for differentiating the groups
  2086. bully_colors <- c("male_low" = "red", "male_high" = "blue", "female_low" = "darkgreen", "female_high" = "purple") # Only two colors for two groups
  2087. Left_Accumbens_area <- lmer(Left_Accumbens_area ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2088. predicted_values_Left_Accumbens_area <- ggpredict(Left_Accumbens_area,
  2089. terms = c("age_years[all]", "bully_victim_group[all]"))
  2090. rh_parahippocampal_volume <- lmer(rh_parahippocampal_volume ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2091. predicted_values_rh_parahippocampal_volume <- ggpredict(rh_parahippocampal_volume,
  2092. terms = c("age_years[all]", "bully_victim_group[all]"))
  2093. lh_parahippocampal_volume <- lmer(lh_parahippocampal_volume ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2094. predicted_values_lh_parahippocampal_volume <- ggpredict(lh_parahippocampal_volume,
  2095. terms = c("age_years[all]", "bully_victim_group[all]"))
  2096. Right_Putamen <- lmer(Right_Putamen ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2097. predicted_values_Right_Putamen <- ggpredict(Right_Putamen,
  2098. terms = c("age_years[all]", "bully_victim_group[all]"))
  2099. Right_VentralDC <- lmer(Right_VentralDC ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2100. predicted_values_Right_VentralDC <- ggpredict(Right_VentralDC,
  2101. terms = c("age_years[all]", "bully_victim_group[all]"))
  2102. Left_VentralDC <- lmer(Left_VentralDC ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2103. predicted_values_Left_VentralDC <- ggpredict(Left_VentralDC,
  2104. terms = c("age_years[all]", "bully_victim_group[all]"))
  2105. Right_Amygdala <- lmer(Right_Amygdala ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2106. predicted_values_Right_Amygdala <- ggpredict(Right_Amygdala,
  2107. terms = c("age_years[all]", "bully_victim_group[all]"))
  2108. Brain_Stem <- lmer(Brain_Stem ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2109. predicted_values_Brain_Stem <- ggpredict(Brain_Stem,
  2110. terms = c("age_years[all]", "bully_victim_group[all]"))
  2111. rh_bankssts_volume <- lmer(rh_bankssts_volume ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2112. predicted_values_rh_bankssts_volume <- ggpredict(rh_bankssts_volume,
  2113. terms = c("age_years[all]", "bully_victim_group[all]"))
  2114. lh_isthmuscingulate_volume <- lmer(lh_isthmuscingulate_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2115. predicted_values_lh_isthmuscingulate_volume <- ggpredict(lh_isthmuscingulate_volume,
  2116. terms = c("age_years[all]", "bully_victim_group[all]"))
  2117. lh_caudalmiddlefrontal_volume <- lmer(lh_caudalmiddlefrontal_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2118. predicted_values_lh_caudalmiddlefrontal_volume <- ggpredict(lh_caudalmiddlefrontal_volume,
  2119. terms = c("age_years[all]", "bully_victim_group[all]"))
  2120. rh_precuneus_volume <- lmer(rh_precuneus_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2121. predicted_values_rh_precuneus_volume<- ggpredict(rh_precuneus_volume,
  2122. terms = c("age_years[all]", "bully_victim_group[all]"))
  2123. rh_transversetemporal_volume <- lmer(rh_transversetemporal_volume ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2124. predicted_values_rh_transversetemporal_volume<- ggpredict(rh_transversetemporal_volume,
  2125. terms = c("age_years[all]", "bully_victim_group[all]"))
  2126. lh_pericalcarine_volume <- lmer(lh_pericalcarine_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2127. predicted_values_lh_pericalcarine_volume<- ggpredict(lh_pericalcarine_volume,
  2128. terms = c("age_years[all]", "bully_victim_group[all]"))
  2129. lh_postcentral_volume <- lmer(lh_postcentral_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2130. predicted_values_lh_postcentral_volume<- ggpredict(lh_postcentral_volume,
  2131. terms = c("age_years[all]", "bully_victim_group[all]"))
  2132. Left_Pallidum <- lmer(Left_Pallidum ~ bully_victim_group * age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2133. predicted_values_Left_Pallidum<- ggpredict(Left_Pallidum,
  2134. terms = c("age_years[all]", "bully_victim_group[all]"))
  2135. rh_paracentral_volume <- lmer(rh_paracentral_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2136. predicted_values_rh_paracentral_volume<- ggpredict(rh_paracentral_volume,
  2137. terms = c("age_years[all]", "bully_victim_group[all]"))
  2138. lh_superiorparietal_volume <- lmer(lh_superiorparietal_volume ~ bully_victim_group + age_years + sex*bully_victim_group + I(age_years^2) + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2139. predicted_values_lh_superiorparietal_volume<- ggpredict(lh_superiorparietal_volume,
  2140. terms = c("age_years[all]", "bully_victim_group[all]"))
  2141. rh_superiorparietal_volume <- lmer(rh_superiorparietal_volume ~ bully_victim_group + age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2142. predicted_values_rh_superiorparietal_volume<- ggpredict(rh_superiorparietal_volume,
  2143. terms = c("age_years[all]", "bully_victim_group[all]"))
  2144. lh_inferiorparietal_volume <- lmer(lh_inferiorparietal_volume ~ bully_victim_group + age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2145. predicted_values_lh_inferiorparietal_volume<- ggpredict(lh_inferiorparietal_volume,
  2146. terms = c("age_years[all]", "bully_victim_group[all]"))
  2147. rh_isthmuscingulate_volume <- lmer(rh_isthmuscingulate_volume ~ bully_victim_group + age_years + I(age_years^2) + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2148. predicted_values_rh_isthmuscingulate_volume<- ggpredict(rh_isthmuscingulate_volume,
  2149. terms = c("age_years[all]", "bully_victim_group[all]"))
  2150. rh_caudalmiddlefrontal_volume <- lmer(rh_caudalmiddlefrontal_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2151. predicted_values_rh_caudalmiddlefrontal_volume<- ggpredict(rh_caudalmiddlefrontal_volume,
  2152. terms = c("age_years[all]", "bully_victim_group[all]"))
  2153. rh_precentral_volume <- lmer(rh_precentral_volume ~ bully_victim_group * age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2154. predicted_values_rh_precentral_volume<- ggpredict(rh_precentral_volume,
  2155. terms = c("age_years[all]", "bully_victim_group[all]"))
  2156. lh_lingual_volume <- lmer(lh_lingual_volume ~ bully_victim_group + age_years + sex*bully_victim_group + SES + mode_c_pds + EstimatedTotalIntraCranialVol + (1|subID) + (1|scan_site), data = IMAGEN_bully, REML = TRUE, control = lmerControl(optimizer = "nloptwrap"))
  2157. predicted_values_lh_lingual_volume<- ggpredict(lh_lingual_volume,
  2158. terms = c("age_years[all]", "bully_victim_group[all]"))
  2159. #Bully sex graphs
  2160. plot18 <- plot(predicted_values_Left_Accumbens_area) +
  2161. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2162. geom_point(data = IMAGEN_bully, aes(x = age_years, y = Left_Accumbens_area,
  2163. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2164. geom_smooth(method = "gam", se = TRUE, size = 1, alpha = 0.3) + # Increase line size for better visibility
  2165. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Left Accumbens") +
  2166. coord_cartesian(ylim = c(400, 1100)) + # Adjust the y-axis limits to zoom in on the range of interest
  2167. theme_minimal() + # Use minimal theme
  2168. theme(text = element_text(family = "Times New Roman"), # Set font family
  2169. axis.title = element_text(size = 10), # Customize axis title
  2170. axis.text = element_text(size = 8), # Customize axis text
  2171. legend.position = "none", # Hide the legend
  2172. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2173. # Plot predicted values with smoother prediction lines
  2174. plot19 <- plot(predicted_values_rh_parahippocampal_volume) +
  2175. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2176. geom_point(data = IMAGEN_bully, aes(x = age_years, y = rh_parahippocampal_volume,
  2177. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2178. geom_smooth(method = "gam", se = TRUE, size = 1, alpha = 0.3) + # Increase line size for better visibility
  2179. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Right Parahippocampal Gyrus") +
  2180. coord_cartesian(ylim = c(1800, 2800)) + # Adjust the y-axis limits to zoom in on the range of interest
  2181. theme_minimal() + # Use minimal theme
  2182. theme(text = element_text(family = "Times New Roman"), # Set font family
  2183. axis.title = element_text(size = 10), # Customize axis title
  2184. axis.text = element_text(size = 8), # Customize axis text
  2185. legend.position = "none", # Hide the legend
  2186. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2187. # Plot predicted values with smoother prediction lines
  2188. plot20 <- plot(predicted_values_lh_parahippocampal_volume) +
  2189. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2190. geom_point(data = IMAGEN_bully, aes(x = age_years, y = lh_parahippocampal_volume,
  2191. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2192. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2193. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Left Parahippocampal Gyrus") +
  2194. coord_cartesian(ylim = c(1800, 3000)) + # Adjust the y-axis limits to zoom in on the range of interest
  2195. theme_minimal() + # Use minimal theme
  2196. theme(text = element_text(family = "Times New Roman"), # Set font family
  2197. axis.title = element_text(size = 10), # Customize axis title
  2198. axis.text = element_text(size = 8), # Customize axis text
  2199. legend.position = "none", # Hide the legend
  2200. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2201. # Plot predicted values with smoother prediction lines
  2202. plot21 <- plot(predicted_values_Right_Putamen) +
  2203. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2204. geom_point(data = IMAGEN_bully, aes(x = age_years, y = Right_Putamen,
  2205. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2206. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2207. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Right Putamen") +
  2208. coord_cartesian(ylim = c(4000, 8000)) + # Adjust the y-axis limits to zoom in on the range of interest
  2209. theme_minimal() + # Use minimal theme
  2210. theme(text = element_text(family = "Times New Roman"), # Set font family
  2211. axis.title = element_text(size = 10), # Customize axis title
  2212. axis.text = element_text(size = 8), # Customize axis text
  2213. legend.position = "none", # Hide the legend
  2214. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2215. # Plot predicted values with smoother prediction lines
  2216. plot22 <- plot(predicted_values_Right_VentralDC) +
  2217. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2218. geom_point(data = IMAGEN_bully, aes(x = age_years, y = Right_VentralDC,
  2219. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2220. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2221. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Right Ventral Dienchephalon") +
  2222. theme_minimal() + # Use minimal theme
  2223. coord_cartesian(ylim = c(3000, 5000)) + # Adjust the y-axis limits to zoom in on the range of interest
  2224. theme(text = element_text(family = "Times New Roman"), # Set font family
  2225. axis.title = element_text(size = 10), # Customize axis title
  2226. axis.text = element_text(size = 8), # Customize axis text
  2227. legend.position = "none", # Hide the legend
  2228. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2229. plot23 <- plot(predicted_values_Left_VentralDC) +
  2230. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2231. geom_point(data = IMAGEN_bully, aes(x = age_years, y = Left_VentralDC,
  2232. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2233. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2234. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Left Ventral Dienchephalon") +
  2235. coord_cartesian(ylim = c(2750, 5250)) + # Adjust the y-axis limits to zoom in on the range of interest
  2236. theme_minimal() + # Use minimal theme
  2237. theme(text = element_text(family = "Times New Roman"), # Set font family
  2238. axis.title = element_text(size = 10), # Customize axis title
  2239. axis.text = element_text(size = 8), # Customize axis text
  2240. legend.position = "none", # Hide the legend
  2241. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2242. plot24 <- plot(predicted_values_Right_Amygdala) +
  2243. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2244. geom_point(data = IMAGEN_bully, aes(x = age_years, y = Right_Amygdala,
  2245. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2246. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2247. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Right Amygdala") +
  2248. theme_minimal() + # Use minimal theme
  2249. theme(text = element_text(family = "Times New Roman"), # Set font family
  2250. axis.title = element_text(size = 10), # Customize axis title
  2251. axis.text = element_text(size = 8), # Customize axis text
  2252. legend.position = "none", # Hide the legend
  2253. plot.title = element_text(size = 14, face = "bold", hjust = 0.5))# Cente
  2254. plot27 <- plot(predicted_values_rh_bankssts_volume) +
  2255. scale_x_continuous(name = "Age (Years)", breaks = seq(0, 24, 4)) +
  2256. geom_point(data = IMAGEN_bully, aes(x = age_years, y = rh_bankssts_volume,
  2257. group = subID, color = bully_victim_group), alpha = 0.1, inherit.aes = FALSE) +
  2258. geom_smooth(method = "gam", se = TRUE, size = 1.5, alpha = 0.3) + # Increase line size for better visibility
  2259. labs(x = "Bully Victim Score", y = "Volume mm³", title = "Right Bankssts") +
  2260. coord_cartesian(ylim = c(1500, 4000)) + # Adjust the y-axis limits to zoom in on the range of interest
  2261. theme_minimal() + # Use minimal theme
  2262. theme(text = element_text(family = "Times New Roman"), # Set font family
  2263. axis.title = element_text(size = 10), # Customize axis title
  2264. axis.text = element_text(size = 8), # Customize axis text
  2265. legend.posi

LME_Model_Metrics.R at commit 376ccea, no license · at the source

Overview

Authors: Michael Connaughton1, Orla Mitchell1, Emer Cullen1, Michael O’Connor1, Tobias Banaschewski2,3, Gareth J Barker4, Arun L W Bokde5, Rüdiger Brühl6, Sylvane Desrivières7, Herta Flor8,9, Hugh Garavan10, Penny Gowland11, Antoine Grigis12, Andreas Heinz13,14, Herve Lemaitre12,15, Jean-Luc Martinot16, Marie-Laure Paillère Martinot16,17, Eric Artiges16,18, Frauke Nees2,3,19, Dimitri Papadopoulos Orfanos9
and 9 other authorsLuise Poustka20, Michael N Smolka21, Sarah Hohmann2,3, Nathalie Holz2,3, Nilakshi Vaidya22, Henrik Walter13, Gunter Schumann21,23, Robert Whelan24, Darren Roddy1
24 affiliations
  1. Department of Psychiatry, Royal College of Surgeons in Ireland, Dublin, 2 Ireland
  2. Department of Child and Adolescent Psychiatry and Psychotherapy, Central Institute of Mental Health, Medical Faculty Mannheim, Heidelberg University, Square J5, 68159 Mannheim, Germany
  3. German Center for Mental Health (DZPG), partner site Mannheim-Heidelberg-Ulm, Mannheim, Germany
  4. Department of Neuroimaging, Institute of Psychiatry, Psychology & Neuroscience, King’s College London, London, United Kingdom
  5. Discipline of Psychiatry, School of Medicine and Trinity College Institute of Neuroscience, Trinity College Dublin, Dublin, Ireland
  6. Physikalisch-Technische Bundesanstalt (PTB), Braunschweig and Berlin, Braunschweig, Germany
  7. Social, Genetic and Developmental Psychiatry Centre, Institute of Psychiatry, Psychology & Neuroscience, King’s College London, London, United Kingdom
  8. Institute of Cognitive and Clinical Neuroscience, Central Institute of Mental Health, Medical Faculty Mannheim, Heidelberg University, Square J5, Mannheim, Germany
  9. Department of Psychology, School of Social Sciences, University of Mannheim, 68131 Mannheim, Germany
  10. Departments of Psychiatry and Psychology, University of Vermont, 05405 Burlington, VT USA
  11. Sir Peter Mansfield Imaging Centre School of Physics and Astronomy, University of Nottingham, University Park, Nottingham, United Kingdom
  12. NeuroSpin, CEA, Université Paris-Saclay, F-91191 Gif-sur-Yvette, France
  13. Department of Psychiatry and Psychotherapy CCM, Charité – Universitätsmedizin Berlin, corporate member of Freie Universität Berlin, Humboldt-Universität zu Berlin, and Berlin Institute of Health, Berlin, Germany
  14. German Center for Mental Health (DZPG), Berlin-Potsdam, Mannheim, Germany
  15. Institut des Maladies Neurodégénératives, UMR 5293, CNRS, CEA, Université de Bordeaux, 33076 Bordeaux, France
  16. Institut National de la Santé et de la Recherce Médicale, INSERM U A10 “Trajectoires développementales & psychiatrie”, University Paris-Saclay, Ecole Normale Supérieure Paris-Saclay, CNRS; Centre Borelli, Gif-sur-Yvette, France
  17. AP-HP. Sorbonne Université, Department of Child and Adolescent Psychiatry, Pitié-Salpêtrière Hospital, Paris, France
  18. Psychiatry Department, EPS Barthélémy Durand, Etampes, France
  19. Institute of Medical Psychology and Medical Sociology, University Medical Center Schleswig Holstein, Kiel University, Kiel, Germany
  20. Department of Child and Adolescent Psychiatry, Center for Psychosocial Medicine, University Hospital Heidelberg, Heidelberg, Germany
  21. Department of Psychiatry and Psychotherapy, Technische Universität Dresden, Dresden, Germany
  22. Centre for Population Neuroscience and Stratified Medicine (PONS), Department of Psychiatry and Psychotherapy, Charité Universitätsmedizin Berlin, Berlin, Germany
  23. Centre for Population Neuroscience and Precision Medicine (PONS), Institute for Science and Technology of Brain-inspired Intelligence (ISTBI), Fudan University, Shanghai, China
  24. School of Psychology and Global Brain Health Institute, Trinity College Dublin, Dublin, Ireland
Journal: Translational psychiatry, volume 16, issue 1, article 256
Dates: received 16 May 2025; accepted 24 March 2026; published online 10 April 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41398-026-04010-9 · PMID 41963295 · PMCID PMC13184360 · OpenAlex W4402519664
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: structural MRI / diffusion (modality), human (organism), developmental (subfield)
Methods: Statistics, Preprocessing, fMRI & imaging
Keywords: Human behaviour, Neuroscience
MeSH: Brain*, Bullying*, Crime Victims*, Adolescent, Adult, Female, Humans, Longitudinal Studies, Magnetic Resonance Imaging, Male, Young Adult (* major topic)
Topic: Child and Adolescent Psychosocial and Emotional Development (Clinical Psychology, Psychology), according to OpenAlex
Funding: Fondation de l'Avenir pour la Recherche Médicale Appliquée (AP-RM-17-013); UK Research and Innovation (101057429, 10038599, 10041392); University of Oxford; European Regional Development Fund (NE 1383/14, NE 1383/14-1, 695313, ANR-18-NEUR00002-01-ADORe, TRR 265, 5U54EB020403-05, U54 EB020403, SFB 940, 00081242, 101057429, MR/S020306/1, 1R56AG058854-01, 16/ERCD/3797, 01GL1745B, AP-RM-17-013, 785907, R01DA049238, MR/R00465X/1, 82150710554, 01EE1406B, 01EE1406A, ANR-12-SAMA-0004, LSHMCT-2007-037286, 01EV0711, 945539, DPA20140629802); Science Foundation Ireland (01GL1745B, MR/R00465X/1, TRR 265, 101057429, 16/ERCD/3797, 945539, NE 1383/14-1, 82150710554, MR/S020306/1, ANR-12-SAMA-0004, 5U54EB020403-05, 01EV0711, DPA20140629802, 785907, 695313, SFB 940, 01EE1406A, ANR-18-NEUR00002-01-ADORe, LSHM-CT-2007-037286, AP-RM-17-013, R01DA049238, 01EE1406B, 00081242, 01GS08152, U54 EB020403, 1R56AG058854-01); Deutsche Forschungsgemeinschaft (16/ERCD/3797, ANR-12-SAMA-0004, 695313, FOR1617, AAPG2019, DPA20140629802, 178833530, LSHM-CT-2007-037286, U54 EB020403, 785907, MR/R00465X/1, 1R56AG058854-01, 01EE1406A, 01GS08152, TRR 265, 186318919, IRTG 2773, MR/S020306/1, NE1383/14-1, 00081242, 101057429, 458317126, 01GL1745B, 5U54EB020403-05, 945539, 82150710554, AP-RM-17-013, ANR-18-NEUR00002-01—ADORe, 386691645, 01EE1406B, /14-1, 402170461, 01EV0711, 454245598, R01DA049238, SFB940); Agence Nationale de la Recherche (82150710554, R01DA049238, ANR-18-NEUR00002-01-ADORe, DPA20140629802, 695313, SFB 940, 101057429, MR/S020306/1, 01GL1745B, 01EE1406A, AF12-NEUR0008-01, ANR-12-SAMA-0004, 785907, LSHM-CT-2007-037286, 01EV0711, TRR 265, ANR18, 5U54EB020403-05, AAPG2019, U54 EB020403, NE 1383/14-1, WM2NA, MR/R00465X/1, 945539, 01EE1406B, ANR-12, 16/ERCD/3797, 00081242, AP-RM-17-013); Institut National de la Santé et de la Recherche Médicale (IDEX-2012); National Natural Science Foundation of China (SFB 940, ANR-12-SAMA-0004, 82150710554, 01EE1406B, 785907, LSHM-CT-2007-037286, 00081242, 1R56AG058854-01, AP-RM-17-013, TRR 265, 01EE1406A, 16/ERCD/3797, 01GL1745B, ANR-18-NEUR00002-01-ADORe, U54 EB020403, 01EV0711, 695313, R01DA049238, DPA20140629802, MR/R00465X/1, 945539, 5U54EB020403-05, MR/S020306/1, NE 1383/14-1, 101057429); Bundesministerium für Bildung und Forschung (MR/S020306/1, 785907, 695313, 16/ERCD/3797, R01DA049238, U54 EB020403, MR/R00465X/1, 178833530, ANR-18-NEUR00002-01-ADORe, LSHM-CT-2007-037286, 402170461, SFB 940, ANR-12-SAMA-0004, 01GS08152, 01EE1406B, NE 1383/14-1, 945539, 00081242, DPA20140629802, TRR 265, 01EV0711, AERIAL 01EE1406A, 5U54EB020403-05, 01GL1745B, AP-RM-17-013, 101057429, 82150710554, 01EE1406A, 1R56AG058854-01); Fondation pour la Recherche Médicale (945539, LSHM-CT-2007-037286, 01EE1406B, 01GL1745B, 16/ERCD/3797, 101057429, DPP 20151033945, MR/R00465X/1, TRR 265, ANR-18-NEUR00002-01—ADORe, U54 EB020403, 82150710554, 1R56AG058854-01, NE 1383/14-1, 01EV0711, 695313, 00081242, SFB 940, MR/S020306/1, 01EE1406A, AP-RM-17-013, 01GS08152, ANR-12-SAMA-0004, R01DA049238, DPA20140629802, 785907, 5U54EB020403-05); Fondation de France (NE 1383/14-1, 01EE1406B, 01GS08152, SFB 940, 101057429, 695313, MR/R00465X/1, 01EE1406A, AP-RM-17-013, ANR-18-NEUR00002-01-ADORe, 82150710554, 1R56AG058854-01, TRR 265, R01DA049238, 01GL1745B, 5U54EB020403-05, LSHM-CT-2007-037286, 785907, 00081242, MR/S020306/1, 945539, ANR-12-SAMA-0004, DPA20140629802, 01EV0711, U54 EB020403, 16/ERCD/3797); Université Paris Descartes; Fédération pour la Recherche sur le Cerveau; National Institutes of Health (ANR-18-NEUR00002-01—ADORe, 00081242, MR/S020306/1, 1r56ag058854-01, 82150710554, 695313, SFB 940, AP-RM-17-013, NE 1383/14-1, 785907, 945539, TRR 265, DPA20140629802, 101057429, 01GL1745B, LSHM-CT-2007-037286, 5u54eb020403-03, 01GS08152, ANR-12-SAMA-0004, 5u54eb020403-05, 01EE1406A, 5r01da049238-05, 01EE1406B, MR/R00465X/1, 01EV0711, 16/ERCD/3797, R01DA049238, 1R56AG058854, U54‐EB020403, EB020403); HORIZON EUROPE Framework Programme (#101057429, 945539, 10041392, 785907, 10038599, 695313); Medical Research Council (01GL1745B, R01DA049238, LSHM-CT-2007-037286, 10041392, 00081242, MR/S020306/1, AP-RM-17-013, 10038599, TRR 265, 01EV0711, 01GS08152, 785907, 82150710554, DPA20140629802, 16/ERCD/3797, 101057429, 5U54EB020403-05, ANR-12-SAMA-0004, 1R56AG058854-01, 945539, SFB 940, ANR-18-NEUR00002-01-ADORe, U54 EB020403, NE 1383/14-1, 695313, 01EE1406A, 01EE1406B, MR/R00465X/1); Cilag
Citations: cited by 1 paper (Europe PMC); 89 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

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

mconnaug/Bullying_Brain_Development

License: none: the authors keep all their rights
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 376ccea89794f43793e6d195e949a31655fb5a5f, 19 August 2024
Languages: R (1)
Size: 2 files, 1 script
Software Heritage: not archived
Found in: “Code availability”
Holds: README
Not found: license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: broom (1 file), data.table (1 file), easystats (1 file), emmeans (1 file), ggplot2 (1 file), ggpubr (1 file), ggseg (1 file), lavaan (1 file), lme4 (1 file), lmerTest (1 file), nlme (1 file), patchwork (1 file), psych (1 file), rstatix (1 file), tidyverse (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
2 files

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41398-026-04010-9.

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;
  • 1 script, each with its path and the digest of its content;
  • 2 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

Datasets cited

Code and data availability statement

The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41398-026-04010-9.

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, 29 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 29 authors, 2 keywords, 11 MeSH terms, 18 funders, 74 references.

Cite

This paper

Connaughton, M., Mitchell, O., Cullen, E., O’Connor, M., Banaschewski, T., Barker, G. J., Bokde, A. L. W., Brühl, R., Desrivières, S., Flor, H., Garavan, H., Gowland, P., Grigis, A., Heinz, A., Lemaitre, H., Martinot, J.-L., Martinot, M.-L. P., Artiges, E., Nees, F., . . . Roddy, D. (2026). Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood. Translational psychiatry, 16(1), 256. https://doi.org/10.1038/s41398-026-04010-9

BibTeX

@article{connaughton2026bullying,
author = {Connaughton, Michael and Mitchell, Orla and Cullen, Emer and O’Connor, Michael and Banaschewski, Tobias and Barker, Gareth J and Bokde, Arun L W and Brühl, Rüdiger and Desrivières, Sylvane and Flor, Herta and Garavan, Hugh and Gowland, Penny and Grigis, Antoine and Heinz, Andreas and Lemaitre, Herve and Martinot, Jean-Luc and Martinot, Marie-Laure Paillère and Artiges, Eric and Nees, Frauke and Orfanos, Dimitri Papadopoulos and Poustka, Luise and Smolka, Michael N and Hohmann, Sarah and Holz, Nathalie and Vaidya, Nilakshi and Walter, Henrik and Schumann, Gunter and Whelan, Robert and Roddy, Darren},
title = {{Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood}},
journal = {Translational psychiatry},
year = {2026},
month = apr,
volume = {16},
number = {1},
pages = {256},
publisher = {Nature Publishing Group},
issn = {2158-3188},
doi = {10.1038/s41398-026-04010-9},
url = {https://doi.org/10.1038/s41398-026-04010-9},
pmid = {41963295},
pmcid = {PMC13184360}
}

RIS

TY - JOUR
AU - Connaughton, Michael
AU - Mitchell, Orla
AU - Cullen, Emer
AU - O’Connor, Michael
AU - Banaschewski, Tobias
AU - Barker, Gareth J
AU - Bokde, Arun L W
AU - Brühl, Rüdiger
AU - Desrivières, Sylvane
AU - Flor, Herta
AU - Garavan, Hugh
AU - Gowland, Penny
AU - Grigis, Antoine
AU - Heinz, Andreas
AU - Lemaitre, Herve
AU - Martinot, Jean-Luc
AU - Martinot, Marie-Laure Paillère
AU - Artiges, Eric
AU - Nees, Frauke
AU - Orfanos, Dimitri Papadopoulos
AU - Poustka, Luise
AU - Smolka, Michael N
AU - Hohmann, Sarah
AU - Holz, Nathalie
AU - Vaidya, Nilakshi
AU - Walter, Henrik
AU - Schumann, Gunter
AU - Whelan, Robert
AU - Roddy, Darren
TI - Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood
T2 - Translational psychiatry
J2 - Transl Psychiatry
PY - 2026
DA - 2026/04/10
VL - 16
IS - 1
SP - 256
SN - 2158-3188
PB - Nature Publishing Group
DO - 10.1038/s41398-026-04010-9
UR - https://doi.org/10.1038/s41398-026-04010-9
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41398-026-04010-9",
"type": "article-journal",
"title": "Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood",
"container-title": "Translational psychiatry",
"author": [
{
"family": "Connaughton",
"given": "Michael"
},
{
"family": "Mitchell",
"given": "Orla"
},
{
"family": "Cullen",
"given": "Emer"
},
{
"family": "O’Connor",
"given": "Michael"
},
{
"family": "Banaschewski",
"given": "Tobias"
},
{
"family": "Barker",
"given": "Gareth J"
},
{
"family": "Bokde",
"given": "Arun L W"
},
{
"family": "Brühl",
"given": "Rüdiger"
},
{
"family": "Desrivières",
"given": "Sylvane"
},
{
"family": "Flor",
"given": "Herta"
},
{
"family": "Garavan",
"given": "Hugh"
},
{
"family": "Gowland",
"given": "Penny"
},
{
"family": "Grigis",
"given": "Antoine"
},
{
"family": "Heinz",
"given": "Andreas"
},
{
"family": "Lemaitre",
"given": "Herve"
},
{
"family": "Martinot",
"given": "Jean-Luc"
},
{
"family": "Martinot",
"given": "Marie-Laure Paillère"
},
{
"family": "Artiges",
"given": "Eric"
},
{
"family": "Nees",
"given": "Frauke"
},
{
"family": "Orfanos",
"given": "Dimitri Papadopoulos"
},
{
"family": "Poustka",
"given": "Luise"
},
{
"family": "Smolka",
"given": "Michael N"
},
{
"family": "Hohmann",
"given": "Sarah"
},
{
"family": "Holz",
"given": "Nathalie"
},
{
"family": "Vaidya",
"given": "Nilakshi"
},
{
"family": "Walter",
"given": "Henrik"
},
{
"family": "Schumann",
"given": "Gunter"
},
{
"family": "Whelan",
"given": "Robert"
},
{
"family": "Roddy",
"given": "Darren"
}
],
"container-title-short": "Transl Psychiatry",
"volume": "16",
"issue": "1",
"page": "256",
"DOI": "10.1038/s41398-026-04010-9",
"PMID": "41963295",
"PMCID": "PMC13184360",
"ISSN": "2158-3188",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41398-026-04010-9",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
10
]
]
}
}

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.1126/sciadv.aed0772 [code]
Deep learning reveals a neurocomputational mechanism predicting depression risk in adolescents.
Journal: Science advances
In common: rstatix, ggplot2, tidyverse, developmental, 1 reference, 20 authors
[2] doi:10.1038/s41386-026-02401-6 [code]
Model-based analysis of stop-signal data reveals robust neural and clinical correlates of evidence accumulation but not inhibition.
Journal: Neuropsychopharmacology : official publication of the American College of Neuropsychopharmacology
In common: ggplot2, tidyverse, 16 authors
[3] doi:10.1038/s41398-026-04114-2 [code]
Plasma Glial Fibrillary Acidic Protein (GFAP) shows age-dependent associations with externalizing psychopathology and atypical brain connectivity.
Journal: Translational psychiatry
In common: easystats, ggpubr, ggplot2, 1 other tool, 1 reference, 5 authors
[4] doi:10.1126/sciadv.aec9291 [code]
Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.
Journal: Science advances
In common: nlme, psych, rstatix, 9 other tools
[5] doi:10.1073/pnas.2606871123 [code]
Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.
Journal: Proceedings of the National Academy of Sciences of the United States of America
In common: nlme, psych, easystats, 9 other tools
[6] 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: psych, rstatix, easystats, 8 other tools, 1 reference
[7] doi:10.1002/hbm.70605 [code]
BrainEnrich: Revealing Biological Insights for Imaging-Derived Phenotypes Through Transcriptomic Enrichment.
Journal: Human brain mapping
In common: ggseg, nlme, easystats, 7 other tools, 1 reference
[8] doi:10.1038/s41467-026-71415-x [code]
Regional BOLD variability reflects microstructural maturation and neuronal ensheathment in the preterm infant cortex.
Journal: Nature communications
In common: nlme, psych, rstatix, 7 other tools, developmental
[9] doi:10.1038/s41593-026-02363-4 [code]
Cortical thickness changes precede high levels of amyloid by at least 7 years.
Journal: Nature neuroscience
In common: ggseg, easystats, broom, 7 other tools, structural MRI / diffusion
[10] doi:10.1162/imag.a.1235 [code]
Intracranial volume: To adjust or not to adjust? It is not a matter of if, but how.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: ggseg, rstatix, broom, 6 other tools, structural MRI / diffusion, 1 reference

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

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