Learn R Programming

riskRegression (version 1.3.7)

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

Description

Plot predictions from a Cause-specific Cox proportional hazard regression

Usage

# S3 method for predictCSC
plot(x, ci = FALSE, digits = 2, ...)

Arguments

x

object obtained with the function predictCox.

ci

Logical. If TRUE display the confidence intervals for the predictions.

digits

integer indicating the number of decimal places

...

not used. Only for compatibility with the plot method.

Examples

Run this code
## no strata
d <- sampleData(1e2, outcome = "competing.risks")
m.CSC <- CSC(Hist(time,event)~ X1 + X2 + X6, data = d)

pred.CSC <- predict(m.CSC, time = 1:5, cause = 1)
plot(pred.CSC)

pred.CSC <- predict(m.CSC, newdata = d[1:3,],
                    time = 1:5, cause = 1, se = TRUE, keep.newdata = TRUE)


## strata
m.SCSC <- CSC(Hist(time,event)~ strata(X1) + strata(X2) + X6,
data = d)
pred.SCSC <- predict(m.SCSC, time = 1:3,
cause = 1, se = TRUE, keep.newdata = TRUE, keep.strata = TRUE)
plot(pred.SCSC)
plot(pred.SCSC)

Run the code above in your browser using DataLab