plot.qris | R Documentation |
Draw 95% confidence interval by a quantile regression estimator of residual lifetime from survival data
## S3 method for class 'qris'
plot(
x,
t0s = NULL,
Qs = NULL,
nB = NULL,
vari = NULL,
byQs = FALSE,
ggextra = NULL,
...
)
x |
is an " |
t0s |
is a vector of range of |
Qs |
is a vector of range of |
nB |
is the number of multiplier bootstrapping for standard error estimation. |
vari |
is a character string to choose variables to draw the regression coefficient. |
byQs |
put |
ggextra |
is a list that contains additional components to apply to the |
... |
for future extension |
A list contains ggplot
object and the information to generate it.
data(cancer, package = "survival")
lung2 <- subset(lung, select = c(time, status, age, sex))
## tidy up the data
lung2$status <- lung2$status - 1
lung2$sex <- lung2$sex - 1
library(qris)
fm <- Surv(time, status) ~ age + sex
fit <- qris(fm, data = lung2, t0 = 30, Q = 0.5, nB = 50, "nonsmooth", "fmb")
## Plot with default values; Qs <- 1:9 / 10 and t0s = fit2$para$t0 (in this case 30)
plot(fit)
## Plot with without 95% CI is much faster
plot(fit, nB = 0)
## Plot feature can update qris calls
fit <- plot(fit, Qs = 3:6 / 10, t0s = 1:6 * 10)
## Faster after updating the qris call
plot(fit, byQs = FALSE)
plot(fit, byQs = TRUE)
plot(fit, byQs = FALSE, vari = c("sex", "age"))
plot(fit, byQs = TRUE, vari = c("sex", "age"))
## Extra ggplot components
library(ggplot2)
plot(fit, byQs = FALSE, vari = c("sex", "age"), ggextra = theme(legend.position = "none"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.