Positioning in the risk table in the negative section of the y-axis for the survival curve (RMS package)

I am making a glitch plot and would like the risk table to be displayed above the x-axis line but below the y = 0 point. This is because for this graph most of the data is near the bottom, so it overlaps too much (now I put the table top of the graph). The following will fit the curve in that white area - specifically the ylim and ynrisk options (the latter sets the bottom position of the risk table). However, I don't want the y-axis to display a label for -0.2, because obviously that doesn't make sense for survival. Is there a way to hide this value?

survplot(cm1b_surv, fun=function(y)(1-y), lty=c(1,2,3),xlim=c(0,30),ylim=c(-0.2,0.8),time.inc=5,
     conf='none', n.risk=TRUE, adj.n.risk=0.5, cex.n.risk=0.65, levels.only=TRUE, y.n.risk=-0.2,
     xlab='Time from Donation to Event (Years)',
     ylab='Probability of Diagnosis')

      

Funnily enough, SAS (which is what my experience for 12 years) allows you to do this, and I would like the plot to emulate this particular aspect. See Figure 8 in this document:

https://support.sas.com/resources/papers/proceedings13/427-2013.pdf

edit: Here's a reproducible example. Sorry, but I haven't figured out all the formatting tricks yet. This code generates a sampled cumulative probability curve with the risk table in the negative y-axis. I would like to hide the value -0.2 and the checkmark, if possible, along the y-axis.

library(rms)
library(survival) 
yrs_sample<-c(1:100) 
Prob <- c(0.9, 0.3, 0.6, 0.8, 0.23, 0.45, 0.1, 0.3, 0.5, 0.03) 
niter<- 100 
randomSample<-rbinom(niter,1,prob=rep(Prob,niter)) 
surv_sample<-data.frame(yrs_sample,randomSample) 

sample_surv<-npsurv(Surv(yrs_sample,randomSample)~1,data=sur‌​v_sample) 

survplot(sample_surv, fun=function(y)(1-y),lty=c(1,2,3),xlim=c(0,30),ylim=c(-0.2,0.8),time.inc=5, conf='none', n.risk=TRUE, adj.n.risk=0.5, cex.n.risk=0.65, levels.only=TRUE, y.n.risk=-0.2)

      

Thank!

Scott

+3


source to share





All Articles