79443525

Date: 2025-02-16 16:33:46
Score: 1
Natty:
Report link

I substantively use the AnthonyC solution by means of a small function that prunes the stratified terms from the model:

library(survival)
library(survminer)

  colon <- within(colon, {
  sex <- factor(sex, labels = c("female", "male"))
  differ <- factor(differ, labels = c("well", "moderate", "poor"))
  extent <- factor(extent, labels = c("submuc.", "muscle", "serosa", "contig."))})


stratamodel <- coxph(Surv(time, status) ~ sex + strata(rx) + adhere + 
differ + extent + node4,
                 data = colon )

prun<-function(model) {
    if (any(grepl("strata", names(attr(model$terms, "dataClasses"))))) {attr(model$terms, "dataClasses")<-attr(model$terms, "dataClasses")[-which(grepl("strata", names(attr(model$terms, "dataClasses"))))]}
    model
    }

windows(8,8);ggforest(prun(stratamodel), data=colon, main="Stratified model")

enter image description here

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: pdeninis