Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cumulative number of censoring #155

Closed
kassambara opened this issue Feb 28, 2017 · 1 comment
Closed

Cumulative number of censoring #155

kassambara opened this issue Feb 28, 2017 · 1 comment

Comments

@kassambara
Copy link
Owner

@kassambara kassambara commented Feb 28, 2017

As mentioned at #154 (comment),
the current version of ggsurvplot() creates the ncensor plot, based on raw timing.

Additional arguments are needed to display the cumulative number of censored subjects as a table.

@kassambara
Copy link
Owner Author

@kassambara kassambara commented Feb 28, 2017

With ggsurvplot(), one can now display either

  • the number of censoring using ncensor.plot = TRUE
  • or the cumulative number of censoring using cumcensor = TRUE

Fit survival curves:


library(survival)
fit <- survfit( Surv(time, status) ~ sex, data = lung )

Number of censoring as barplot:


library(survminer)
ggsurvplot(fit, data = lung,
           risk.table = TRUE,
           cumevents = TRUE,
           ncensor.plot = TRUE,
           palette = "jco",
           risk.table.height = 0.2,
           cumevents.height = 0.2,
           ncensor.plot.height = 0.2
           )

rplot04

Cumulative number of censoring as table:


library(survminer)
ggsurvplot(fit, data = lung,
           risk.table = TRUE,
           cumevents = TRUE,
           cumcensor = TRUE,
           palette = "jco",
           risk.table.height = 0.2,
           cumevents.height = 0.2,
           ncensor.plot.height = 0.2
           )

rplot05

kassambara added a commit that referenced this issue Feb 28, 2017
kassambara added a commit that referenced this issue Feb 28, 2017
@kassambara kassambara closed this Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.