# remove.packages('brainMapR')
# devtools::install_github('baptisteCD/brainMapR')
library(brainMapR)Several brain association maps (for age at MRI) are given with the package. They are stored in the package source folder and you can find the paths using the commands below.
sumR2_regression_univariate(inputPath = system.file("extdata/BWAS_GLM_sexICVcovariates",
"", package = "brainMapR", mustWork = TRUE), bwasFile = "BWAS_Age_MRI.linear",
refPanel = c("AVERAGE", "UKB"), bwasSampleSize = "NMISS",
outputPath = "./")The function write outputs in console and in an output file (.rsq). Plot is automatically generated (unless plotSumR2 =F) and helps diagnose possible problems and build trust in the morphometricity estimates. Here, the plot for age does not show a very good linear fit between Chi2 and SumR2, which can lead to unstable estimates, and large SE.
sumR2_regression_bivariate(inputPath = c(system.file("extdata/BWAS_GLM_sexICVcovariates",
"", package = "brainMapR", mustWork = TRUE), system.file("extdata/BWAS_GLM_noCovariates",
"", package = "brainMapR", mustWork = TRUE)), bwasFile = c("BWAS_Age_MRI.linear",
"BWAS_Age_MRI.linear"), refPanel = c("AVERAGE"), outputPath = "./")A work by by [Baptiste Couvy-Duchesne] - 21 August 2026