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),