FitCalibCoxRSInts: Fitting Proportional Hazards Risk-Set Calibration Models with...

Description Usage Arguments Details Value See Also Examples

View source: R/FitCalibCoxRSInts.R

Description

FitCalibCoxRS fits proportional hazards risk-set calibration models for time-to-exposure from interval-censored data with covariates. The exposure is a binary covariate measured in intermittent times. The covariates (Q) are associated with the time-to-exposure. This function fits a calibration model at each main event time point, using only members of the risk set at that time point. model is fitted (for all the data) and used for that time point.

FitCalibCoxRSInts fits proportional hazards grouped risk-set calibration models for time-to-exposure from interval-censored data with covariates. The exposure is a binary covariate measured in intermittent times. The covariates (Q) are associated with the time-to-exposure. Unlike FitCalibCoxRS, this function fits a calibration model at each of the given points for pts.for.ints.

Usage

1
2
3
4
FitCalibCoxRS(w, w.res, Q, hz.times, tm, n.int = 5, order = 2, event)

FitCalibCoxRSInts(w, w.res, Q, hz.times, n.int = 5, order = 2, tm, event,
  pts.for.ints)

Arguments

w

A matrix of time points when measurements on the binary covariate were obtained.

w.res

A matrix of measurement results of the binary covariate. It corresponds to the time points in w

Q

Matrix of covariates for PH calibration model

hz.times

Times used for calculating the baseline hazard function of a PH calibration model

tm

Vector of observed main event time or censoring time

n.int

The number of interior knots to be used, see ICsurv::fast.PH.ICsurv.EM, Default: 5

order

the order of the basis functions. See ICsurv::fast.PH.ICsurv.EM, Default: 2

event

Vector of censoring indicators. 1 for event 0 for censored

pts.for.ints

Points defining the intervals for grouping risk-sets (first one has to be zero). Should be sorted from zero up. pts.for.ints is used only for FitCalibCoxRSInts.

Details

In case of an error in the model-fitting at a certain time point, a proportional hazards calibration model (for all the data) is fitted and used for that time point.

Value

A list of Cox PH model fits, each supplemented with the knots and order used for the I-splines.

See Also

fast.PH.ICsurv.EM, FitCalibCox

fast.PH.ICsurv.EM, FitCalibCox

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(2) 
sim.data <- ICcalib:::SimCoxIntervalCensCox(n.sample = 50, lambda = 0.1, 
                                            alpha = 0.25, beta0 = log(0.2),
                                            gamma.q = c(log(0.75), log(2.5)), 
                                            gamma.z = log(1.5), mu = 0.2, 
                                            n.points = 2)
# The baseline hazard for the calibration model is calculated in observation times
cox.hz.times <- sort(unique(sim.data$obs.tm)) 
# Fit proprtional hazards grouped risk-sets calibration models
calib.ph.rs.fit <- FitCalibCoxRSInts(w = sim.data$w, w.res = sim.data$w.res, Q = sim.data$Q, 
                                     hz.times = cox.hz.times, tm = sim.data$obs.tm, 
                                     event = sim.data$delta, pts.for.ints = seq(0, 3, 1.5),
                                     n.int = 5, order = 2)
# Below is a more time consuming option (no grouping of risk-sets)
# FitCalibCoxRS(w = sim.data$w, w.res = sim.data$w.res, Q = sim.data$Q, 
#                hz.times = cox.hz.times, obs.tm = sim.data$obs.tm, 
#               event = sim.data$delta, n.int = 5, order = 1)

ICcalib documentation built on Jan. 20, 2018, 9:52 a.m.