autoplot.ate: Plot predictions from a Cause-specific Cox proportional...

Description Usage Arguments Examples

View source: R/autoplot.ate.R

Description

Plot predictions from a Cause-specific Cox proportional hazard regression

Usage

1
2
3
## S3 method for class 'ate'
autoplot(object, ci = FALSE, band = FALSE, plot = TRUE,
  digits = 2, alpha = 0.1, ...)

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.

plot

Logical. Should the graphic be plotted.

digits

integer indicating the number of decimal places

alpha

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
library(survival)
library(rms)

set.seed(10)
n <- 1e2

## Cox model
dtS <- sampleData(n,outcome="survival")

fit <- cph(formula = Surv(time,event)~ X1+X2,data=dtS,y=TRUE,x=TRUE)

seqTimes <- sort(unique(fit$y[,1]))
seqTimes5 <- seqTimes[seqTimes>5 & seqTimes<10]
ateFit <- ate(fit, data = dtS, treatment = "X1", contrasts = NULL,
              times = seqTimes, B = 0, band = TRUE, nsim.band = 500, y = TRUE,
              mc.cores=1)
autoplot(ateFit, band = TRUE, ci = TRUE)

riskRegression documentation built on April 19, 2018, 5:04 p.m.