Description Usage Arguments Details Value References Examples
Compute the influence function for each observation used to estimate the model
1 2 |
object |
object The fitted Cox regression model object either
obtained with |
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 |
keep.times |
Logical. If |
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.
A list containing:
IFbetaInfluence function for the regression coefficient.
IFhazardTime differential of the influence function of the hazard.
IFcumhazardInfluence function of the cumulative hazard.
calcIFhazardElements used to compute the influence function at a given time.
timeTimes at which the influence function has been evaluated.
etime1.minTime of first event (i.e. jump) in each strata.
etime.maxLast observation time (i.e. jump or censoring) in each strata.
indexObsIndex of the observation in the original dataset.
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.