Creates a Weighted Kaplan-Meier plot - svykm.object in survey package
svyjskm(
sfit,
theme = NULL,
xlabs = "Time-to-event",
ylabs = "Survival probability",
xlims = NULL,
ylims = c(0, 1),
ystratalabs = NULL,
ystrataname = NULL,
surv.scale = c("default", "percent"),
timeby = NULL,
main = "",
pval = FALSE,
pval.size = 5,
pval.coord = c(NULL, NULL),
pval.testname = F,
legend = TRUE,
legendposition = c(0.85, 0.8),
ci = NULL,
linecols = "Set1",
dashed = FALSE,
cumhaz = F,
design = NULL,
subs = NULL,
table = F,
label.nrisk = "Numbers at risk",
size.label.nrisk = 10,
cut.landmark = NULL,
showpercent = F,
linewidth = 0.75,
nejm.infigure.ratiow = 0.6,
nejm.infigure.ratioh = 0.5,
nejm.infigure.ylim = c(0, 1),
...
)
plot
a svykm object
Theme of the plot, Default = NULL, "nejm" for NEJMOA style, "jama" for JAMA style
x-axis label, Default: 'Time-to-event'
y-axis label.
numeric: list of min and max for x-axis. Default: NULL
numeric: list of min and max for y-axis. Default: c(0, 1)
character list. A list of names for each strata. Default: NULL
The legend name. Default: 'Strata'
scale transformation of survival curves. Allowed values are "default" or "percent".
numeric: control the granularity along the time-axis; defaults to 7 time-points.
plot title, Default: ''
logical: add the pvalue to the plot?, Default: FALSE
numeric value specifying the p-value text size. Default is 5.
numeric vector, of length 2, specifying the x and y coordinates of the p-value. Default values are NULL
logical: add '(Log-rank)' text to p-value. Default = F
logical. should a legend be added to the plot? Default: TRUE
numeric. x, y position of the legend if plotted. Default: c(0.85, 0.8)
logical. Should confidence intervals be plotted. Default = NULL
Character or Character vector. Colour brewer pallettes too colour lines. Default ="Set1", "black" for black with dashed line, character vector for the customization of line colors.
logical. Should a variety of linetypes be used to identify lines. Default: FALSE
Show cumulaive incidence function, Default: F
Data design for reactive design data , Default: NULL
= NULL,
logical: Create a table graphic below the K-M plot, indicating at-risk numbers?
Numbers at risk label. Default = "Numbers at risk"
Font size of label.nrisk. Default = 10
cut-off for landmark analysis, Default = NULL
Shows the percentages on the right side.
Line witdh, Default = 0.75
Ratio of infigure width to total width, Default = 0.6
Ratio of infigure height to total height, Default = 0.5
y-axis limit of infigure, Default = c(0,1)
PARAM_DESCRIPTION
DETAILS
library(survey)
data(pbc, package = "survival")
pbc$randomized <- with(pbc, !is.na(trt) & trt > 0)
biasmodel <- glm(randomized ~ age * edema, data = pbc)
pbc$randprob <- fitted(biasmodel)
dpbc <- svydesign(id = ~1, prob = ~randprob, strata = ~edema, data = subset(pbc, randomized))
s1 <- svykm(Surv(time, status > 0) ~ sex, design = dpbc)
svyjskm(s1)
Run the code above in your browser using DataLab