Transplant yes = 2 no = 0, transplant_lt_status = 2

table(final_master_listed_transplant$transplant_lt_status)
## 
##  0  2 
## 22 60

rrt_status

table(final_master_listed_transplant$rrt_status)
## 
##  0  1  2 
##  4 14  7

Death in 90 days yes = 1 no = 0, time_to_death_status_90days = 1

table(final_master_listed_transplant$time_to_death_status_90days)
## 
##  0  1 
## 65 17

rrt_status, hrs_responders_cat_2

table(final_master_listed_transplant$rrt_status,final_master_listed_transplant$hrs_responders_cat_2)
##    
##      0  1
##   0  3  1
##   1 10  4
##   2  4  3
fisher.test(table(final_master_listed_transplant$rrt_status,final_master_listed_transplant$hrs_responders_cat_2))
## 
##  Fisher's Exact Test for Count Data
## 
## data:  table(final_master_listed_transplant$rrt_status, final_master_listed_transplant$hrs_responders_cat_2)
## p-value = 0.8445
## alternative hypothesis: two.sided

(listed_transplant=1) and transplanted (transplant_lt_status = 2) new\(rrt_90days,new\)hrs_responders_cat_2

new <- final_master_listed_transplant %>% filter(listed_transplant==1 & transplant_lt_status == 2)
table(new$rrt_90days,new$hrs_responders_cat_2)
##    
##      0  1
##   0 10 25
##   1 17  8
chisq.test(table(new$rrt_90days,new$hrs_responders_cat_2))
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table(new$rrt_90days, new$hrs_responders_cat_2)
## X-squared = 7.6364, df = 1, p-value = 0.00572

transplant_lt_status vs hrs_responders_cat_2

table(final_master_listed_transplant$transplant_lt_status,final_master_listed_transplant$hrs_responders_cat_2)
##    
##      0  1
##   0  9 13
##   2 27 33
chisq.test(table(final_master_listed_transplant$transplant_lt_status,final_master_listed_transplant$hrs_responders_cat_2))
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table(final_master_listed_transplant$transplant_lt_status, final_master_listed_transplant$hrs_responders_cat_2)
## X-squared = 0.0063397, df = 1, p-value = 0.9365

transplant_lt_status = 2 transplant_slkt vs hrs_responders_cat_2

new <- final_master_listed_transplant %>% filter(transplant_lt_status == 2)
table(new$transplant_slkt,new$hrs_responders_cat_2)
##    
##      0  1
##   0 23 25
##   1  4  8
chisq.test(table(new$transplant_slkt,new$hrs_responders_cat_2))
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  table(new$transplant_slkt, new$hrs_responders_cat_2)
## X-squared = 0.34091, df = 1, p-value = 0.5593

dc_days_to_death mean and sd

mean(final_master_listed_transplant$dc_days_to_death,na.rm = T)
## [1] 74.01235
sd(final_master_listed_transplant$dc_days_to_death,na.rm = T)
## [1] 34.0872
summary(final_master_listed_transplant$dc_days_to_death)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    0.00   90.00   90.00   74.01   90.00   90.00       1

remove time_to_death_status_90days=0

final_master_listed_transplant_alive <- final_master_listed_transplant %>% filter(time_to_death_status_90days!=0)
mean(final_master_listed_transplant_alive$dc_days_to_death,na.rm = T)
## [1] 9.0625
sd(final_master_listed_transplant_alive$dc_days_to_death,na.rm = T)
## [1] 24.28297
summary(final_master_listed_transplant_alive$dc_days_to_death)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##   0.000   0.000   0.000   9.062   1.750  90.000       1

time_to_transplant_90days mean and sd

mean(final_master_listed_transplant$time_to_transplant_90days,na.rm = T)
## [1] 44.21951
sd(final_master_listed_transplant$time_to_transplant_90days,na.rm = T)
## [1] 35.76916
summary(final_master_listed_transplant$time_to_transplant_90days)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    2.00   11.25   29.00   44.22   90.00   90.00

dc_days_to_death mean and sd

mean(final_master_listed_transplant$dc_days_to_death,na.rm = T)
## [1] 74.01235
sd(final_master_listed_transplant$dc_days_to_death,na.rm = T)
## [1] 34.0872
summary(final_master_listed_transplant$dc_days_to_death)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    0.00   90.00   90.00   74.01   90.00   90.00       1

Competing risk model outcome transplant=2, death=1

table(final_master_listed_transplant$time_to_death_status_90days_cmp)
## 
##  0  1  2 
## 15 14 53

Competing risk model outcome 2 competing event 1 covariates:hrs_responders_cat_2+age+sex_male+admit_meld_3

final_master_listed_transplant$time_to_death_status_90days_cmp <- factor(final_master_listed_transplant$time_to_death_status_90days_cmp)


tidycmprsk::crr(Surv(time_to_death_90days_cmp,time_to_death_status_90days_cmp)~ hrs_responders_cat_2+age+sex_male+admit_meld_3,failcode=2,cencode=0, data = final_master_listed_transplant) %>% tbl_regression(exp = TRUE) %>% add_n()%>%
  bold_p(0.05) %>%        # bold p-values under a given threshold (default 0.05)
  bold_labels() 
Characteristic N HR1 95% CI1 p-value
hrs_responders_cat_2 82


    0

    1
0.85 0.50, 1.44 0.6
age 82 0.99 0.96, 1.02 0.6
sex_male 82


    0

    1
0.86 0.49, 1.51 0.6
admit_meld_3 82 1.02 0.99, 1.06 0.2
1 HR = Hazard Ratio, CI = Confidence Interval

logistic regression outcome:hrs_responders_cat_2 covariates:age+sex_male+admit_meld_3+map_day0+refascites_previous_comp

glm(hrs_responders_cat_2~age+sex_male+admit_meld_3+map_day0+refascites_previous_comp, data = final_master_listed_transplant, family = binomial) %>% tbl_regression(exp = TRUE,pvalue_fun = function(x) style_pvalue(x, digits = 3))
Characteristic OR1 95% CI1 p-value
age 0.99 0.94, 1.04 0.707
sex_male


    0
    1 0.76 0.27, 2.17 0.613
admit_meld_3 1.03 0.96, 1.11 0.448
map_day0 1.03 0.97, 1.09 0.331
refascites_previous_comp 2.15 0.63, 7.75 0.226
1 OR = Odds Ratio, CI = Confidence Interval