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

Facet survival curves into multiple panels #205

Closed
kassambara opened this Issue Apr 28, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@kassambara
Copy link
Owner

kassambara commented Apr 28, 2017

No description provided.

@kassambara

This comment has been minimized.

Copy link
Owner Author

kassambara commented Apr 28, 2017

New option facet.by added now in ggsurvplot() to draw multi-panel survival curves of a data set grouped by one or two variables. Alias of the ggsurvplot_facet() function.

Load required packages

library(survival)
library(survminer)

Compute survival curves

fit1 <- survfit( Surv(time, status) ~ sex, data = colon )

fit2 <- survfit( Surv(time, status) ~ sex + rx, data = colon )

Facet by one grouping variables

Facet by the treatment assignment rx

# Faceting fit 1
ggsurvplot(fit1, colon, facet.by = "rx", 
              palette = "jco", pval = TRUE)

rplot11

# Faceting fit 2
ggsurvplot(fit2, colon, facet.by = "adhere", 
           palette = "jco", pval = TRUE)

rplot16

Facet by two grouping variables

ggsurvplot(fit1, colon, facet.by = c("rx", "adhere"),
           palette = "jco", pval = TRUE)

rplot17

@jiajiaybyb

This comment has been minimized.

Copy link

jiajiaybyb commented Jan 14, 2019

I realized ggsurvplot_facet does not plot the survival lines all the way to 100%, is there a solution for this? Ideally I would like to have facet panels, with corresponding p values and survival tables in the output. Any recommend method for this? Thanks a lot!

@Yatros

This comment has been minimized.

Copy link

Yatros commented Apr 11, 2019

Hello,

Is it possible to add capability to ggsurvplot_facet() so that it accepts as input not only survfit objects, but also a list of survfit objects?

ggsurvplot() accepts already survfit lists.

Thank you very much,

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.