--- title: "Estimated glomerular filtration rate (eGFR) calculation" author: "Boris Bikbov, [Scientific-Tools.Org](https://Scientific-Tools.Org)" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Estimated glomerular filtration rate (eGFR) calculation} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` # Estimated glomerular filtration rate (eGFR) calculation kidney.epi R package includes functions for calculation of eGFR by different equations. ## Data frames * ckd.data - contains synthetic data for 1000 adults and 1000 children (*see description in documentation*). ```{r} library(kidney.epi) head(ckd.data) ``` ## Functions to calculate eGFR by different equations kidney.epi contains a set of functions to calculate eGFR by different equations either for a single patient or for a dataset. The following eGFR equations are supported: * CKD-EPI 2021 creatinine-based: function `egfr.ckdepi.cr.2021()` and its alias `egfr.ckdepi.cr()` * CKD-EPI 2021 cystatin-based: function `egfr.ckdepi.cr_cys.2021()` * CKD-EPI 2009 creatinine-based: function `egfr.ckdepi.cr.2009()` * European Kidney Function Consortium (EKFC) creatinine-based: function `egfr.ekfc.cr()` * EKFC cystatin-based: function `egfr.ekfc.cys()` * Full age spectrum (FAS) creatinine-based: function `egfr.fas.cr()` * FAS cystatin-based: function `egfr.fas.cys()` * FAS creatinine-cystatin-based: function `egfr.fas.cr_cys()` * Revised Lund-Malmö creatinine-based: function `egfr.lm.cr()` * MDRD: function `egfr.mdrd4()` * Lund-Malmö: function `egfr.lm.cr()` * Schwartz: function `egfr.schwartz()` * Chronic Kidney Disease in Children (CKiD) U25 creatinine-based equation `egfr.ckid_u25.cr()` * CKiD U25 cystatin-based equation `egfr.ckid_u25.cys()` * more is underway. [Scientific-Tools.Org](https://Scientific-Tools.Org/) provides research and consulting services for policy makers, industry, scientists, patient organizations, and citizens. This package is developed in our free time or with [your support](https://Scientific-Tools.Org/support-us/). If you use these functions from kidney.epi package for the data analysis and manuscript preparation, please cite the package: "Bikbov B. kidney.epi: Kidney-Related Functions for Clinical and Epidemiological Research. Scientific-Tools.Org, https://Scientific-Tools.Org. doi:10.32614/CRAN.package.kidney.epi". Contact us for data analysis or software development at [Scientific-Tools.Org](https://Scientific-Tools.Org/contact/) or via 'maintainer("kidney.epi")', connect with the [author on LinkedIn](https://www.linkedin.com/in/boris-bikbov/). ## Examples The vignette demonstrates the usage of eGFR calculation by the CKD-EPI 2009 equation, but race-free CKD-EPI 2021 and other equations work in the same way. ### Example for a single patient To calculate for a single patient, use the following syntax: ```{r} # call egfr.ckdepi.cr.2009 function, and directly set parameters values egfr.ckdepi.cr.2009( creatinine = 1.4, age = 60, sex = "Male", ethnicity = "White", creatinine_units = "mg/dl", label_afroamerican = c("Afroamerican"), label_sex_male = c("Male"), label_sex_female = c("Female") ) # Definitions of the labels for sex and race are optional if you use the same labels defined as default in the function. The following also works well: egfr.ckdepi.cr.2009( creatinine = 1.4, age = 60, sex = "Male", ethnicity = "White", creatinine_units = "mg/dl" ) # If you measure creatinine in micromol/l, it is possible to omit also 'creatinine_units' since the default value is "micromol/l": egfr.ckdepi.cr.2009( creatinine = 103, # creatinine is in micromol/l age = 60, sex = "Male", ethnicity = "White" ) ``` ### Example for a cohort of patients To calculate eGFR for a cohort of patients in a dataset, use the following syntax: ```{r} # copy as an example the internal dataframe ckd.data from R package to your dataframe mydata <- ckd.data # calculate eGFR by CKD-EPI equation mydata$ckdepi <- egfr.ckdepi.cr.2009( creatinine = mydata$cr, age = mydata$age, sex = mydata$sex, ethnicity = mydata$ethnicity, creatinine_units = "micromol/L", # customize all labels for those used in the data frame if necessary label_afroamerican = c("Black"), label_sex_male = c("Male"), label_sex_female = c("Female") ) # show descriptive stat for the calculated values # note that synthetic data set ckd.data contains input parameters for both adults and children, and since the CKD-EPI equation was developed and validated for adults only, the resulting eGFR values for children will be NA. Use children-specific eGFR equations when necessary. summary(mydata$ckdepi) ``` ## Advantages of the kidney.epi package functions There are several advantages of the kidney.epi package functions for calculating eGFR values: