tenf.crr: Ten fold cross validation for competing risks regression

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/tenf.crr.R

Description

Ten fold cross validation for crr endpoint

Usage

1
tenf.crr(fit, time = NA, lps = FALSE, fold = 10)

Arguments

fit

a competing risks regression model fittd by function crr.fit.

time

the expected time point.

lps

logical flag. If true, values of predicted X beta will be output instead of cumulative incidence

fold

number of fold. the default is 10 fold cross validation.

Details

Do cross validation on a competing risk regression model.

Value

A vector of predicted values of cumulative incidence or X beta for each observation.

Note

Before the function is called, packages 'Hmisc', 'rms' and 'cmprsk' should be loaded as the function will call some funcitons in these packages.

Author(s)

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

See Also

crr.fit, crr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(prostate.dat)
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)

## ten fold cross validation
prostate.dat$preds.tenf<-
    tenf.crr(prostate.crr,time = 120)

jixccf/QHScrnomo documentation built on Dec. 21, 2021, 12:08 a.m.