11.10 Blood/Serum creatinine
This is needed to calculate eGFR. UK Biobank measures lie between 10.7 and 1499.3. We filter the allowable range to lie between 10 and 1500.
<- gp_clinical %>%
blood_creatinine filter(grepl(blood_creatinine_codes, code)) %>%
mutate(blood_creatinine = coalesce(as.numeric(value1), as.numeric(value2))) %>%
filter(blood_creatinine > 10 & blood_creatinine < 1500) %>%
filter(!(value3 %in%
c("m1/min", "MEA082", "MEA083", "MEA095", "MEA096", "mg/mmol",
"ml/min", "mmol", "mmol/l", "mmol/L", "nmol/l", "pmol/l",
"uL/cu mm", "um", "umo", "umol"))) %>%
mutate(creatinine_type = ifelse(grepl("serum", term_description, ignore.case=T), "Serum",
ifelse(grepl("plasma", term_description, ignore.case=T), "Plasma",
"Unspecified")))
%>% group_by(code, term_description) %>%
blood_creatinine summarize(n=n(), mean=mean(blood_creatinine)) %>%
arrange(desc(n)) %>% kable()
ggplot(data=blood_creatinine, aes(x=blood_creatinine, color=creatinine_type)) +
geom_density() + theme_minimal()