From 838281ac01a940348abee348567bb268e97c76d3 Mon Sep 17 00:00:00 2001 From: Louis Chih-Ming Lee Date: Wed, 20 May 2026 18:03:39 +0200 Subject: [PATCH] update --- slides.Rmd | 59 +++++++++++++++++++++-- slides.html | 131 ++++++++++++++++++++++++++++------------------------ 2 files changed, 126 insertions(+), 64 deletions(-) diff --git a/slides.Rmd b/slides.Rmd index 75017a5..0bd31f6 100644 --- a/slides.Rmd +++ b/slides.Rmd @@ -590,7 +590,7 @@ test.new.var(old.vars, "year", 5) `year` has the smallest $p$-value -## `tx.type` + `age.rec` + `hla.match` + `age.donor` + `year` +## `tx.type` + `age.rec` + `hla.match` + `age.donor` + `year` + ? ```{r, echo=TRUE} old.vars <- c("tx.type", "age.rec", "hla.match", "age.donor", "year") @@ -613,7 +613,7 @@ cox.full <- coxph(surv.full, data = dat, method = "breslow") cox.full ``` -```{r, fig.width=7, fig.height=5} +```{r, fig.width=6, fig.height=6} tidy(cox.full, exponentiate = TRUE, conf.int = TRUE) |> mutate( term = recode( @@ -635,7 +635,7 @@ tidy(cox.full, exponentiate = TRUE, conf.int = TRUE) |> geom_point(size = 2) + labs( title = "Hazard Ratios from Full Cox Model", - x = "Hazard Ratio", + x = "Log Hazard Ratio", y = NULL ) + my.theme @@ -696,6 +696,59 @@ tidy(cox.full.1, exponentiate = TRUE, conf.int = TRUE) |> ``` +```{r, fig.width=6, fig.height=6} +hr.full <- tidy(cox.full, exponentiate = TRUE, conf.int = TRUE) +hr.full.1 <- tidy(cox.full.1, exponentiate = TRUE, conf.int = TRUE) +hr.compare <- bind_rows( + hr.full |> + mutate(model = "Full model with year"), + hr.full.1 |> + mutate(model = "Model without year") +) |> + mutate( + term = recode( + term, + "tx.typeLiving" = "Living donor", + "age.rec" = "Recipient age", + "hla.match" = "HLA match", + "age.donor" = "Donor age", + "year" = "Transplant year" + ), + term = factor( + term, + levels = c( + "Transplant year", + "Living donor", + "Recipient age", + "Donor age", + "HLA match" + ) + ) + ) +ggplot(hr.compare, aes(x = estimate, y = term, color = model)) + + geom_vline(xintercept = 1, linetype = "dashed") + + geom_errorbarh( + aes(xmin = conf.low, xmax = conf.high), + height = 0.2, + position = position_dodge(width = 0.6) + ) + + geom_point( + size = 2.5, + position = position_dodge(width = 0.6) + ) + + scale_x_log10() + + labs( + title = "Hazard Ratios from Cox Models", + x = "Log Hazard Ratio", + y = NULL, + color = NULL + ) + + my.theme +``` + + + + diff --git a/slides.html b/slides.html index 1cc2c98..b374ce6 100644 --- a/slides.html +++ b/slides.html @@ -2637,7 +2637,7 @@ n= 9433, number of events= 449

year has the smallest \(p\)-value

-

12.6 tx.type + age.rec + hla.match + age.donor + year

+

12.6 tx.type + age.rec + hla.match + age.donor + year + ?

old.vars <- c("tx.type", "age.rec", "hla.match", "age.donor", "year")
 
@@ -2711,7 +2711,7 @@ n= 9433, number of events= 9433
 
-

+

@@ -2766,6 +2766,15 @@ n= 9433, number of events= 9433
+
+
+
+
+

+
+
+
+

TODO: write a more generic function (UPDATE: FAILED)

@@ -2798,7 +2807,7 @@ n= 9433, number of events= 9433
-

+

@@ -2807,7 +2816,7 @@ n= 9433, number of events= 9433
-

+

@@ -2896,42 +2905,42 @@ GLOBAL 52.00 5 5.4e-10
-

+

-

+

-

+

-

+

-

+

-

+

@@ -2952,7 +2961,7 @@ GLOBAL 52.00 5 5.4e-10
-

+

@@ -2961,7 +2970,7 @@ GLOBAL 52.00 5 5.4e-10
-

+

@@ -3009,16 +3018,7 @@ Note
-

-
-
-
- -
-
-
-
-

+

@@ -3036,7 +3036,7 @@ Note
-

+

@@ -3050,6 +3050,15 @@ Note
+
+
+
+
+

+
+
+
+
@@ -3080,15 +3089,6 @@ Note
-

-
-
-
-
-
-
-
-

@@ -3121,6 +3121,15 @@ Note
+
+
+
+
+

+
+
+
+

14.4.4 Cold Ischemia Time cold.isc

@@ -3138,15 +3147,6 @@ Note
-

-
-
-
- -
-
-
-

@@ -3161,6 +3161,15 @@ Note
+
+
+
+
+

+
+
+
+

14.4.5 Transplant Type tx.type

@@ -3183,7 +3192,7 @@ Cadaveric Living
-

+

@@ -3202,15 +3211,6 @@ Cadaveric Living
-

-
-
-
- -
-
-
-

@@ -3243,6 +3243,15 @@ Cadaveric Living
+
+
+
+
+

+
+
+
+
@@ -3263,7 +3272,7 @@ Cadaveric Living
-

+

@@ -3275,7 +3284,7 @@ Cadaveric Living
-

+

@@ -3290,7 +3299,7 @@ Cadaveric Living
-

+

@@ -3900,7 +3909,7 @@ Score (logrank) test = 54.76 on 3 df, p=8e-12
-

+

@@ -4408,7 +4417,7 @@ Score (logrank) test = 54.76 on 3 df, p=8e-12
-

+

@@ -4916,14 +4925,14 @@ Score (logrank) test = 54.76 on 3 df, p=8e-12
-

+

-

+

@@ -5431,14 +5440,14 @@ Score (logrank) test = 54.76 on 3 df, p=8e-12
-

+

-

+

@@ -5449,7 +5458,7 @@ Score (logrank) test = 54.76 on 3 df, p=8e-12
-

+