Last data update: 2014.03.03

R: Wally plots to assess calibration of a risk or survival...
wallyPlotR Documentation

Wally plots to assess calibration of a risk or survival prediction

Description

Wally plots to assess calibration of a risk or survival prediction

Usage

wallyPlot(object, time, formula, data, cause = 1, q = 10, ylim,
  hanging = FALSE, seed = NULL, mar = c(4.1, 4.1, 2, 2), colbox = "red",
  type = "risk", pseudo = FALSE, verbose = TRUE, ...)

Arguments

object

Probabilistic survival predictions or probabilistic event risk predictions evaluated at time for the subjects in data. Either given in form of a numeric vector of probabilistic predictions or as an object which in the survival setting has a predictSurvProb method and in the competing risks setting has a predictEventProb method.

time

Time interest for evaluating calibration of the predictions.

formula

A survival or event history formula. The left hand side is used to compute the expected event status. If formula is missing, try to extract a formula from the first element in object.

data

A data frame in which to validate the prediction models and to fit the censoring model. If data is missing, try to extract a data set from the first element in object.

cause

For competing risks settings the cause of interest.

q

The number of quantiles. Defaults to 10.

ylim

Limits of y-axis. If missing the function tries to find appropriate limits based on the simulated and real data.

hanging

If TRUE, hang bars corresponding to observed frequencies at the value of the corresponding prediction.

seed

A seed value to make results reproducible.

mar

Plot margins passed to par.

colbox

Color of the box which identifies the real data calibration plot.

type

For survival models only: show either "risk" or "survival".

pseudo

Logical. Determines the method for estimating expected event frequencies. See calPlot. Default is FALSE.

verbose

If TRUE warn about missing formula and data.

...

Further arguments passed to calPlot.

Value

List of simulated and real data.

Author(s)

Paul F. Blanche <paul.blanche@univ-ubs.fr> and Thomas A. Gerds <tag@biostat.ku.dk>

See Also

calPlot

Examples


# Survival setting
library(prodlim)
library(survival)
set.seed(180)
d = SimSurv(180)
f = coxph(Surv(time,status)~X1+X2,data=d)
## Not run: 
wallyPlot(f,
          time=4,
          q=10,
          type="risk",
          data=d,
          formula=Surv(time,status)~1)
 wallyPlot(f,
          time=4,
          q=10,
          hanging=TRUE,
          type="survival",
          data=d,
          formula=Surv(time,status)~1)

## End(Not run)

# Competing risks setting
library(prodlim)
library(survival)
library(riskRegression)
set.seed(180)
d2 = SimCompRisk(180)
f2 = CSC(Hist(time,event)~X1+X2,data=d2)
## Not run: 
wallyPlot(f2,
          time=5,
          q=3,
          hanging=TRUE,
          data=d2,
          formula=Hist(time,event)~1)
          

## End(Not run)

Results