Table 1 without transplant no missing, used for analysis

table1 <- final_cohort_1_no_missing  %>% 
  tbl_summary(
    by = group,
    # first row: mean (SD), second row: median [IQR]
    statistic = all_continuous() ~ "{mean} ({sd})",
    missing_text = "Missing"
  ) %>%add_p() 
## The following errors were returned during `add_p()`:
## ✖ For variable `HEMOSESSIONS_1year` (`group`) and "estimate", "p.value",
##   "conf.low", and "conf.high" statistics: FEXACT error 40. Out of workspace.
## ✖ For variable `HEMOSESSIONS_3year` (`group`) and "estimate", "p.value",
##   "conf.low", and "conf.high" statistics: FEXACT error 40. Out of workspace.
var1 <- names(final_cohort_1_no_missing)
var1_num <- names(final_cohort_1_no_missing)[sapply(final_cohort_1_no_missing, is.numeric)]

var1_cat <- setdiff(var1,var1_num)


#create table one for expourse response#
T1 <- CreateTableOne(vars = var1,strata ="group" ,includeNA = F,addOverall = TRUE,data = final_cohort_1_no_missing, factorVars = var1_cat)

#print table one 
T1_print <-  print(T1,showAllLevels = T,missing = T,quote = FALSE, noSpaces = TRUE, printToggle = FALSE)
#save 
write.csv(T1_print, file = "/Users/to909/Desktop/Annie final/Table1.csv")


# final_cohort_1_no_missing  %>% 
#   tbl_summary(
#     by = transplant_dec_v2,
#     # first row: mean (SD), second row: median [IQR]
#     statistic = all_continuous() ~ "{median} [{p25}, {p75}]",
#     missing_text = "Missing"
#   ) %>% add_p()

feature selection cohort without transplant

1 year

Model1 : age sex_cat

## Area under the curve: 0.6675
## Confusion Matrix and Statistics
## 
##           Reference
## Prediction alive  died
##      alive 41613  5839
##      died  18206  6659
##                                           
##                Accuracy : 0.6675          
##                  95% CI : (0.6641, 0.6709)
##     No Information Rate : 0.8272          
##     P-Value [Acc > NIR] : 1               
##                                           
##                   Kappa : 0.1642          
##                                           
##  Mcnemar's Test P-Value : <2e-16          
##                                           
##             Sensitivity : 0.53281         
##             Specificity : 0.69565         
##          Pos Pred Value : 0.26781         
##          Neg Pred Value : 0.87695         
##              Prevalence : 0.17282         
##          Detection Rate : 0.09208         
##    Detection Prevalence : 0.34383         
##       Balanced Accuracy : 0.61423         
##                                           
##        'Positive' Class : died            
## 
## 
## Call:
## NULL
## 
## Coefficients:
##              Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) -1.731571   0.008106 -213.616  < 2e-16 ***
## age          0.658348   0.005949  110.658  < 2e-16 ***
## sex_catMale  0.060672   0.010202    5.947 2.73e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 252119  on 289265  degrees of freedom
## AIC: 252125
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.93 1.91, 1.95 <0.001
sex_catMale 1.06 1.04, 1.08 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

Model2 : age sex_cat ALBUMIN

## Area under the curve: 0.7783
## 
## Call:
## NULL
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.029104   0.009102 -222.92   <2e-16 ***
## age          0.647045   0.006269  103.21   <2e-16 ***
## sex_catMale  0.181583   0.010951   16.58   <2e-16 ***
## ALBUMIN     -0.882147   0.005451 -161.85   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 221884  on 289264  degrees of freedom
## AIC: 221892
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.91 1.89, 1.93 <0.001
sex_catMale 1.20 1.17, 1.23 <0.001
ALBUMIN 0.41 0.41, 0.42 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

Model_3 : age sex_cat ALBUMIN COMO_CHF

## Area under the curve: 0.7832
## 
## Call:
## NULL
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.197386   0.010203 -215.37   <2e-16 ***
## age          0.625222   0.006317   98.97   <2e-16 ***
## sex_catMale  0.185548   0.010990   16.88   <2e-16 ***
## ALBUMIN     -0.878988   0.005474 -160.56   <2e-16 ***
## COMO_CHFY    0.449989   0.011038   40.77   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 220241  on 289263  degrees of freedom
## AIC: 220251
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.87 1.85, 1.89 <0.001
sex_catMale 1.20 1.18, 1.23 <0.001
ALBUMIN 0.42 0.41, 0.42 <0.001
COMO_CHFY 1.57 1.53, 1.60 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_4 : age sex_cat ALBUMIN COMO_CHF COMO_DM_INS

## Area under the curve: 0.7833
## 
## Call:
## NULL
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -2.165981   0.011364 -190.60  < 2e-16 ***
## age           0.618061   0.006411   96.40  < 2e-16 ***
## sex_catMale   0.183078   0.010999   16.64  < 2e-16 ***
## ALBUMIN      -0.880710   0.005482 -160.65  < 2e-16 ***
## COMO_CHFY     0.457237   0.011104   41.18  < 2e-16 ***
## COMO_DM_INSY -0.068997   0.011165   -6.18 6.43e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 220203  on 289262  degrees of freedom
## AIC: 220215
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.86 1.83, 1.88 <0.001
sex_catMale 1.20 1.18, 1.23 <0.001
ALBUMIN 0.41 0.41, 0.42 <0.001
COMO_CHFY 1.58 1.55, 1.61 <0.001
COMO_DM_INSY 0.93 0.91, 0.95 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_5 : age sex_cat ALBUMIN COMO_CHF COMO_DM_INS COMO_HTN

## Area under the curve: 0.7843
## 
## Call:
## NULL
## 
## Coefficients:
##               Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)  -1.918606   0.017960 -106.824  < 2e-16 ***
## age           0.620401   0.006419   96.654  < 2e-16 ***
## sex_catMale   0.179157   0.011008   16.275  < 2e-16 ***
## ALBUMIN      -0.876448   0.005487 -159.742  < 2e-16 ***
## COMO_CHFY     0.459456   0.011114   41.341  < 2e-16 ***
## COMO_DM_INSY -0.063166   0.011176   -5.652 1.59e-08 ***
## COMO_HTNY    -0.282824   0.016109  -17.557  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 219903  on 289261  degrees of freedom
## AIC: 219917
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.86 1.84, 1.88 <0.001
sex_catMale 1.20 1.17, 1.22 <0.001
ALBUMIN 0.42 0.41, 0.42 <0.001
COMO_CHFY 1.58 1.55, 1.62 <0.001
COMO_DM_INSY 0.94 0.92, 0.96 <0.001
COMO_HTNY 0.75 0.73, 0.78 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_6 : age sex_cat ALBUMIN COMO_CHF COMO_DM_INS COMO_HTN CLM_FROM_1year_cat

## Area under the curve: 0.8051
## 
## Call:
## NULL
## 
## Coefficients:
##                     Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)        -2.006086   0.018322 -109.491  < 2e-16 ***
## age                 0.596321   0.006494   91.833  < 2e-16 ***
## sex_catMale         0.204939   0.011168   18.351  < 2e-16 ***
## ALBUMIN            -0.812270   0.005568 -145.871  < 2e-16 ***
## COMO_CHFY           0.412920   0.011281   36.604  < 2e-16 ***
## COMO_DM_INSY       -0.074979   0.011337   -6.614 3.75e-11 ***
## COMO_HTNY          -0.266871   0.016336  -16.336  < 2e-16 ***
## CLM_FROM_1year_cat  0.464959   0.005870   79.212  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 213297  on 289260  degrees of freedom
## AIC: 213313
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.82 1.79, 1.84 <0.001
sex_catMale 1.23 1.20, 1.25 <0.001
ALBUMIN 0.44 0.44, 0.45 <0.001
COMO_CHFY 1.51 1.48, 1.55 <0.001
COMO_DM_INSY 0.93 0.91, 0.95 <0.001
COMO_HTNY 0.77 0.74, 0.79 <0.001
CLM_FROM_1year_cat 1.59 1.57, 1.61 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_ : age sex_cat ALBUMIN COMO_CHF COMO_DM_INS COMO_HTN CLM_FROM_1year_cat ICU_DAYS_1year_cat

model_7 : age ALBUMIN COMO_CHF

## Area under the curve: 0.7828
## 
## Call:
## NULL
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.089669   0.007811 -267.54   <2e-16 ***
## age          0.623609   0.006312   98.79   <2e-16 ***
## ALBUMIN     -0.873782   0.005461 -159.99   <2e-16 ***
## COMO_CHFY    0.448184   0.011028   40.64   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 220528  on 289264  degrees of freedom
## AIC: 220536
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.87 1.84, 1.89 <0.001
ALBUMIN 0.42 0.41, 0.42 <0.001
COMO_CHFY 1.57 1.53, 1.60 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_8 : age ALBUMIN COMO_CHF IRON_SAT_PERCENT

## Area under the curve: 0.7935
## 
## Call:
## NULL
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      -2.119267   0.007961 -266.19   <2e-16 ***
## age               0.645154   0.006395  100.88   <2e-16 ***
## ALBUMIN          -0.855924   0.005513 -155.25   <2e-16 ***
## COMO_CHFY         0.400243   0.011152   35.89   <2e-16 ***
## IRON_SAT_PERCENT -0.351764   0.005595  -62.87   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 216393  on 289263  degrees of freedom
## AIC: 216403
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.91 1.88, 1.93 <0.001
ALBUMIN 0.42 0.42, 0.43 <0.001
COMO_CHFY 1.49 1.46, 1.53 <0.001
IRON_SAT_PERCENT 0.70 0.70, 0.71 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_9 : age ALBUMIN COMO_CHF IRON_SAT_PERCENT HGB

## Area under the curve: 0.8001
## 
## Call:
## NULL
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      -2.146100   0.008064 -266.12   <2e-16 ***
## age               0.660500   0.006456  102.31   <2e-16 ***
## ALBUMIN          -0.756250   0.005775 -130.95   <2e-16 ***
## COMO_CHFY         0.420854   0.011253   37.40   <2e-16 ***
## IRON_SAT_PERCENT -0.296613   0.005655  -52.46   <2e-16 ***
## HGB              -0.314519   0.005760  -54.61   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 213358  on 289262  degrees of freedom
## AIC: 213370
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.94 1.91, 1.96 <0.001
ALBUMIN 0.47 0.46, 0.47 <0.001
COMO_CHFY 1.52 1.49, 1.56 <0.001
IRON_SAT_PERCENT 0.74 0.74, 0.75 <0.001
HGB 0.73 0.72, 0.74 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_8 : age ALBUMIN COMO_CHF IRON_SAT_PERCENT

## Area under the curve: 0.7935
## 
## Call:
## NULL
## 
## Coefficients:
##                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)      -2.119267   0.007961 -266.19   <2e-16 ***
## age               0.645154   0.006395  100.88   <2e-16 ***
## ALBUMIN          -0.855924   0.005513 -155.25   <2e-16 ***
## COMO_CHFY         0.400243   0.011152   35.89   <2e-16 ***
## IRON_SAT_PERCENT -0.351764   0.005595  -62.87   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 216393  on 289263  degrees of freedom
## AIC: 216403
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.91 1.88, 1.93 <0.001
ALBUMIN 0.42 0.42, 0.43 <0.001
COMO_CHFY 1.49 1.46, 1.53 <0.001
IRON_SAT_PERCENT 0.70 0.70, 0.71 <0.001
1 OR = Odds Ratio, CI = Confidence Interval

model_10 : age ALBUMIN COMO_CHF IRON_SAT_PERCENT HGB CLM_FROM_1year_cat

## Area under the curve: 0.8166
## 
## Call:
## NULL
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -2.202975   0.008353 -263.75   <2e-16 ***
## age                 0.636937   0.006513   97.79   <2e-16 ***
## ALBUMIN            -0.708801   0.005840 -121.37   <2e-16 ***
## COMO_CHFY           0.379328   0.011392   33.30   <2e-16 ***
## IRON_SAT_PERCENT   -0.278749   0.005704  -48.87   <2e-16 ***
## HGB                -0.284210   0.005794  -49.06   <2e-16 ***
## CLM_FROM_1year_cat  0.423964   0.005951   71.24   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 266319  on 289267  degrees of freedom
## Residual deviance: 208062  on 289261  degrees of freedom
## AIC: 208076
## 
## Number of Fisher Scoring iterations: 5
Characteristic OR1 95% CI1 p-value
age 1.89 1.87, 1.92 <0.001
ALBUMIN 0.49 0.49, 0.50 <0.001
COMO_CHFY 1.46 1.43, 1.49 <0.001
IRON_SAT_PERCENT 0.76 0.75, 0.77 <0.001
HGB 0.75 0.74, 0.76 <0.001
CLM_FROM_1year_cat 1.53 1.51, 1.55 <0.001
1 OR = Odds Ratio, CI = Confidence Interval