Kidney transplantation

Boris Bikbov

2018-09-06

Kidney transplantation

kidney.epi R package includes functions which useful for kidney transplantation, and a sample dataframe.

See also: [kidneyepidemiology.org web site] id

Dataframes

Functions

Calculate KDPI and KDRI with ktx.kdpi.optn

Function ktx.kdpi.optn calculates Kidney Donor Risk Index (KDRI) and Kidney Donor Profile Index (KDPI) based on the algorithm of US Organ Procurement and Transplantation Network.

In case you use this function and kidney.epi package for preparation of a manuscript, please use the following citation: “Bikbov B. R open source programming code for calculation of the Kidney Donor Profile Index and Kidney Donor Risk Index. Kidney Disease. 2018”.

You can use ktx.kdpi.optn either for calculation of KDPI and KDRI for a single patient, or for a dataset.

To calculate for a single patient, use the following syntax:

To calculate for a multiply patients in a dataset, use the following syntax:

# copy internal dataframe ktx from R package to your dataframe
mydata <- ktx

# calculate Kidney Donor Profile Index (KDPI) using the latest available OPTN mapping values
mydata$kdpi <- ktx.kdpi.optn ( age = mydata$don.age,
  height_cm = mydata$don.height, weight_kg = mydata$don.weight,
  ethnicity = mydata$don.ethnicity, hypertension = mydata$don.hypertension,
  diabetes = mydata$don.diabetes, causeofdeath = mydata$don.causeofdeath,
  creatinine = mydata$don.creatinine, hcv = mydata$don.hcv,
  dcdstatus = mydata$don.dcd, creatinineunits = "mg/dl",
  # which param to return
  return_output_type = "KDPI",
  # customize all labels used in the dataframe
  # label for Afroamerican ethnicity 
  label_afroamerican = c ("Afroamerican"),
  # label for a positive history of hypertension
  label_hypertension_positive = c ("Yes", "YES"),
  # label for an unknown history of hypertension
  label_hypertension_unknown = "N/A", # if missing values defined unknown history then use "NA" (with quotes!)
  # label for a positive history of diabetes
  label_diabetes_positive = c ("Yes", "YES"),
  # label for an unknown history of diabetes
  label_diabetes_unknown = "N/A", # if missing values defined unknown history then use "NA" (with quotes!)
  # label for a cause of death due to cerebrovascular/stroke
  label_causeofdeath = c ("cerebrovascular"),
  # label for a positive hcv status
  label_hcv_positive = c ("positive"),
  # label for an unknown, not done, indeterminate, or pending hcv status
  label_hcv_unknown = "NA", # if missing values defined unknown history then use "NA" (with quotes!)
  # label for a donation after circulatory death status
  label_dcdstatus = c ("Yes")
) 
#> For the calculations of KDRI and KDPI the  2017  year is used for mapping values, KDRI scaling factor, as well as chances of hypertension and diabetes in case if they were unknown for donor.

# show descriptive stat for the calculated values
summary(mydata$kdpi)
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>   44.00   94.25   96.50   90.70   97.75  100.00

Take in account that the labels paramenters of the function have to correspond to the labels used in your data frame. In the example above labels for a positive history of hypertension are defined as label_hypertension_positive = c (“Yes”, “YES”) that means in the data frame it could be either “Yes” or “YES”. In case you use different labelling in your data frame, define this appropriatelly. For example, if you define a positive history of hypertension as 1 and negative history as 0, you have to change the labeling in parementers of the function to label_hypertension_positive = c (1).

Important notice on NA (not available values)
Be careful with labeling of missing/unknown data for a history of hypertension and diabetes.
If donors with an unknown history of hypertension in your data file has a standard R missing value NA, set the variable label_hypertension_unknown = “NA” (with quotes!).
If donors with an unknown history of hypertension in your data file defined as “no data”, set the variable label_hypertension_unknown = “no data”.
If donors with an unknown history of hypertension in your data file defined as 999, set the variable label_hypertension_unknown = 999.

Note that by default KDPI and KDRI are calculated by the latest available OPTN revision (the paramenter by default is mapping_values_year = “latest”). If you wish to change the reference year, set the mapping_values_year equal to the year. To know for which years the OPTN revision is presented in the R package, use function ktx.kdpi.optn.show.years().

Show years available in the OPTN mapping table with ktx.kdpi.optn.show.years

Shows which years are available in the R package for the OPTN mapping table, KDRI scaling factor, etc. These years could be defined in the mapping_values_year parameter of the ktx.kdpi.optn function.

References

Rao PS, Schaubel DE, Guidinger MK, Andreoni KA. A Comprehensive Risk Quantification Score for Deceased Donor Kidneys: The Kidney Donor Risk Index. Transplantation 2009; 88: 231–6.

Guide to calculating and interpreting KDPI could be found at https://optn.transplant.hrsa.gov/media/1512/guide_to_calculating_interpreting_kdpi.pdf

Bikbov B. R open source programming code for calculation of the Kidney Donor Profile Index and Kidney Donor Risk Index. Kidney Disease. 2018