tvTran {dynsurv}  R Documentation 
Unlike the timevarying coefficient Cox model, the transformation model fomulates the temporal covariate effects in terms of survival function, i.e.,
S(tX) = g(\beta_0(t)' X),
where g(z) = exp( exp(z))
.
It can be viewed as a functional generalized linear model with response
I(T > t)
, and other transformation function is possible. The
timevarying coefficients are solved a set of estimating equations
sequentially.
tvTran(formula, data, control = list())
formula 
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 
data 
A data.frame in which to interpret the variables named in the

control 
List of control options. 
Note that because the timevarying coefficient function is connected to the survival function, it has a different interpretation of the timevarying 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.
An object of S3 class tvTran
representing the fit.
Peng, L. and Huang, Y. (2007). Survival analysis with temporal covariate effects. Biometrika 94(3), 719–733.
## Not run:
## 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 timevarying transformation model
fit < tvTran(myformula, mydata, control = list(resample = TRUE, R = 30))
## Plot the timevarying coefficient function between two time points
plotCoef(subset(coef(fit), Time > 15 & Time < 175))
## End(Not run)