11.2 HDL

UK Biobank measurements range from 0.219 to 4.401 mmol/L. We filter the allowable range to be under 10, but not 0.

HDL <- gp_clinical %>%
  filter(grepl(HDL_codes, code)) %>% 
  mutate(HDL = coalesce(as.numeric(value1), as.numeric(value2), as.numeric(value3))) %>%
  filter(HDL > 0 & HDL < 10) %>%
  filter(!(value3 %in% c("09", "MEA082", "MEA095", "MEA099", "MEA104", "MEA151", 
                         "mmol", "mOsm/kg", "mg/mmol")))

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

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