View source: R/ggplot.npsurv.r
ggplot.npsurv | R Documentation |
Title Plot npsurv Nonparametric Survival Curves Using ggplot2
## S3 method for class 'npsurv'
ggplot(
data,
mapping,
conf = c("bands", "none"),
trans = c("identity", "logit", "probit", "loglog"),
logt = FALSE,
curtail = c(0, 1),
xlab,
ylab = "Survival Probability",
abbrev.label = FALSE,
levels.only = TRUE,
alpha = 0.15,
facet = FALSE,
npretty = 10,
onlydata = FALSE,
...,
environment
)
data |
the result of npsurv |
mapping |
unused |
conf |
set to |
trans |
the name of a transformation for the survival probabilities to use in drawing the y-axis scale. The default is no transformation, and other choices are |
logt |
set to |
curtail |
set to a (lower, upper) 2-vector to curtail survival probabilities and confidence limits before transforming and plotting |
xlab |
x-axis label, the default coming from |
ylab |
y-axis label, the default coming from |
abbrev.label |
set to |
levels.only |
set to |
alpha |
transparency for confidence bands |
facet |
when strata are present, set to |
npretty |
the number of major tick mark labels to be constructed by |
onlydata |
set to |
... |
ignored |
environment |
unused |
a ggplot2
object, if onlydata=FALSE
Frank Harrell
set.seed(1)
g <- c(rep('a', 500), rep('b', 500))
y <- exp(-1 + 2 * (g == 'b') + rlogis(1000) / 3)
f <- npsurv(Surv(y) ~ g)
ggplot(f, trans='logit', logt=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.