iidCox: Extract i.i.d. decomposition from a Cox model

Description Usage Arguments Details Value References Examples

Description

Compute the influence function for each observation used to estimate the model

Usage

1
2
iidCox(object, newdata = NULL, baseline.iid = TRUE,
  tau.hazard = NULL, store.iid = "full", keep.times = TRUE)

Arguments

object

object The fitted Cox regression model object either obtained with coxph (survival package) or cph (rms package).

newdata

Optional new data at which to do i.i.d. decomposition

baseline.iid

Should the influence function for the baseline hazard be computed.

tau.hazard

the vector of times at which the i.i.d decomposition of the baseline hazard will be computed

store.iid

the method used to compute the influence function and the standard error. Can be "full", "approx" or "minimal". See the details section.

keep.times

Logical. If TRUE add the evaluation times to the output.

Details

This function implements the first three formula (no number,10,11) of the subsection "Empirical estimates" in (Ozenne et al., 2017).

If there is no event in a strata, the influence function for the baseline hazard is set to 0.

store.iid equal to "full" exports the influence function for the coefficients and the baseline hazard at each event time. store.iid equal to "approx" does the same except that the terms that do not contributes to the variance are not ignored (i.e. set to 0) store.iid equal to "minimal" exports the influence function for the coefficients. For the baseline hazard it only computes the quantities necessary to compute the influence function in order to save memory.

Value

A list containing:

References

Brice Ozenne, Anne Lyngholm Sorensen, Thomas Scheike, Christian Torp-Pedersen and Thomas Alexander Gerds. riskRegression: Predicting the Risk of an Event using Cox Regression Models. The R Journal (2017) 9:2, pages 440-460.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(survival)
library(data.table)
library(prodlim)
set.seed(10)
d <- sampleData(100, outcome = "survival")[,.(eventtime,event,X1,X6)]
setkey(d, eventtime)

m.cox <- coxph(Surv(eventtime, event) ~ X1+X6, data = d, y = TRUE, x = TRUE)
system.time(IF.cox <- iidCox(m.cox))
system.time(IF.cox_approx <- iidCox(m.cox, store.iid = "approx"))


IF.cox.all <- iidCox(m.cox, tau.hazard = sort(unique(c(7,d$eventtime))))
IF.cox.beta <- iidCox(m.cox, baseline.iid = FALSE)

bozenne/riskRegressionLight documentation built on May 7, 2019, 12:52 a.m.