11.5 Fasting Glucose

UK Biobank measurements for glucose range from 0.995 to 36.813 mmol/L. We filter the allowable range of fasting glucose to be under 60, but not 0.

fastgluc <- gp_clinical %>%
  filter(grepl(fastgluc_codes, code)) %>%
  mutate(fastgluc = coalesce(as.numeric(value1), as.numeric(value2), as.numeric(value3))) %>%
  filter(fastgluc > 0 & fastgluc < 60) %>%
  filter(value3 %in% c("", "MEA000", "MEA061", "MEA096", "MEA194", "Mmol/L", 
                       "Unknown", "mmol/L", "mmol/l", "mU/l", "units"))

fastgluc %>% group_by(code, term_description) %>% 
  summarize(n=n(), mean = mean(fastgluc, na.rm=T)) %>% 
  arrange(desc(n)) %>% kable()

ggplot(data=fastgluc, aes(x=log10(fastgluc))) + geom_density() + theme_minimal()