splineCox.reg1 {splineCox} | R Documentation |
Fitting the five-parameter spline Cox model giving a specified shape
Description
splineCox.reg1
estimates the parameters of a five-parameter spline Cox model based on a specified shape for the baseline hazard function.
The function calculates the estimates for the model parameters (beta) and the baseline hazard scale parameter (gamma), using non-linear optimization.
If a numeric vector is provided for the model
parameter, it will be normalized to have an L1 norm of 1.
Additionally, if plot = TRUE
, the function generates a plot of the estimated baseline hazard function with 95
The x-axis represents time, and the y-axis represents the estimated hazard.
The solid line indicates the estimated hazard function, while the dashed red lines represent the confidence intervals.
Usage
splineCox.reg1(
t.event,
event,
Z,
xi1 = min(t.event),
xi3 = max(t.event),
model = "constant",
p0 = rep(0, 1 + ncol(as.matrix(Z))),
plot = TRUE
)
Arguments
t.event |
a vector for time-to-event |
event |
a vector for event indicator (=1 event; =0 censoring) |
Z |
a matrix for covariates; nrow(Z)=sample size, ncol(Z)=the number of covariates |
xi1 |
lower bound for the hazard function; the default is |
xi3 |
upper bound for the hazard function; the default is |
model |
A character string specifying the shape of the baseline hazard function or a numeric vector of length 5 representing custom weights. If a numeric vector is provided, it will be normalized to have an L1 norm of 1. Available options include: "increase", "constant", "decrease", "unimodal1", "unimodal2", "unimodal3", "bathtub1", "bathtub2", "bathtub3". Default is "constant" |
p0 |
Initial values to maximize the likelihood (1 + p parameters; baseline hazard scale parameter and p regression coefficients) |
plot |
A logical value indicating whether to plot the estimated baseline hazard function.
If |
Value
A list containing the following components:
model |
A shape of the baseline hazard function or the normalized custom numeric vector used. |
parameter |
A numeric vector of the parameters defining the baseline hazard shape. |
beta |
A named vector with the estimates, standard errors, and 95% confidence intervals for the regression coefficients. |
gamma |
A named vector with the estimate, standard error, and 95% confidence interval for the baseline hazard parameter. |
loglik |
A named vector containing the log-likelihood ( |
plot |
A baseline hazard function plot (if |
References
Teranishi, R.; Furukawa, K.; Emura, T. (2025). A Two-Stage Estimation Approach to Cox Regression Under the Five-Parameter Spline Model Mathematics 13(4), 616. doi:10.3390/math13040616 Available at https://www.mdpi.com/2227-7390/13/4/616
Examples
# Example data
library(joint.Cox)
data(dataOvarian)
t.event = dataOvarian$t.event
event = dataOvarian$event
Z = dataOvarian$CXCL12
reg1 <- splineCox.reg1(t.event, event, Z, model = "constant")
print(reg1)