groupci {QHScrnomo}R Documentation

Assess Calibration for a Competing Risks Endpoint

Description

Uses cuminc to estimate the cumulative incidence at a given time point within subgroups of a continuous variable (often predicted failure probabilities from a crr.fit model).

Usage

groupci(
  x,
  ftime,
  fstatus,
  u,
  cencode = 0,
  failcode = 1,
  ci = TRUE,
  m = 50,
  g = NULL,
  cuts = NULL,
  pl = TRUE,
  conf.int = 0.95,
  xlab = NULL,
  ylab = NULL,
  xlim = c(0, 1),
  ylim = c(0, 1),
  lty = 1,
  add = FALSE,
  cex.subtitle = FALSE,
  ab = TRUE,
  a = 0,
  b = 1,
  ...
)

Arguments

x

A numeric variable to assess calibration for

ftime

The event time variable. See cuminc.

fstatus

The event status variable. See cuminc.

u

A single time point to assess calibration at

cencode

The censoring event code. See cuminc.

failcode

The value of fstatus that indicates the event of interest

ci

Should the failure probability be assessed? Defaults to TRUE. If FALSE, the event-free probability is assessed.

m

Minimum number of observations in each group. See cut2.

g

Number of quantile groups. See cut2.

cuts

Actual cut points to use for x. See cut2.

pl

Should the calibration curve be plotted? Defaults to TRUE.

conf.int

Confidence limit on error bars. Defaults to 0.95. Set to FALSE to suppress.

xlab

The x-axis label. Uses label or name of calling argument if not specified.

ylab

The y-axis label. Uses a default label is none specified.

xlim

The x-axis limits. Defaults to c(0, 1).

ylim

The y-axis limits. Defaults to c(0, 1).

lty

Line type for connecting estimates and error bars

add

Defaults to FALSE. Set to TRUE to add to an existing plot.

cex.subtitle

Character size for subtitle (default 0.7). Defaults to FALSE to suppress.

ab

Should a reference line be added? See abline.

a

The intercept for the reference line. See abline.

b

The slope for the reference line. See abline.

...

Other arguments passed to lines and errbar.

Details

To divide x, the function first looks for cuts, then g, then m.

Value

A matrix with a row for each group of x:

x

Mean value of x

n

Number of observations

events

Number of events (of type failcode)

ci

Estimated cumulative incidence (or event-free probability if ci=FALSE)

std.err

Estimated standard error for the ci value

If pl=TRUE, a calibration plot is also displayed.

Author(s)

Changhong Yu, Michael Kattan, Ph.D
Department of Quantitative Health Sciences
Cleveland Clinic

See Also

cuminc pred.ci cut2

Examples

dd <- datadist(prostate.dat)
options(datadist = "dd")
prostate.f <- cph(Surv(TIME_EVENT,EVENT_DOD == 1) ~ TX  + rcs(PSA,3) +
           BX_GLSN_CAT +  CLIN_STG + rcs(AGE,3) +
           RACE_AA, data = prostate.dat,
           x = TRUE, y = TRUE, surv = TRUE,time.inc = 144)
prostate.crr <- crr.fit(prostate.f, cencode = 0, failcode = 1)

# Cross-validated predictions
prostate.dat$preds.cv.prostate.crr.120 <- tenf.crr(prostate.crr, time = 120, fold = 2)

with(prostate.dat,
     groupci(preds.cv.prostate.crr.120, ftime = TIME_EVENT,
             fstatus =EVENT_DOD, g = 5, u = 120,
             xlab = "Nomogram predicted 10-year cancerspecific mortality",
             ylab = "Observed predicted 10-year cancerspecific mortality")
)


[Package QHScrnomo version 3.0.1 Index]