From f227e4bfc3195513d87acb89b356662762c71f58 Mon Sep 17 00:00:00 2001 From: drlyntaylor Date: Wed, 4 Mar 2026 17:10:24 +0000 Subject: [PATCH] Added note: per issue 514 Survival strata usage may cause some issues #514 --- R/survival.qmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/survival.qmd b/R/survival.qmd index 4ff7fdee2..b62fe4660 100644 --- a/R/survival.qmd +++ b/R/survival.qmd @@ -129,6 +129,8 @@ survminer::surv_pvalue(fit.km.str, data = dat) ### Stratified Cox PH model +NOTE: if using {survival} package version 3.8.0 the below code works correctly (specifically with using survival::strata), however see [news](https://cran.r-project.org/web/packages/survival/news.html), changes were made to version 3.7-3 and 3.8.0 to ensure survival::strata() works the same as strata(). If using a {survival} package version prior to 3.8.0 **NEVER** use survival::strata() (instead use just strata(), otherwise the stratification variable isn't fitted as you expect. You can see this as it appears as a covariate in the output with hazard ratio estimated. Whereas, when fitted as a strata, it should not. + ```{r} fit.cox.str <- survival::coxph( survival::Surv(LENFOLY, FSTAT) ~ AFB + survival::strata(GENDER),