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 |
fstatus |
The event status variable. See |
u |
A single time point to assess calibration at |
cencode |
The censoring event code. See |
failcode |
The value of |
ci |
Should the failure probability be assessed? Defaults to |
m |
Minimum number of observations in each group. See |
g |
Number of quantile groups. See |
cuts |
Actual cut points to use for |
pl |
Should the calibration curve be plotted? Defaults to |
conf.int |
Confidence limit on error bars. Defaults to 0.95. Set to |
xlab |
The x-axis label. Uses |
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 |
cex.subtitle |
Character size for subtitle (default 0.7). Defaults to |
ab |
Should a reference line be added? See |
a |
The intercept for the reference line. See |
b |
The slope for the reference line. See |
... |
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 |
n |
Number of observations |
events |
Number of events (of type |
ci |
Estimated cumulative incidence (or event-free probability if |
std.err |
Estimated standard error for the |
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
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")
)