dm2 <- read_excel("dm2_r.xlsx")
surf <- read_csv("freesurfer_data.csv")
merged <- merge(dm2,surf,by="RID")

codes <- unname(unlist(read_excel("aseg_codes.xlsx", col_names = FALSE)))
names <- unname(unlist(read_excel("aseg_names.xlsx", col_names = FALSE,range = cell_cols("B"))))
brains <- data.frame(codes,names)
keep <- c("RID","VISCODE.y","COLPROT.x","COLPROT.y","DX_bl","AGE","PTGENDER","APOE4","MMSE")

df <- subset(merged, select=c(keep,codes))

Overview of Data

From our hospital record data, we have 152 subjects with a diagnosis of Diabetes type 2.

When we merge these with freesurfer data, our count is reduced to 32 observations of patients for whom we have freesurfer data and have a diagnosis of DM2.



Summary Table: DM2+ hosp records only (n = 152)

Here, we look at summary statistics for the 152 records of patients documented has having diabetes.

tbl_summary(dm2[,5:9], by= DX_bl)%>% 
  add_p() %>% 
    modify_spanning_header(everything() ~ "**SUMMARY OF PT DATA BY DIAGNOSIS**") %>%
  bold_labels()
SUMMARY OF PT DATA BY DIAGNOSIS
Characteristic AD, N = 301 CN, N = 361 MCI, N = 861 p-value2
AGE 76 (70, 80) 76 (72, 78) 72 (68, 77) 0.040
PTGENDER 0.5
Female 12 (40%) 11 (31%) 25 (29%)
Male 18 (60%) 25 (69%) 61 (71%)
APOE4 <0.001
0 6 (21%) 30 (83%) 45 (53%)
1 19 (68%) 5 (14%) 33 (39%)
2 3 (11%) 1 (2.8%) 7 (8.2%)
Unknown 2 0 1
MMSE 24.00 (22.00, 25.00) 29.00 (29.00, 30.00) 28.00 (26.00, 29.00) <0.001

1 Statistics presented: median (IQR); n (%)

2 Statistical tests performed: Kruskal-Wallis test; chi-square test of independence; Fisher's exact test



Data Viz: DM2+ hosp records only (n = 152)

Here, we look at plots briefly showing the general distribution of these 152 patients



Summary Table: merged data (n = 32)

Next, the 152 pulled Diabetes patient records are joined across the available FreeSurfer data. The overlap between the two sets yielded 32 rows. This is insufficient for analysis, but I go through the steps below to establish the method.

I believe something was wrongly interpretted at one point along the way, because none of the FreeSurfer patients have been labeled “AD.” I am hoping we will look into this and resolve some issue, that will then increase the sample size to a suitable number.

tbl_summary(merged[,5:9], by= DX_bl)%>% 
  add_p() %>% 
    modify_spanning_header(everything() ~ "**SUMMARY OF MERGED PT DATA BY DIAGNOSIS**") %>%
  bold_labels()
## Warning in 'add_p()' for variable 'AGE':
##  simpleWarning in wilcox.test.default(x = c(72.6, 70.6, 70.6, 76.9, 66.5, 62.3, : cannot compute exact p-value with ties
SUMMARY OF MERGED PT DATA BY DIAGNOSIS
Characteristic CN, N = 91 MCI, N = 231 p-value2
AGE 66.8 (65.9, 70.6) 64.4 (61.9, 69.7) 0.11
PTGENDER 0.4
Female 1 (11%) 7 (30%)
Male 8 (89%) 16 (70%)
APOE4 0.3
0 8 (89%) 17 (74%)
1 0 (0%) 5 (22%)
2 1 (11%) 1 (4.3%)
MMSE 0.4
26 0 (0%) 3 (13%)
27 0 (0%) 3 (13%)
28 0 (0%) 3 (13%)
29 6 (67%) 8 (35%)
30 3 (33%) 6 (26%)

1 Statistics presented: median (IQR); n (%)

2 Statistical tests performed: Wilcoxon rank-sum test; Fisher's exact test



Data Viz: merged data (n = 32)



Brief Stats: merged data (n = 32)

m <- cor(df[,c(6,8:9)],df[,10:38])
rownames(m) <- c("$AGE","$APOE4","$MMSE")

corrplot(m,bg="midnightblue", tl.cex=2, cl.cex=2)

corrplot(m,method="number",number.cex = 1.4,tl.cex=2,cl.cex=2, bg="midnightblue")

kbl(brains) %>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"), full_width = F, font_size = 16, fixed_thead = list(enabled = T, background = "lightcoral"))
codes names
ST101SV Subcortical Volume (aseg.stats) of RightPallidum
ST112SV Subcortical Volume (aseg.stats) of RightPutamen
ST11SV Subcortical Volume (aseg.stats) of LeftAccumbensArea
ST120SV Subcortical Volume (aseg.stats) of RightThalamus
ST12SV Subcortical Volume (aseg.stats) of LeftAmygdala
ST16SV Subcortical Volume (aseg.stats) of LeftCaudate
ST17SV Subcortical Volume (aseg.stats) of LeftCerebellumCortex
ST18SV Subcortical Volume (aseg.stats) of LeftCerebellumWM
ST1SV Subcortical Volume (aseg.stats) of Brainstem
ST28SA Surface Area (aparc.stats) of LeftHemisphereWM
ST29SV Subcortical Volume (aseg.stats) of LeftHippocampus
ST42SV Subcortical Volume (aseg.stats) of LeftPallidum
ST53SV Subcortical Volume (aseg.stats) of LeftPutamen
ST61SV Subcortical Volume (aseg.stats) of LeftThalamus
ST70SV Subcortical Volume (aseg.stats) of RightAccumbensArea
ST71SV Subcortical Volume (aseg.stats) of RightAmygdala
ST75SV Subcortical Volume (aseg.stats) of RightCaudate
ST76SV Subcortical Volume (aseg.stats) of RightCerebellumCortex
ST77SV Subcortical Volume (aseg.stats) of RightCerebellumWM
ST87SA Surface Area (aparc.stats) of RightHemisphereWM
ST88SV Subcortical Volume (aseg.stats) of RightHippocampus
ST147SV Subcortical Volume (aseg.stats) of LeftCorticalGM
ST148SV Subcortical Volume (aseg.stats) of RightCorticalGM
ST149SV Subcortical Volume (aseg.stats) of CorticalGM
ST150SV Subcortical Volume (aseg.stats) of LeftCorticalWM
ST151SV Subcortical Volume (aseg.stats) of RightCorticalWM
ST152SV Subcortical Volume (aseg.stats) of CorticalWM
ST153SV Subcortical Volume (aseg.stats) of SubcorticalGM
ST154SV Subcortical Volume (aseg.stats) of TotalGM