Skip to contents

Calculate Estimated Glomerular Filtration Rate

Usage

egfr(
  sexf,
  raceb,
  age,
  creat,
  ...,
  cystc = NULL,
  height = NULL,
  method = "CKDEPI 2021"
)

Arguments

sexf

a boolean representing if the patient is female.

raceb

a boolean representing if the patient is black.

age

the age of a patient in years.

creat

the serum creatinine levels in mg/dL.

...

reserved; must be empty. Arguments after creat must be named.

cystc

the cystatin C levels in mg/L - required for the "CKDEPI 2021 cystatin" method.

height

the height of a patient in cm - required for the "Schwartz" method.

method

equation to use, one of: egfr(method = "CKDEPI 2009"), egfr(method = "MDRD"), egfr(method = "CKDEPI 2021"), egfr(method = "CKDEPI 2021 cystatin"), egfr(method = "Schwartz").

Value

the eGFR calculated based on method.

Examples

e <- egfr(TRUE, TRUE, 24, 1, method = "CKDEPI 2009")

df <- data.frame(
  "SEXF" = c(TRUE, FALSE, TRUE, FALSE),
  "RACEB" = c(FALSE, FALSE, TRUE, FALSE),
  "AGE" = c(24, 24, 23, 24),
  "CREAT" = c(1, 1, 2, 1)
)
df <- dplyr::mutate(df, egfr = egfr(SEXF, RACEB, AGE, CREAT, method = "CKDEPI 2009"))
df
#>    SEXF RACEB AGE CREAT      egfr
#> 1  TRUE FALSE  24     1  78.79023
#> 2 FALSE FALSE  24     1 104.87700
#> 3  TRUE  TRUE  23     2  39.77968
#> 4 FALSE FALSE  24     1 104.87700