tvcure | R Documentation |
Fit of a double additive cure survival model with exogenous time-varying covariates.
tvcure(formula1, formula2, data,
model0=NULL, noestimation=FALSE,
baseline=c("S0","F0"), K0=20, pen.order0=2,
K1=10, pen.order1=2, K2=10, pen.order2=2,
phi.0=NULL, beta.0=NULL, gamma.0=NULL,
a.tau=1, b.tau=1e-6, a.pen=1, b.pen=1e-4,
tau.0=NULL, tau.min=1, tau.method = c("LPS","LPS2","Schall","grid","none"),
psi.method = c("LM","NR","none"),
lambda1.0=NULL, lambda1.min=1, lambda2.0=NULL, lambda2.min=1,
lambda.method=c("LPS","LPS2","LPS3","nlminb","none"),
logscale=FALSE,
observed.hessian=TRUE, use.Rfast=TRUE, Wood.test=FALSE,
ci.level=.95,
criterion=c("logEvid","deviance","lpen","AIC","BIC","gradient"),
criterion.tol=1e-2, grad.tol=1e-2,
RDM.tol=1e-4, fun.tol=1e-3, Lnorm=c("Linf","L2"),
iterlim=50, iter.verbose=FALSE, verbose=FALSE)
formula1 |
A formula describing the linear predictor in the long-term (cure) survival (or quantum) submodel. |
formula2 |
A formula describing the linear predictor in the short-term (cure) survival (or timing) submodel. |
data |
A data frame with survival data in a counting process format. It should always contain at least the following entries:
|
model0 |
(Optional) tvcure object from which starting values for the regression parameters, spline and penalty parameters are extracted. Make sure that it corresponds to the same model specification. The values of its components are overhidden by |
noestimation |
Logical specifying that regression, spline and penalty parameters should not be estimated, but rather be fixed at their initial values (as for example provided by |
baseline |
Baseline ("S0" or "F0") used to specify the dependence of the cumulative hazard dynamics on covariates (Default: "S0"):
Baseline S0: |
K0 |
Number of B-splines used to specify |
pen.order0 |
Penalty order for the P-splines used to specify |
K1 |
Number of P-splines for a given additive term in the long-term (or quantum) survival sumbodel (Default: 10). |
pen.order1 |
Penalty order for the P-splines in the long-term survival (or quantum) sumbodel (Default: 2). |
K2 |
Number of P-splines for a given additive term in the short-term (or timing) survival sumbodel (Default: 10). |
pen.order2 |
Penalty order for the P-splines in the short-term survival (or timing) sumbodel (Default: 2). |
phi.0 |
(Optional) vector of length |
beta.0 |
(Optional) starting value for the regression and spline parameters in the long-term survival (or quantum) submodel. |
gamma.0 |
(Optional) starting value for the regression and spline parameters in the short-term survival (or timing) submodel. |
a.tau |
Hyperprior parameter in the Gamma(a.tau,b.tau) prior for the penalty parameter |
b.tau |
Hyperprior parameter in the Gamma(a.tau,b.tau) prior for the penalty parameter |
a.pen |
Hyperprior parameter in the Gamma(a.pen,b.pen) priors for the penalty parameters |
b.pen |
Hyperprior parameter in the Gamma(a.pen,b.pen) priors for the penalty parameters |
tau.0 |
Starting value for |
tau.min |
Minimal value for the penalty parameter |
tau.method |
Method used to calculate the posterior mode of |
psi.method |
Algorithm used for the computation of the conditional posterior mode of the regression and splines parameters. Possible choices are Levenberg-Marquardt ("LM"), Newton-Raphson ("NR") or "none" (when the coefficients remain fixed at their initial values). |
lambda1.0 |
(Optional) J1-vector with starting values for the penalty parameters of the additive terms in the long-term survival (or quantum) submodel. |
lambda1.min |
Minimal value for the J1 penalty parameters |
lambda2.0 |
(Optional) J2-vector with starting values for the penalty parameters of the additive terms in the short-term survival (or timing) submodel. |
lambda2.min |
Minimal value for the J2 penalty parameters |
lambda.method |
Method used ("LPS", "LPS2", "LPS3", "nlminb" or "none") to select the penalty parameters of the additive terms in the long-term survival (or quantum) submodel:
|
logscale |
Logical: when TRUE, select |
observed.hessian |
Logical indicating if a fast approximation of the Hessian matrix based on cross-products is preferred over its expected value. (Default: TRUE). |
use.Rfast |
Logical indicating if matrix functions from the Rfast package should be used to fasten computation. (Default: TRUE). |
Wood.test |
Logical indicating if P-values based on Wood's test (Biometrika 2013) of the significance of additive terms should be preferred over basic Chi-square tests. (Default: FALSE). |
ci.level |
Default value for the levels of the credible intervals. (Default: 0.95). |
criterion |
Criterion used to assess convergence of the estimation procedure (Default: "logEvid"):
|
criterion.tol |
Maximum absolute difference between the successive values of the |
grad.tol |
Tolerance threshold for the absolute value of each gradient component when monitoring convergence. (default: 1e-2). |
RDM.tol |
Tolerance thershold for the Relative Damping Measure (= RDM) when monitoring convergence (default: 1e-4). |
fun.tol |
Tolerance threshold for variations in the maximized function during the final iterations of posterior mode computation and convergence monitoring (default: 1e-3). |
Lnorm |
Lp norm used to evaluate the gradient for convergence assessment. Options are "Linf" (default) or "L2". |
iterlim |
Maximum number of iterations. (Default: 50). |
iter.verbose |
Logical indicating if the values of the convergence criterions should be printed after each iteration. (Default: FALSE). |
verbose |
Logical indicating if additional output based on gradients should be printed at the end of each iteration. (Default: FALSE). |
An object of type tvcure.object
.
Philippe Lambert p.lambert@uliege.be
Lambert, P. and Kreyenfeld, M. (2025). Time-varying exogenous covariates with frequently changing values in double additive cure survival model: an application to fertility. Journal of the Royal Statistical Society, Series A. <doi:10.1093/jrsssa/qnaf035>
require(tvcure)
## Simulated data generation
beta = c(beta0=.4, beta1=-.2, beta2=.15) ; gam = c(gam1=.2, gam2=.2)
data = simulateTVcureData(n=500, seed=123, beta=beta, gam=gam,
RC.dist="exponential",mu.cens=550)$rawdata
## TVcure model fitting
tau.0 = 2.7 ; lambda1.0 = c(40,15) ; lambda2.0 = c(25,70) ## Optional
model = tvcure(~z1+z2+s(x1)+s(x2), ~z3+z4+s(x3)+s(x4), data=data,
tau.0=tau.0, lambda1.0=lambda1.0, lambda2.0=lambda2.0)
print(model)
plot(model, pages=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.