Reading in Data
Let’s count number of responders
| responder | n |
|---|---|
| No | 28 |
| Yes | 34 |
We see number of responders increase as BE3A score increases
| responder | BE3A.Score | n |
|---|---|---|
| No | 1 | 9 |
| Yes | 1 | 3 |
| No | 2 | 18 |
| Yes | 2 | 14 |
| No | 3 | 1 |
| Yes | 3 | 15 |
| Yes | 4 | 2 |
Let’s see summary Table of Responder vs Non-responder
We have dichotomized some value sinto categories for representation. (though it leads to partial loss of information)
| label | levels | No | Yes | p |
|---|---|---|---|---|
| Age | No | 7 (25.0) | 1 (2.9) | 0.010 |
| yes | 21 (75.0) | 33 (97.1) | ||
| Sex | Female | 13 (46.4) | 13 (38.2) | 0.515 |
| Male | 15 (53.6) | 21 (61.8) | ||
| SVR | No | 2 (7.1) | 0 (0.0) | 0.113 |
| Yes | 26 (92.9) | 34 (100.0) | ||
| Moderate | Moderate | 21 (75.0) | 28 (82.4) | 0.479 |
| Severe | 7 (25.0) | 6 (17.6) | ||
| c_encephalopathy | No | 26 (92.9) | 33 (97.1) | 0.443 |
| Yes | 2 (7.1) | 1 (2.9) | ||
| Albumin | <2.8 | 14 (50.0) | 10 (29.4) | 0.104 |
| 2.8-3.5 | 14 (50.0) | 21 (61.8) | ||
| >3.5 | 0 (0.0) | 3 (8.8) | ||
| c_ALT | <1.5xULN | 24 (85.7) | 15 (44.1) | 0.001 |
| >1.5xULN | 4 (14.3) | 19 (55.9) | ||
| Bilirubin | <2 | 12 (42.9) | 26 (76.5) | 0.006 |
| 2-3 | 11 (39.3) | 8 (23.5) | ||
| >3 | 5 (17.9) | 0 (0.0) | ||
| c_INR | <1.7 | 24 (85.7) | 33 (97.1) | 0.238 |
| 1.7-2.2 | 3 (10.7) | 1 (2.9) | ||
| >2.2 | 1 (3.6) | 0 (0.0) | ||
| GFR | <60 ml/min | 12 (42.9) | 7 (20.6) | 0.058 |
| >=60 ml/min | 16 (57.1) | 27 (79.4) | ||
| MELD | <10 | 10 (35.7) | 20 (58.8) | <0.001 |
| 10-15 | 5 (17.9) | 13 (38.2) | ||
| >15 | 13 (46.4) | 1 (2.9) | ||
| Baseline CTP grade | B | 21 (75.0) | 34 (100.0) | 0.002 |
| C | 7 (25.0) | 0 (0.0) |
Summary table of Logistic regression of Responder against Predictors
| Dependent: responder | No | Yes | OR (univariable) | OR (multivariable) | |
|---|---|---|---|---|---|
| age | Mean (SD) | 54.7 (12.6) | 50.9 (9.7) | 0.97 (0.92-1.01, p=0.190) | 0.98 (0.91-1.05, p=0.647) |
| c_sex | Female | 13 (46.4) | 13 (38.2) |
|
|
| Male | 15 (53.6) | 21 (61.8) | 1.40 (0.51-3.91, p=0.516) | 0.53 (0.10-2.45, p=0.422) | |
| Bilirubin | Mean (SD) | 2.1 (1.1) | 1.4 (0.6) | 0.41 (0.20-0.75, p=0.007) | 0.28 (0.10-0.64, p=0.006) |
| INR | Mean (SD) | 1.3 (0.3) | 1.2 (0.2) | 0.35 (0.05-1.96, p=0.244) | 0.41 (0.03-4.99, p=0.494) |
| Albumin | Mean (SD) | 2.7 (0.5) | 3.0 (0.4) | 4.84 (1.43-20.15, p=0.018) | 7.02 (1.01-82.21, p=0.076) |
| c_ascites | Moderate | 21 (75.0) | 28 (82.4) |
|
|
| Severe | 7 (25.0) | 6 (17.6) | 0.64 (0.18-2.21, p=0.481) | 0.92 (0.19-4.60, p=0.914) | |
| ALT | Mean (SD) | 44.6 (17.7) | 60.9 (40.4) | 1.02 (1.00-1.04, p=0.069) | 1.04 (1.00-1.08, p=0.074) |
| c_encephalopathy | No | 26 (92.9) | 33 (97.1) |
|
|
| Yes | 2 (7.1) | 1 (2.9) | 0.39 (0.02-4.33, p=0.457) | 0.16 (0.00-2.97, p=0.232) | |
| eGFR | Mean (SD) | 65.5 (22.2) | 75.8 (16.1) | 1.03 (1.00-1.06, p=0.045) | 1.04 (0.99-1.09, p=0.135) |
Summary table of logistic regression
| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | -3.165 | 5.545 | -0.571 | 0.568 |
| age | -0.017 | 0.037 | -0.457 | 0.647 |
| c_sexMale | -0.639 | 0.796 | -0.803 | 0.422 |
| Bilirubin | -1.262 | 0.463 | -2.723 | 0.006 |
| c_ascitesSevere | -0.086 | 0.798 | -0.108 | 0.914 |
| Albumin | 1.949 | 1.099 | 1.773 | 0.076 |
| INR | -0.889 | 1.299 | -0.684 | 0.494 |
| ALT | 0.035 | 0.020 | 1.785 | 0.074 |
| Encephalopathy | -1.858 | 1.553 | -1.196 | 0.232 |
| eGFR | 0.036 | 0.024 | 1.494 | 0.135 |
Metrics of logistic regression
| null.deviance | df.null | logLik | AIC | BIC | deviance | df.residual |
|---|---|---|---|---|---|---|
| 85.3687 | 61 | -28.98394 | 77.96787 | 99.23921 | 57.96787 | 52 |
Summary table of logistic regression with BEA Score as predictor
| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | -3.574 | 1.125 | -3.178 | 0.001 |
| BE3A.Score | 1.814 | 0.532 | 3.409 | 0.001 |
Metrics of logistic regression
| null.deviance | df.null | logLik | AIC | BIC | deviance | df.residual |
|---|---|---|---|---|---|---|
| 85.3687 | 61 | -33.70083 | 71.40166 | 75.65593 | 67.40166 | 60 |
we see AIC of BE3A score is lower hence better than our model
Plot of Odds ratios of Model
Same Model with other Descriptors
| Low | High | Diff. | Effect | S.E. | Lower 0.95 | Upper 0.95 | Type | |
|---|---|---|---|---|---|---|---|---|
| age | 45.000 | 60.0 | 15.000 | -0.2523081 | 0.5517492 | -1.3337166 | 0.8291004 | 1 |
| Odds Ratio | 45.000 | 60.0 | 15.000 | 0.7770053 | NA | 0.2634961 | 2.2912565 | 2 |
| Bilirubin | 0.825 | 2.3 | 1.475 | -1.8613865 | 0.6835431 | -3.2011063 | -0.5216666 | 1 |
| Odds Ratio | 0.825 | 2.3 | 1.475 | 0.1554569 | NA | 0.0407171 | 0.5935305 | 2 |
| Albumin | 2.525 | 3.1 | 0.575 | 1.1208063 | 0.6322232 | -0.1183284 | 2.3599411 | 1 |
| Odds Ratio | 2.525 | 3.1 | 0.575 | 3.0673265 | NA | 0.8884043 | 10.5903272 | 2 |
| INR | 1.000 | 1.4 | 0.400 | -0.3554496 | 0.5195061 | -1.3736628 | 0.6627637 | 1 |
| Odds Ratio | 1.000 | 1.4 | 0.400 | 0.7008583 | NA | 0.2531779 | 1.9401469 | 2 |
| ALT | 33.000 | 66.0 | 33.000 | 1.1648274 | 0.6525480 | -0.1141432 | 2.4437980 | 1 |
| Odds Ratio | 33.000 | 66.0 | 33.000 | 3.2053695 | NA | 0.8921302 | 11.5166980 | 2 |
| Encephalopathy | 1.000 | 2.0 | 1.000 | -1.8575944 | 1.5525921 | -4.9006190 | 1.1854301 | 1 |
| Odds Ratio | 1.000 | 2.0 | 1.000 | 0.1560476 | NA | 0.0074420 | 3.2720940 | 2 |
| eGFR | 56.575 | 82.0 | 25.425 | 0.9096777 | 0.6090764 | -0.2840902 | 2.1034456 | 1 |
| Odds Ratio | 56.575 | 82.0 | 25.425 | 2.4835219 | NA | 0.7526988 | 8.1943554 | 2 |
| c_sex - Female:Male | 2.000 | 1.0 | NA | 0.6391035 | 0.7962558 | -0.9215291 | 2.1997361 | 1 |
| Odds Ratio | 2.000 | 1.0 | NA | 1.8947814 | NA | 0.3979101 | 9.0226320 | 2 |
| c_ascites - Severe:Moderate | 1.000 | 2.0 | NA | -0.0859087 | 0.7979489 | -1.6498598 | 1.4780424 | 1 |
| Odds Ratio | 1.000 | 2.0 | NA | 0.9176780 | NA | 0.1920768 | 4.3843543 | 2 |
Relative Importance of variables
We see Bilirubin is most important predictor
Since Bilirubin is most important predctor lets do a restricted cubic spline for better model
| Low | High | Diff. | Effect | S.E. | Lower 0.95 | Upper 0.95 | Type | |
|---|---|---|---|---|---|---|---|---|
| age | 45.000 | 60.0 | 15.000 | 0.2384018 | 0.7023512 | -1.1381811 | 1.6149848 | 1 |
| Odds Ratio | 45.000 | 60.0 | 15.000 | 1.2692191 | NA | 0.3204013 | 5.0278116 | 2 |
| Bilirubin | 0.825 | 2.3 | 1.475 | -6.2078185 | 2.6859084 | -11.4721023 | -0.9435348 | 1 |
| Odds Ratio | 0.825 | 2.3 | 1.475 | 0.0020136 | NA | 0.0000104 | 0.3892495 | 2 |
| Albumin | 2.525 | 3.1 | 0.575 | -3.2443814 | 1.7943921 | -6.7613254 | 0.2725625 | 1 |
| Odds Ratio | 2.525 | 3.1 | 0.575 | 0.0389927 | NA | 0.0011577 | 1.3133255 | 2 |
| INR | 1.000 | 1.4 | 0.400 | -1.4424403 | 1.0643060 | -3.5284417 | 0.6435611 | 1 |
| Odds Ratio | 1.000 | 1.4 | 0.400 | 0.2363503 | NA | 0.0293506 | 1.9032465 | 2 |
| ALT | 33.000 | 66.0 | 33.000 | 4.9995789 | 1.8079534 | 1.4560552 | 8.5431025 | 1 |
| Odds Ratio | 33.000 | 66.0 | 33.000 | 148.3506701 | NA | 4.2890070 | 5131.2392676 | 2 |
| Encephalopathy | 1.000 | 2.0 | 1.000 | -0.8389290 | 2.2476387 | -5.2442198 | 3.5663619 | 1 |
| Odds Ratio | 1.000 | 2.0 | 1.000 | 0.4321732 | NA | 0.0052779 | 35.3876158 | 2 |
| eGFR | 56.575 | 82.0 | 25.425 | 2.8911563 | 1.6576794 | -0.3578357 | 6.1401483 | 1 |
| Odds Ratio | 56.575 | 82.0 | 25.425 | 18.0141277 | NA | 0.6991880 | 464.1224043 | 2 |
| c_sex - Female:Male | 2.000 | 1.0 | NA | 2.9010549 | 1.6003768 | -0.2356259 | 6.0377357 | 1 |
| Odds Ratio | 2.000 | 1.0 | NA | 18.1933279 | NA | 0.7900762 | 418.9433587 | 2 |
| c_ascites - Severe:Moderate | 1.000 | 2.0 | NA | 1.3044852 | 1.7178757 | -2.0624893 | 4.6714597 | 1 |
| Odds Ratio | 1.000 | 2.0 | NA | 3.6857912 | NA | 0.1271371 | 106.8536017 | 2 |
Nomogram of Model
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 9 ). Offending variable(s):
## Encephalopathy
##
## Divergence or singularity in 8 samples
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## Encephalopathy
## singular information matrix in lrm.fit (rank= 13 ). Offending variable(s):
## eGFR
##
## Divergence or singularity in 94 samples
Model Performance with no spline
## index.orig training test optimism index.corrected n
## Dxy 0.6849 0.7945 0.6025 0.1919 0.4930 142
## R2 0.4778 0.6066 0.3506 0.2560 0.2218 142
## Intercept 0.0000 0.0000 0.1280 -0.1280 0.1280 142
## Slope 1.0000 1.0000 0.4739 0.5261 0.4739 142
## Emax 0.0000 0.0000 0.1868 0.1868 0.1868 142
## D 0.4258 0.5959 0.2903 0.3055 0.1203 142
## U -0.0323 -0.0323 0.3905 -0.4228 0.3905 142
## Q 0.4581 0.6281 -0.1002 0.7283 -0.2702 142
## B 0.1557 0.1180 0.1896 -0.0716 0.2274 142
## g 2.4442 4.4585 1.7432 2.7153 -0.2711 142
## gp 0.3543 0.3944 0.2950 0.0994 0.2549 142
Model with Spline on bilirubin
## index.orig training test optimism index.corrected n
## Dxy 0.8845 0.9473 0.7788 0.1685 0.7159 56
## R2 0.7527 0.8425 0.5440 0.2985 0.4543 56
## Intercept 0.0000 0.0000 0.1414 -0.1414 0.1414 56
## Slope 1.0000 1.0000 0.2652 0.7348 0.2652 56
## Emax 0.0000 0.0000 0.2972 0.2972 0.2972 56
## D 0.8112 0.9765 0.5172 0.4593 0.3519 56
## U -0.0323 -0.0323 1.2786 -1.3109 1.2786 56
## Q 0.8434 1.0088 -0.7614 1.7702 -0.9268 56
## B 0.0925 0.0551 0.1324 -0.0773 0.1698 56
## g 13.5342 23.3875 5.7532 17.6343 -4.1001 56
## gp 0.4540 0.4698 0.3720 0.0979 0.3562 56
#marginal plot
#Univariate smoothers
#can use sjplot also
#specificity
#sensitivity
## thresholds sensitivities specificities
## 1 -Inf 1.00000000 0.0000000
## 2 1.5 0.91176471 0.3214286
## 3 2.5 0.50000000 0.9642857
## 4 3.5 0.05882353 1.0000000
## 5 Inf 0.00000000 1.0000000
AUC of BE3A
##
## Call:
## roc.data.frame(data = ., response = responder, predictor = BE3A.Score)
##
## Data: BE3A.Score in 28 controls (responder No) < 34 cases (responder Yes).
## Area under the curve: 0.771
CPT MELD TABLE PRE
| cpt | meld | n |
|---|---|---|
| High | High | 14 |
| High | Low | 48 |
CPT MELD TABLE POST
| cpt | meld | n |
|---|---|---|
| High | High | 17 |
| High | Low | 35 |
| Low | Low | 10 |
Before/After Plot