View source: R/survivalScenario.R
survivalScenario | R Documentation |
Provides a plot and approximate 95 extrapolated surival time, based on a assumption of constant hazard after some specified time. Intended to be used as part of the SHELF protocol for elicitation for survival extrapolation.
survivalScenario(
tLower = 0,
tUpper,
expLower,
expUpper,
tTarget,
survDf,
groups = levels(survDf$treatment),
expGroup = levels(survDf$treatment)[1],
xl = "Time",
fontsize = 12,
showPlot = TRUE
)
tLower |
lower limit for x-axis. |
tUpper |
upper limit for x-axis. |
expLower |
start time at which constant hazard is assumed. |
expUpper |
end time for using data to estimate constant hazard; data after this time will be censored. |
tTarget |
target extrapolation time. |
survDf |
data frame with individual patient data. Require to bea .csv file with three columns: "time", "event" and "treatment" (in that order). Values in the "event" column should be 0 for a censored observation, and 1 otherwise. The"treatment" column should be included even if there is only one treatment group.' |
groups |
character vector of names of the treatment group. Extracted from survDF by default. |
expGroup |
selected treatment group for extrapolating |
xl |
x-axis label |
fontsize |
plot fontsize |
showPlot |
whether to display the plot |
A list containing the elements
KMplot |
a ggplot2 plot object; |
interval |
an approximate 95 at the target extrapolation time. |
## Not run:
sdf <- survival::veteran[, c("time", "status", "trt")]
colnames(sdf) <- c("time", "event", "treatment")
sdf$treatment <- factor(sdf$treatment, labels = c("standard", "test"))
survivalScenario(tLower = 0,tUpper = 150, expLower = 100, expUpper = 150,
tTarget = 250, survDf = sdf,
expGroup = "standard")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.