0

First time poster so I hope I've enough information here.

I'm trying to show my survival curves in 4 categories. The analysis is stratified according to my 4 categories in survival tables, but the survival plots do not depict these 4 categories and instead show many different survival curves. What am I doing wrong here?

Survival curve

# categorise ADAMTS13 levels
TMAdata$ADAMTS13level.f<-cut(TMAdata$ADAMTS13level, 
                            breaks=c(0.0,10.0,40.0, 60.0,160.0),
                             labels=c('0-10.0',
                                      '10.1-40.0',
                                      '40.1-60.0',
                                      '60.1-160.0'))
summary(TMAdata$ADAMTS13level.f)

# use 10-40% ADAMTS13 level as reference point
TMAdata$ADAMTS13level.f = relevel(TMAdata$ADAMTS13level.f, ref="10.1-40.0")

# platelet recovery according to ADAMTS13 level (reference point is 10.1-40.0)

    pltrecovery_ADAMTS13_table <- survfit(Surv(TMAdata$Daysplateletrecovery, TMAdata$Recoveredplatelets)~TMAdata$ADAMTS13level.f)
    summary(pltrecovery_ADAMTS13_table)

    plot(pltrecovery_ADAMTS13_table, conf.int=0, 
     xlab = "Days", 
     ylab = "Probability of not achieving platelet count =>150")
     legend("topright", inset=0.03,
            c("0-10.0",
              "10.1-40.0",
              "40.1-60.0",
              "60.1-160.0"),
            lty=1:2,
            lwd=2,
            cex=1)
Jobolo
  • 79
  • 6
  • `object 'TMAdata' not found` – IRTFM Oct 30 '21 at 23:40
  • Apologies, the data is private and confidential – Jobolo Oct 31 '21 at 05:00
  • It will be helpful if you include some example data, or if the data is absolutely confidential, a mockup data that can help other people run your code. As it stands, your provided code is not [MRE](https://stackoverflow.com/help/minimal-reproducible-example) (minimal, **reproducible** example) because potential answerers can't copy your code and run it in their machine and see what's what. – Nuclear03020704 Oct 31 '21 at 09:06
  • Yup got it. Thanks for that, will do that next time. It so happens that IRTFM managed to answer my question, and I've resolved the issues with the legends too. – Jobolo Oct 31 '21 at 12:23

1 Answers1

0

The extra lines are confidence boundaries. Specifying conf.int=0 does not suppress confidence interval plotting. That's arguably incorrect with it's easy to demonstrate using the first example in ?survfit.formula. If you don't want the confidence boundaries, then leave out the conf.int parameter all-together.

The legend will only have two types of lines and they probably won't match the types of the survival plotted.

IRTFM
  • 258,963
  • 21
  • 364
  • 487