cv.coxtp {surtvep} | R Documentation |
fit a cross-validated Cox non-proportional hazards model with P-spline or Smoothing-spline where penalization tuning parameter is provided by cross-validation
Description
Fit a Cox non-proportional hazards model via penalized maximum likelihood. The penalization tuning parameter is provided by cross-validation.
Usage
cv.coxtp(
event,
z,
time,
strata = NULL,
lambda = c(0.1, 1, 10),
nfolds = 5,
foldid = NULL,
knots = NULL,
penalty = "Smooth-spline",
nsplines = 8,
ties = "Breslow",
tol = 1e-06,
iter.max = 20L,
method = "ProxN",
gamma = 1e+08,
btr = "dynamic",
tau = 0.5,
stop = "ratch",
parallel = FALSE,
threads = 1L,
degree = 3L,
fixedstep = FALSE
)
Arguments
event |
failure event response variable of length |
z |
input covariate matrix, with |
time |
observed event times, which should be a vector with non-negative values. |
strata |
a vector of indicators for stratification.
Default = |
lambda |
a user specified sequence as the penalization coefficients in front of the spline term specified by |
nfolds |
number of folds for cross-validation, the default value is 5. The smallest value allowable is |
foldid |
an optional vector of values between 1 and |
knots |
the internal knot locations (breakpoints) that define the B-splines.
The number of the internal knots should be |
penalty |
a character string specifying the spline term for the penalized Newton method.
This term is added to the log-partial likelihood, and the penalized log-partial likelihood serves as the new objective function to
control the smoothness of the time-varying coefficients.
Default is
If |
nsplines |
number of basis functions in the splines to span the time-varying effects. The default value is 8.
We use the R function |
ties |
a character string specifying the method for tie handling. If there are no tied events,
the methods are equivalent.
By default |
tol |
tolerance used for stopping the algorithm. See details in |
iter.max |
maximum iteration number if the stopping criterion specified by |
method |
a character string specifying whether to use Newton method or proximal Newton method. If |
gamma |
parameter for proximal Newton method |
btr |
a character string specifying the backtracking line-search approach. |
tau |
a positive scalar used to control the step size inside the backtracking line-search. The default value is |
stop |
a character string specifying the stopping rule to determine convergence.
|
parallel |
if |
threads |
an integer indicating the number of threads to be used for parallel computation. The default value is |
degree |
degree of the piecewise polynomial for generating the B-spline basis functions—default is 3 for cubic splines.
If If |
fixedstep |
if |
Details
The function runs coxtp
length of lambda
by nfolds
times; each is to compute the fit with each of the folds omitted.
Value
An object of class "cv.coxtp"
is returned, which is a list with the ingredients of the cross-validation fit.
model.cv |
a |
lambda |
the values of |
cve |
the mean cross-validated error - a vector having the same length as lambda.
For the k-th testing fold (k = 1, ..., |
lambda.min |
the value of |
References
Boyd, S., and Vandenberghe, L. (2004) Convex optimization.
Cambridge University Press.
Gray, R. J. (1992) Flexible methods for analyzing survival data using splines, with applications to breast cancer prognosis.
Journal of the American Statistical Association, 87(420): 942-951.
Gray, R. J. (1994) Spline-based tests in survival analysis.
Biometrics, 50(3): 640-652.
Luo, L., He, K., Wu, W., and Taylor, J. M. (2023) Using information criteria to select smoothing parameters when analyzing survival data with time-varying coefficient hazard models.
Statistical Methods in Medical Research, in press.
Perperoglou, A., le Cessie, S., and van Houwelingen, H. C. (2006) A fast routine for fitting Cox models with time varying effects of the covariates.
Computer Methods and Programs in Biomedicine, 81(2): 154-161.
Verweij, P. J., and Van Houwelingen, H. C. (1993) Crossâvalidation in survival analysis.
Statistics in Medicine, 12(24): 2305-2314.
Wu, W., Taylor, J. M., Brouwer, A. F., Luo, L., Kang, J., Jiang, H., and He, K. (2022) Scalable proximal methods for cause-specific hazard modeling with time-varying coefficients.
Lifetime Data Analysis, 28(2): 194-218.
Wood, S. N. (2017) P-splines with derivative based penalties and tensor product smoothing of unevenly distributed data.
Statistics and Computing, 27(4): 985-989.
Examples
data(ExampleData)
z <- ExampleData$z
time <- ExampleData$time
event <- ExampleData$event
lambda = c(0.1, 1)
fit <- cv.coxtp(event = event, z = z, time = time, lambda=lambda, nfolds = 5)