% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PMaddCRCL.R
\name{add_renal}
\alias{add_renal}
\title{Estimate renal function using various equations}
\usage{
add_renal(
  x,
  method,
  id = "id",
  wt = "wt",
  ht = "ht",
  male = "male",
  age = "age",
  black = "black",
  scr = "scr",
  bun = "bun",
  cysC = "cysC",
  SI = FALSE
)
}
\arguments{
\item{x}{A \link{PM_data} data object}

\item{method}{A character vector defining the method to use. Options are
\itemize{
\item "jelliffe" or "jel"
\item "cockcroft-gault" or "cg"
\item "mdrd"
\item "ckd-epi" or "ckd"
\item "schwartz"
For the fuller versions, Only the first 3 letters are required
}}

\item{id}{A character vector with the name
of the id column in \code{x}. The default is "id".}

\item{wt}{A character vector with the name of the weight
column in \code{x}.  The default is "wt". Only required for "jelliffe" and "cockcroft-gault" methods.
Values must be in \strong{kilograms}.}

\item{ht}{A character vector with the name of the height column in \code{x}.
The default is "ht". Only required for the "schwartz" method. Values must be in \strong{meters}}

\item{male}{A character vector with the name of the column defining sex in \code{x}.
Male should be 1 and female should be 0. The default is "male".}

\item{age}{A character vector with the name of the age column in \code{x}.
The default is "age". Values must be in \strong{years}.}

\item{black}{A character vector with the name of a column defining black race in \code{x}.
Male should be 1 and female should be 0. The default is "male".}

\item{scr}{A character vector with the name of the serum creatinine column in \code{x}.
Default units are \strong{mg/dL}, unless \code{SI = TRUE} below. The default name is "scr".}

\item{bun}{A character vector with the name of the blood urea nitrogen column in \code{x}.
Default units are \strong{mg/dL}, unless \code{SI = TRUE} below. Default name is "bun". Optional for the Schwartz method.}

\item{cysC}{A character vector with the name of the cystatin C column in \code{x}.
Units are always \strong{mg/L}. Default is "cysC". Optional for the Schwartz method.}

\item{SI}{Boolean value, if true, will expect serum creatinine to be in \strong{micromol/L} and BUN reported
as \strong{micromol/L} of urea.
Default is \code{FALSE}.}
}
\value{
A column added to the \code{x} data object with the name of the method used and calcuated values.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}

Adds columns to \link{PM_data} object for creatinine clearance or estimated glomerular filtration rate (eGFR).

Creatinine clearance can be estimated by:
\itemize{
\item The Jelliffe equation for paired creatinines
\item The Cockcroft-Gault equation using a single creatinine.
}

eGFR can be estimated by:
\itemize{
\item The MDRD equation
\item The CKD-EPI equation
\item The Schwartz equation for children
}
}
\details{
\strong{Note}: In all the equations below, age is in years, weight is in kilograms, height is in meters,
and cystatin C (cysC) is in mg/L. Serum creatinine (Scr) is in mg/dL and blood urea nitrogen (BUN)
is in mg/L. However, if \code{SI = TRUE}, then
serum creatinine is in micromol/L and BUN is in micromol/L of urea.

Missing covariate values are interpolated using linear interpolation within each subject.
\itemize{
\item The \strong{Jelliffe} equation depends on age, sex, weight, and serum creatinine.
It uniquely uses two serum creatinine values separated by time to estimate changing
renal function.
\itemize{
\item \eqn{ESS = wt * (29.3 - (0.203 * age))} for males
\item \eqn{ESS = wt * (25.1 - (0.175 * age))} for females
\item \eqn{scrAve = (Scr1 + Scr2) / 2}
\item \eqn{ESS_cor = ESS * (1.035 - (0.0337 * scrAve))}
\item \eqn{E = ESS_cor - 4 * wt * (Scr2 - Scr1) / (time2 - time1)}
\item \eqn{CRCL = E / (14.4 * scrAve)} in ml/min/1.73m^2
}
\item The \strong{Cockroft-Gault} equation is a point estimate of creatinine clearance. It
depends on the same variables as Jelliffe except it does not require paired creatinines.
\itemize{
\item \eqn{CRCL = ((140 - age) * weight * K)/(72 * Scr)}
\item \eqn{K} is 1 for males and 0.85 for females
}
\item The \strong{MDRD} equation estimates GFR. It depends on age, sex, black race, and serum creatinine.
\itemize{
\item \eqn{eGFR = 175 * (Scr)^{-1.154} * (age)^{-0.203}}
\item Multiply by 1.212 if black.
}
\item The \strong{CKD-EPI} equation estimates GFR. It depends on the same variables as MDRD, except \code{black} is
no longer required in the 2021 version used here.
\itemize{
\item \eqn{eGFR = 141 * min(Scr/k, 1)^a * max(Scr/k, 1)^{-1.209} * 0.993^{age}}
\item Multiply by 1.1018 if female.
}
\item The \strong{Schwartz} equation estimates GFR in children. The equation used depends on which covariates
are included in the data.
\itemize{
\item height and serum creatinine: \eqn{eGFR = 41.3 * height/scr} (updated Schwartz equation)
\item height, serum creatinine, and cystatin C: \eqn{eGFR = 41.6 * (height/scr)^{0.599} * (1.8/cysC)^{0.317}} (Equation 1a)
\item height, serum creatinine, and BUN: \eqn{eGFR = 40.7 * (height/scr)^{0.640} * (30/BUN)^{0.202}} (Equation 1b)
\item height, serum creatinine, cystatin C, and BUN: \eqn{eGFR = 41.1 * (height/scr)^{0.510} * (1.8/cysC)^{0.272} * (30/BUN)^{0.171}} (Equation II)
\item height, serum creatinine, cystatin C, BUN, and male: \eqn{eGFR = 39.1 * (height/scr)^{0.516} * (1.8/cysC)^{0.294} * (30/BUN)^{0.169} * 1.099^{male} * (height/1.4)^{1.88}} (Equation III)
}
}

Discussion of the strengths and weaknesses of these equations are beyond the scope of this documentation.
}
\author{
Michael Neely
}
