Learn R Programming

riskRegression (version 1.3.7)

seCSC: Standard error of the absolute risk predicted from cause-specific Cox models

Description

Standard error of the absolute risk predicted from cause-specific Cox models.

Usage

seCSC(hazard, cumhazard, object.time, object.maxtime, iid, eXb_h, eXb_cumH,
  new.LPdata, new.strata, times, new.n, cause, nCause, return.se)

Arguments

hazard

list containing the baseline hazard for each cause in a matrix form. Columns correspond to the strata.

cumhazard

list containing the cumulative baseline hazard for each cause in a matrix form. Columns correspond to the strata.

object.time

a vector containing all the events regardless to the cause.

object.maxtime

a matrix containing the latest event in the strata of the observation for each cause.

iid

the value of the influence function for each cause

eXb_h

a matrix containing the exponential of the linear predictor evaluated for the new observations (rows) for each cause (columns)

eXb_cumH

same as before except when considering survtype == "survival"

new.LPdata

a list of design matrices for the new observations for each cause.

new.strata

a matrix containing the strata indicator for each observation and each cause.

times

the time points at which to evaluate the predictions.

new.n

the number of new observations.

cause

the cause of interest.

nCause

the number of causes.

return.se

Logical. Should the standard error be output. Otherwise the value of the influence function will be output.

Examples

Run this code

set.seed(10)
d <- SimCompRisk(2e1)
d$time <- round(d$time,1)
ttt <- unique(sort(d$time))#sort(sample(x = unique(sort(d$time)), size = 10))

#### coxph function
CSC.fit <- CSC(Hist(time,event)~ X1+X2,data=d, method = "breslow")

predCSC <- predict(CSC.fit, newdata = d[1,,drop=FALSE], cause = 2, times = ttt, se = TRUE)


Run the code above in your browser using DataLab