autoplot.predictCSC: Plot Predictions From a Cause-specific Cox Proportional...

Description Usage Arguments Examples

Description

Plot predictions from a Cause-specific Cox proportional hazard regression.

Usage

1
2
3
4
## S3 method for class 'predictCSC'
autoplot(object, ci = FALSE, band = FALSE,
  group.by = "row", reduce.data = FALSE, plot = TRUE, digits = 2,
  alpha = NA, ...)

Arguments

object

Object obtained with the function predictCox.

ci

[logical] If TRUE display the confidence intervals for the predictions.

band

[logical] If TRUE display the confidence bands for the predictions.

group.by

[character] The grouping factor used to color the prediction curves. Can be "row", "strata", or "covariates".

reduce.data

[logical] If TRUE only the covariates that does take indentical values for all observations are displayed.

plot

[logical] Should the graphic be plotted.

digits

[integer] Number of decimal places.

alpha

[numeric, 0-1] Transparency of the confidence bands. Argument passed to ggplot2::geom_ribbon.

...

Not used. Only for compatibility with the plot method.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(survival)
library(rms)
library(ggplot2)
library(prodlim)
#### simulate data ####
set.seed(10)
d <- sampleData(1e2, outcome = "competing.risks")

#### CSC model ####
m.CSC <- CSC(Hist(time,event)~ X1 + X2 + X6, data = d)

pred.CSC <- predict(m.CSC, newdata = d[1:2,], time = 1:5, cause = 1)#'
autoplot(pred.CSC)


#### stratified CSC model ####
m.SCSC <- CSC(Hist(time,event)~ strata(X1) + strata(X2) + X6,
              data = d)
pred.SCSC <- predict(m.SCSC, time = 1:3, newdata = d[1:4,],
                     cause = 1, keep.newdata = TRUE, keep.strata = TRUE)
autoplot(pred.SCSC, group.by = "strata")

bozenne/riskRegressionLight documentation built on May 7, 2019, 12:52 a.m.