Title: | Penalised Maximum Likelihood for Survival Analysis Models |
---|---|
Description: | Estimate the regression coefficients and the baseline hazard of proportional hazard Cox models with left, right or interval censored survival data using maximum penalised likelihood. A 'non-parametric' smooth estimate of the baseline hazard function is provided. |
Authors: | Dominique-Laurent Couturier, Jun Ma, Stephane Heritier, Maurizio Manuguerra. |
Maintainer: | Dominique-Laurent Couturier <[email protected]> |
License: | LGPL (>= 2) |
Version: | 0.2-3 |
Built: | 2024-11-15 03:35:37 UTC |
Source: | https://github.com/cran/survivalMPL |
Simultaneously estimate the regression coefficients and provide a 'non-parametric' smooth estimate of the baseline hazard function for proportional hazard Cox models using maximum penalised likelihood (MPL).
This package allows to perform simultaneous estimation of the regression coefficients and baseline hazard function in Cox proportional hazard models, with right, left and interval censored data and independent censoring, by maximising a penalised likelihood, in which a penalty function is used to smooth the baseline hazard estimate.
Optimisation is achieved using a new iterative algorithm, which combines Newton's method and the multiplicative iterative algorithm by Ma (2010), and respects the non-negativity constraints on the baseline hazard estimate (refer to Ma, Couturier, Heritier and Marschner (2021)).
Valid inferences for the regression coefficients and the baseline hazard, cumulative baseline hazard and survival functions as well as for their predictions are available.
This software is accepted by users "as is" and without warranties or guarantees of any kind.
Dominique-Laurent Couturier, Jun Ma, Stephane Heritier, Maurizio Manuguerra.
Maintainer: Dominique-Laurent Couturier [email protected].
Ma, J. and Couturier, D.-L., and Heritier, S. and Marschner, I.C. (2021), Penalized likelihood estimation of the proportional hazards model for survival data with interval censoring. International Journal of Biostatistics,doi:10.1515/ijb-2020-0104.
Ma, J. and Heritier, S. and Lo, S. (2014), On the Maximum Penalised Likelihood Approach for Proportional Hazard Models with Right Censored Survival Data. Computational Statistics and Data Analysis 74, 142-156.
Ma, J. (2010), Positively constrained multiplicative iterative algorithm for maximum penalised likelihood tomographic reconstruction. IEEE Transactions On Signal Processing 57, 181-192.
Interval censored data described and given in full in Finkelstein and Wolfe (1985), discussed by More (2016, example 12.2) and available in the R package 'interval' (refer to ?bcos). Compared to the interval package version, bcos2 simply recode the lower value of left-censored data (NA instead of 0) and upper value of right-censored data (NA instead of Inf) to allow an easy identification of left-censored data by means of the function Surv
when type=="interval2"
.
data(bcos2)
data(bcos2)
A data frame with 94 observations on the following 3 variables.
left
a numeric vector
right
a numeric vector
treatment
a factor with levels Rad
and RadChem
Finkelstein, D.M., and Wolfe, R.A. (1985). A semiparametric model for regression analysis of interval-censored failure time data. Biometrics 41: 731-740.
Moore, D. K. (2016), Applied Survival Analysis Using R, Springer.
data(bcos2)
data(bcos2)
summary
Extract the coefficients of the model part of interest of a coxph_mpl
object, and the matrix of coefficients of the model part of interest and
corresponding standard errors, -statistics and
-values of a
summary.coxph_mpl
object.
## S3 method for class 'coxph_mpl' coef(object, parameters="Beta",...) ## S3 method for class 'summary.coxph_mpl' coef(object, parameters="Beta",...)
## S3 method for class 'coxph_mpl' coef(object, parameters="Beta",...) ## S3 method for class 'summary.coxph_mpl' coef(object, parameters="Beta",...)
object |
an object inheriting from class |
parameters |
the set of parameters of interest. Indicate |
... |
other arguments. |
When the input is of class summary.coxph_mpl
and parameters=="Theta"
,
only the parameter estimates larger than min.Theta
(see
coxph_mpl.control
) are reported.
a vector of coefficients or a matrix of coefficients with standard errors, z-statistics and corresponding p-values.
Dominique-Laurent Couturier, Maurizio Manuguerra
coxph_mpl
and summary.coxph_mpl
.
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) coef(fit_mpl) coef(summary(fit_mpl)) ## End(Not run)
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) coef(fit_mpl) coef(summary(fit_mpl)) ## End(Not run)
Simultaneously estimate the regression coefficients and the baseline hazard function of proportional hazard Cox models using maximum penalised likelihood (MPL).
coxph_mpl(formula, data, subset, na.action, control, ...) ## S3 method for class 'coxph_mpl' print(x,...)
coxph_mpl(formula, data, subset, na.action, control, ...) ## S3 method for class 'coxph_mpl' print(x,...)
formula |
a formula object, with the response on the left of a |
data |
a data.frame in which to interpret the variables named in
the |
subset |
expression indicating which subset of the rows of data should be used in the fit. All observations are included by default. |
na.action |
a missing-data filter function. This is applied to the model.frame
after any subset argument has been used. Default is |
x |
an object inheriting from class |
control |
Object of class |
... |
Other arguments. In |
coxph_mpl
allows to simultaneously estimate the regression
coefficients and baseline hazard function of Cox proportional hazard models,
with right censored data and independent censoring, by maximising a penalised
likelihood, in which a penalty function is used to smooth the baseline hazard
estimate.
Optimisation is achieved using a new iterative algorithm, which combines Newton's method and the multiplicative iterative algorithm proposed by Ma (2010), and respects the non-negativity constraints on the baseline hazard estimate (refer to Ma, Couturier, Heritier and Marschner (2021)).
The centered X matrix is used in the optimisation process to get a better shaped (penalised) log-likelihood. Baseline hazard parameter estimates and covariance matrix are then respectively corrected using a correction factor and the delta method.
When the chosen basis is not uniform, estimates of zero are possible for baseline hazard parameters and will correspond to active constraints as defined by Moore and Sadler (2008). Inference, as described by Ma, Heritier and Lo (2014), is then corrected accordingly (refer to Moore and Sadler (2008)) by adequately 'cutting' the corresponding covariance matrix.
There are currently 3 ways to perform inference on model parameters:
Let denote the Hessian matrix of the unpenalised likelihood,
denote the product of the first order derivative of
the penalised likelihood by its transpose, and
denote the second
order derivative of the penalised likelihood. Then,
'H'
refers to , the inverse of the Hessian matrix,
'M2QM2'
, refers to the sandwich formula ,
'M2HM2'
, refers to the sandwich formula .
Simulations analysing the coverage levels of confidence intervals for the
regression parameters seem to indicate that
performs better when using the uniform basis, and that
performs when using other bases.
an object of class coxph_mpl
representing the fit.
See coxph_mpl.object
for details.
Dominique-Laurent Couturier, Jun Ma, Stephane Heritier, Maurizio Manuguerra. Design inspired by the function
coxph
of the survival
package.
Ma, J. and Couturier, D.-L., and Heritier, S. and Marschner, I.C. (2021), Penalized likelihood estimation of the proportional hazards model for survival data with interval censoring. International Journal of Biostatistics,doi:10.1515/ijb-2020-0104.
Ma, J. and Heritier, S. and Lo, S. (2014), On the Maximum Penalised Likelihood Approach for Proportional Hazard Models with Right Censored Survival Data. Computational Statistics and Data Analysis 74, 142-156.
Ma, J. (2010), Positively constrained multiplicative iterative algorithm for maximum penalised likelihood tomographic reconstruction. IEEE Transactions On Signal Processing 57, 181-192.
Moore, T. J. and Sadler, B. M. and Kozick R. J. (2008), Maximum-Likelihood Estimation, the Cramer-Rao Bound, and the Method of Scoring With Parameter Constraints, IEEE Transactions On Signal Processing 56, 3, 895-907.
Moore, D. K. (2016), Applied Survival Analysis Using R, Springer .
coxph_mpl.object
, coxph_mpl.control
,
summary.coxph_mpl
and plot.coxph_mpl
.
## Not run: ## right censoring example based on the dataset 'lung' ## of the survival package (refer to ?lung) ## with hazard approximated by means of a step function (default). data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) summary(fit_mpl) ## interval censoring example ## (refer to ?bcos2 and to Moore (2016, example 12.2)) ## with hazard approximated by means of m-splines data(bcos2) fit_mpl <- coxph_mpl(Surv(left, right, type="interval2") ~ treatment, data = bcos2, basis="m") summary(fit_mpl) ## End(Not run)
## Not run: ## right censoring example based on the dataset 'lung' ## of the survival package (refer to ?lung) ## with hazard approximated by means of a step function (default). data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) summary(fit_mpl) ## interval censoring example ## (refer to ?bcos2 and to Moore (2016, example 12.2)) ## with hazard approximated by means of m-splines data(bcos2) fit_mpl <- coxph_mpl(Surv(left, right, type="interval2") ~ treatment, data = bcos2, basis="m") summary(fit_mpl) ## End(Not run)
This is used to set various numeric parameters controling a Cox model fit
using coxph_mpl
. Typically it would only be used in a call
to coxph_mpl
. Some basic checks are performed on inputs, such that
impossible argument values (like a negative number of events per base,
for example) are avoided.
coxph_mpl.control(n.obs=NULL, basis = "uniform", smooth = NULL, max.iter=c(150,7.5e+04,1e+06), tol=1e-7, n.knots = NULL, n.events_basis = NULL, range.quant = c(0.075,.9), cover.sigma.quant = .25, cover.sigma.fixed=.25, min.theta = 1e-10, penalty = 2L, order = 3L, kappa = 1/.6, epsilon = c(1e-16, 1e-10), ties = "epsilon", seed = NULL)
coxph_mpl.control(n.obs=NULL, basis = "uniform", smooth = NULL, max.iter=c(150,7.5e+04,1e+06), tol=1e-7, n.knots = NULL, n.events_basis = NULL, range.quant = c(0.075,.9), cover.sigma.quant = .25, cover.sigma.fixed=.25, min.theta = 1e-10, penalty = 2L, order = 3L, kappa = 1/.6, epsilon = c(1e-16, 1e-10), ties = "epsilon", seed = NULL)
n.obs |
the number of fully observed (i.e., non censored) outcomes. This
argument is only required when |
basis |
the name of the basis to use to approximate the baseline hazard function.
Available options are |
smooth |
the smoothing parameter value. When specified, it should be larger or equal
to zero. By default, the smoothing value is set to |
max.iter |
a vector of 3 integers defining the maximum number of iterations for the smooth
parameter (first value) and for the Beta and Theta (second value) parameters
to attempt for convergence. The third value is the total number of iterations allawed.
Default is |
tol |
the convergence tolerence value. Convergence is achieved when the maximum
absolute difference between the parameter estimates at iteration k and iteration
k-1 is smaller than |
n.knots |
a vector of 2 integers defining how the internal knot sequence (the minimum and
maximum observations define the external knots) of non-uniform bases
should be set. The first value specify the number of quantile knots to be set
between the |
n.events_basis |
an integer specifing the number of fully observed (i.e., non censored) outcome
per uniform base. The value has to be larger or equal to one and smaller than
|
range.quant |
a vector of length 2 defining the range of the quantile knots when a non uniform
basis is chosen. By default, |
cover.sigma.quant |
the proportion of fully observed (i.e., non censored) outcomes that should belong
to the interval defined by the quantiles 0.025 and 0.975 of each truncated
Gaussian base corresponding to a quantile knot (see |
cover.sigma.fixed |
the proportion of the outcome range that should belong to the interval
defined by the quantiles 0.025 and 0.975 of each untruncated
Gaussian base corresponding to each fixed knot (see |
min.theta |
a value indicating the minimal baseline hazard parameter value in the output
(i.e., after the fit). Baseline hazard parameter estimates lower than |
penalty |
an integer specifying the order of the penalty matrix (see Ma, Heritier and
Lo (2008)). Currently, the first and second order penalty matrices are available
for the |
order |
an integer specifying the order of the |
kappa |
a value larger than 1 used in the fitting algorithm to decrease the step size
when the penalised likelihood doesn't increase during the iterative process.
Default is |
epsilon |
a vector of 2 values indicating the minimum distance from 1 and from 0 for -
respectively - the survival function and the baseline parameter estimates in order to
avoid problems with logarithms in the fitting algorithm .
Default is |
ties |
a character string indicating a method to handle duplicated outcomes when defining the
knots sequence (see |
seed |
|
a list containing the values of each of the above arguments (except n.obs
).
Dominique-Laurent Couturier, Maurizio Manuguerra
Ma, J. and Heritier, S. and Lo, S. (2014), On the Maximum Penalised Likelihood Approach for Proportional Hazard Models with Right Censored Survival Data. Computational Statistics and Data Analysis 74, 142-156.
Moore, T. J. and Sadler, B. M. and Kozick R. J. (2008), Maximum-Likelihood Estimation, the Cramer-Rao Bound, and the Method of Scoring With Parameter Constraints, IEEE Transactions On Signal Processing 56, 3, 895-907.
Ramsay, J. O. (1988), Monotone Regression Splines in Action, Statistical Science 3, 4, 425-441.
This class of objects is returned by the coxph_mpl
class of functions
to represent a proportional hazards model fitted by maximum penalised likelihood.
Objects of this class have methods for the functions print
,
summary
, plot
, residuals
and predict
.
All components described under Arguments must be included in a legitimate
coxph_mpl
object.
coef |
a list of length 2 containg the parameter estimates of each model part.
The first list, named |
se |
a list of length 2 containg the parameter standard errors of each model part.
The first list, named |
covar |
a list of length 5 containg the ( |
ploglik |
a vector of length 2. The first element is the penalised log-likelihood with the final values of the coefficients. (The second element is a correction factor for the baseline hazard parameters due to the use of a centered X matrix in the estimation process.) |
iter |
a vector of length 3 indicating the number of iterations used to estimate the
smoothing parameter (first value, equal to |
knots |
list of length 3 to 4 containg parameters of the chosen basis: |
control |
Object of class |
dim |
a list of length 5 with following elements: |
call |
the matched call. |
data |
a list of length 3 with following elements: |
Dominique-Laurent Couturier, Maurizio Manuguerra
coxph_mpl
, summary.coxph_mpl
, coef.coxph_mpl
,
plot.coxph_mpl
,residuals.coxph_mpl
and predict.coxph_mpl
.
Plot the bases used to estimate the baseline hazard parameters, as well as
the estimate and confidence interval of the baseline hazard, cumulative
baseline hazard and baseline survival functions (plots are selectable by
which
).
## S3 method for class 'coxph_mpl' plot(x, se="M2QM2", ask=TRUE, which=1:4, upper.quantile=.95,...)
## S3 method for class 'coxph_mpl' plot(x, se="M2QM2", ask=TRUE, which=1:4, upper.quantile=.95,...)
x |
an object inheriting from class |
se |
an inference method (to build confidence intevals for the baseline hazard,
cumulative baseline hazard and baseline survival functions).
Possibilites are |
ask |
logical. If |
which |
integer vector indicating the list of wished plots. If a subset of the plots
is required, specify a subset of the numbers |
upper.quantile |
quantile of the model response defining the upper limit of the x-axis of the
plots of the baseline hazard, cumulative baseline hazard and baseline survival
functions. Default is |
... |
other parameters to be passed through to plotting functions. |
In the first plot, the bases corresponding to zero (or close to zero) estimates
appear in dashed line. An estimate is considered as a zero if it is smaller than
min.Theta
(See coxph_mpl.control
).
Confidence intervals for the baseline hazard, cumulative baseline hazard and baseline survival functions are obtained using the delta method.
Dominique-Laurent Couturier, Maurizio Manuguerra
coxph_mpl
, coxph_mpl.control
,
coxph_mpl.object
and summary.coxph_mpl
.
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) par(mfrow=c(2,2)) plot(fit_mpl, ask=FALSE, cex.main=.75) ## End(Not run)
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) par(mfrow=c(2,2)) plot(fit_mpl, ask=FALSE, cex.main=.75) ## End(Not run)
Compute (and plot) predictions of instantaneous risk and of probability of survival
for a model fitted by coxph_mpl
.
## S3 method for class 'coxph_mpl' predict(object,se="M2QM2",type="risk",i=NULL,time=NULL,upper.quantile=.95,...) ## S3 method for class 'predict.coxph_mpl' plot(x,...)
## S3 method for class 'coxph_mpl' predict(object,se="M2QM2",type="risk",i=NULL,time=NULL,upper.quantile=.95,...) ## S3 method for class 'predict.coxph_mpl' plot(x,...)
object |
an object inheriting from class |
se |
a character string indicating a method to build confidence intevals for the predictions.
Possibilites are |
type |
character string indicating the type of wished predictions. Possibilies are |
i |
an integer indicating the covariate vector of interest (i.e., line of the
X matrix). If |
time |
a double-precision vector indicating at which time the preditions should be computed.
If |
upper.quantile |
quantile of the model response defining the upper limit of the x-axis of the
plot of the predictions. This argument is passed through to
|
x |
an object inheriting from class |
... |
other parameters to be passed through to printing or plotting functions. |
The available predictions incorporate the baseline hazard
(instantaneous risk) or cumulated baseline hazard estimate (survival function)
and are thus absolute instead of relative (see predict.coxph
).
Prediction standard errors and confidence intervals are obtained by use of the delta method.
In the plots, the confidence intervals are forced to belong to the parameter
range, which is for instantaneous risk, and
for survival probabilities.
a data.frame of class predict.coxph_mpl
with following columns:
'time'
, the prediction time (as defined in argument 'time'
);
'risk'
or 'survival'
, the wished predictions; 'se'
,
the standard error of each prediction; 'lower'
and 'upper'
,
the lower and upper bound of the prediction confidence interval.
Dominique-Laurent Couturier, Maurizio Manuguerra
coxph_mpl
, coxph_mpl.control
,
coxph_mpl.object
, residuals.coxph_mpl
and
summary.coxph_mpl
.
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) plot(predict(fit_mpl)) ## End(Not run)
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) plot(predict(fit_mpl)) ## End(Not run)
Compute martingale and Cox and Snell residuals for a model fitted
by coxph_mpl
. Return objects are of class
residuals.coxph_mpl
and have methods for plot
.
## S3 method for class 'coxph_mpl' residuals(object, ...) ## S3 method for class 'residuals.coxph_mpl' plot(x, ask=TRUE, which=1:2, upper.quantile=.95, ...)
## S3 method for class 'coxph_mpl' residuals(object, ...) ## S3 method for class 'residuals.coxph_mpl' plot(x, ask=TRUE, which=1:2, upper.quantile=.95, ...)
object |
an object inheriting from class |
x |
an object inheriting from class |
ask |
logical. If |
which |
integer vector indicating the list of wished plots. If a subset of the plots
is required, specify a subset of the numbers |
upper.quantile |
quantile of the Cox and Snell residuals used when |
... |
other parameters to be passed through to plotting or printing functions. |
Refer to Collet (2003, Chapter 4) for a review of model check in the Cox regression model, and specifically to Farrington (2000) for an overview on residuals with interval-censored survival data.
For object of class residuals.coxph_mpl
, the available residual plots
are, respectively, the martingale residual plot (which==1
) and
the Cox and Snell residual plot (which==2
).
A data.frame of class residuals.coxph_mpl
of rows
with following columns:
'time1'
, the model outcome (with a random noise
added to event ties if ties=='epsilon'
in coxph_mpl.control
);
'time2'
, ending time of the interval for interval censored data only (unused otherwise);
'censoring'
, the status indicator as in the Surv()
function, i.e. 0=right censored, 1=event at time, 2=left censored, 3=interval censored;
'coxsnell'
, the Cox and Snell residuals;
'martingale'
, the martingale residuals.
Dominique-Laurent Couturier, Maurizio Manuguerra
Farrington C.P. (2000), Residuals for Proportional Hazard Models with Interval-Censored Data, Biometrics 56, 473-482.
Collett, D. (2003), and Moeschberger, M. L. (2003), Modelling Survival Data in Medical Research, Chapman and All.
coxph_mpl
, coxph_mpl.control
,
coxph_mpl.object
, predict.coxph_mpl
and
summary.coxph_mpl
.
## Not run: ### lung data of the survival package (see ?lung) data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) par(mfrow=c(1,2)) plot(residuals(fit_mpl), which=1:2, ask=FALSE) ## End(Not run)
## Not run: ### lung data of the survival package (see ?lung) data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) par(mfrow=c(1,2)) plot(residuals(fit_mpl), which=1:2, ask=FALSE) ## End(Not run)
Additional information about the Cox proportional hazard model fit represented
by object
is extracted and included in the returned object, which
is suitable for printing with the generic print
function. The generic
coef
function will extract the matrix of coefficients of interest
with standard errors, -statistics and
-values.
See
coef.summary.coxph_mpl
.
Only the baseline hazard parameters larger than min.Theta
(see
coxph_mpl.control
) are reported.
## S3 method for class 'coxph_mpl' summary(object, se="M2QM2", full=FALSE, ...) ## S3 method for class 'summary.coxph_mpl' print(x, se="M2QM2", ...)
## S3 method for class 'coxph_mpl' summary(object, se="M2QM2", full=FALSE, ...) ## S3 method for class 'summary.coxph_mpl' print(x, se="M2QM2", ...)
object |
In an object inheriting from class |
se |
an inference method. Possibilites are |
full |
logical. If |
x |
an object inheriting from class |
... |
Other arguments passed through to printing functions. |
an object of class summary.coxph_mpl
representing the fit and additional
information.
Beta |
a matrix of |
Theta |
If |
inf |
a list of elements extracted from the object of class |
Dominique-Laurent Couturier, Maurizio Manuguerra
coxph_mpl
, coxph_mpl.control
,
coxph_mpl.object
and plot.coxph_mpl
.
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) summary(fit_mpl, full = TRUE) summary(fit_mpl, se = "M2HM2") ## End(Not run)
## Not run: data(lung) fit_mpl <- coxph_mpl(Surv(time, status == 2) ~ age + sex + ph.karno + wt.loss, data = lung) summary(fit_mpl, full = TRUE) summary(fit_mpl, se = "M2HM2") ## End(Not run)