Open siyunyang opened 3 years ago
install.packages("devtools")
devtools::install_github('ningyile/survminer')
https://github.com/ningyile/survminer
In theutilities.R
, the cum.n.event
and cum.n.censor
was not rounded like other functions(such as n.risk, n.event, etc.). So I just fix the issue of [ggsurvplot cumevents decimal places / digits when using weights](https://github.com/kassambara/survminer/issues/554) by round the cumulative number of event( namely cum.n.event
) and censoring( namely cum.n.censor
) in weighted survival estimates(such as inverse-probability weight, IPW).
@siyunyang
For now, you can manually edit the table by editing the ggsurvplot object.
ggsurv <- ggsurvplot(fit, data) ggsurv$cumevents$layers[[1]]$data$cum.n.event <-round(ggsurv$cumevents$layers[[1]]$data$cum.n.event)
I found a similar problem to this post. The digits = 0 option only round the number at risk, but not the cumulative number of events.
Thank you or pointing this out.
Now, the default behaviour of
ggsurvplot()
is to round the number at risk using the optiondigits = 0
Originally posted by @kassambara in https://github.com/kassambara/survminer/issues/214#issuecomment-301418865