Last chance! 50% off unlimited learning
Sale ends in
Unlike the time-varying coefficient Cox model, the transformation model
fomulates the temporal covariate effects in terms of survival function,
i.e.,
tvTran(formula, data, control = list())
An object of S3 class tvTran
representing the fit.
A formula object, with the response on the left of a '~'
operator, and the terms on the right. The response must be a survival
object as returned by the Surv
function.
A data.frame in which to interpret the variables named in the
formula
.
List of control options.
Note that because the time-varying coefficient function is connected to the survival function, it has a different interpretation of the time-varying coefficient function in Cox model.
The control
argument is a list of components:
A logical value, default TRUE
. If
TRUE
, the model will estimate a 95% confidence band by
resampling method.
Number of resamplings, default 30.
Peng, L. and Huang, Y. (2007). Survival analysis with temporal covariate effects. Biometrika 94(3), 719--733.
coef.tvTran
, plotCoef
.
if (FALSE) {
## Attach the veteran data from the survival package
mydata <- survival::veteran
mydata$celltype <- relevel(mydata$celltype, ref = "large")
myformula <- Surv(time, status) ~ karno + celltype
## Fit the time-varying transformation model
fit <- tvTran(myformula, mydata, control = list(resample = TRUE, R = 30))
## Plot the time-varying coefficient function between two time points
plotCoef(subset(coef(fit), Time > 15 & Time < 175))
}
Run the code above in your browser using DataLab