A vectorised function to calculate the BAR score to predict patient survival after liver transplantation using a composite of donor and recipient factors.
bar_score(Age, MELD, ReTx, LifeSupport, CIT, DonorAge)
numeric vector of recipient ages in years
numeric vector of MELD scores
numeric vector of whether retransplant (1 = "yes", 0 = "no")
numeric vector of whether on life support pre-transplant (1 = "yes", 0 = "no")
numeric vector of cold ischaemic time in hours
numeric vector of donor ages
numeric vector of BAR scores
Reference: Dutkowski P, Oberkofler CE, Slankamenac K, et al. Are There Better Guidelines for Allocation in Liver Transplantation? A Novel Score Targeting Justice and Utility in the Model for End-Stage Liver Disease Era. Annals of Surgery 2011; 254:745-753.
bar_score(Age = 63, MELD = 27, ReTx = 0, LifeSupport = 0, CIT = 9.5, DonorAge = 67)#>  15