coxphf: Cox Regression with Firth's Penalized Likelihood

View source: R/coxphf.R

coxphfR Documentation

Cox Regression with Firth's Penalized Likelihood

Description

Implements Firth's penalized maximum likelihood bias reduction method for Cox regression which has been shown to provide a solution in case of monotone likelihood (nonconvergence of likelihood function). The program fits profile penalized likelihood confidence intervals which were proved to outperform Wald confidence intervals.

Usage

coxphf(
  formula,
  data,
  pl = TRUE,
  alpha = 0.05,
  maxit = 50,
  maxhs = 5,
  epsilon = 1e-06,
  gconv = 1e-04,
  maxstep = 0.5,
  firth = TRUE,
  adapt = NULL,
  penalty = 0.5
)

Arguments

formula

a formula object, with the response on the left and the model terms on the right. The response must be a survival object as returned by the 'Surv' function (see its documentation in the survival package)

data

a data.frame in which to interpret the variables named in the 'formula' argument.

pl

specifies if confidence intervals and tests should be based on the profile penalized log likelihood (pl=TRUE, the default) or on the Wald method (pl=FALSE).

alpha

the significance level (1-\alpha = the confidence level), 0.05 as default.

maxit

maximum number of iterations (default value is 50)

maxhs

maximum number of step-halvings per iterations (default value is 5). The increments of the parameter vector in one Newton-Rhaphson iteration step are halved, unless the new likelihood is greater than the old one, maximally doing maxhs halvings.

epsilon

specifies the maximum allowed change in standardized parameter estimates to declare convergence. Default value is 1e-6.

gconv

specifies the maximum allowed absolute value of first derivative of likelihood to declare convergence. Default value is 0.0001.

maxstep

specifies the maximum change of (standardized) parameter values allowed in one iteration. Default value is 0.5.

firth

use of Firth's penalized maximum likelihood (firth=TRUE, default) or the standard maximum likelihood method (firth=FALSE) for fitting the Cox model.

adapt

optional: specifies a vector of 1s and 0s, where 0 means that the corresponding parameter is fixed at 0, while 1 enables parameter estimation for that parameter. The length of adapt must be equal to the number of parameters to be estimated.

penalty

strength of Firth-type penalty. Defaults to 0.5.

Details

The phenomenon of monotone likelihood in a sample causes parameter estimates of a Cox model to diverge, with infinite standard errors. Therefore, classical maximum likelihood analysis fails; the usual Wald confidence intervals cover the whole range of real numbers. Monotone likelihood appears if there is single covariate or a linear combination of covariates such that at each event time, out of all individuals being at risk at that time, the individual with the highest (or at each event time the individual with the lowest) value for that covariate or linear combination experiences the event. It was shown that analysis by Firth's penalized likelihood method, particularly in conjunction with the computation of profile likelihood confidence intervals and penalized likelihood ratio tests is superior to maximum likelihood analysis. It completely removes the convergence problem mentioned in the paragraph on CONVERGENCE of the description of the function coxph. The formula may involve time-dependent effects or time-dependent covariates. The response may be given in counting process style, but it cannot be used for multivariate failure times, as the program has no option to fit a robust covariance matrix. The user is responsible for the independency of observations within each risk set, i.e., the same individual should not appear twice within the same risk set.

Value

The object returned is of the class coxphf and has the following attributes:

coefficients

the parameter estimates

alpha

the significance level = 1 - confidence level

var

the estimated covariance matrix

df

the degrees of freedom

loglik

the null and maximimized (penalized) log likelihood

method.ties

the ties handling method

iter

the number of iterations needed to converge

n

the number of observations

y

the response

formula

the model formula

means

the means of the covariates

linear.predictors

the linear predictors

method

the estimation method (Standard ML or Penalized ML)

method.ci

the confidence interval estimation method (Profile Likelihood or Wald)

ci.lower

the lower confidence limits

ci.upper

the upper confidence limits

prob

the p-values

call

the function call

terms

the terms object used

iter.ci

the numbers of iterations needed for profile likelihood confidence interval estimation, and for maximizing the restricted likelihood for p-value computation.

Author(s)

Georg Heinze and Meinhard Ploner

References

Firth D (1993). Bias reduction of maximum likelihood estimates. Biometrika 80:27–38.

Heinze G and Schemper M (2001). A Solution to the Problem of Monotone Likelihood in Cox Regression. Biometrics 57(1):114–119.

Heinze G (1999). Technical Report 10/1999: The application of Firth's procedure to Cox and logistic regression. Section of Clinical Biometrics, Department of Medical Computer Sciences, University of Vienna, Vienna.

See Also

[coxphfplot, coxphftest]

Examples

# fixed covariate and monotone likelihood
library(survival)
time<-c(1,2,3)
cens<-c(1,1,1)
x<-c(1,1,0)
sim<-cbind(time,cens,x)
sim<-data.frame(sim)
coxphf(sim, formula=Surv(time,cens)~x) #convergence attained!
#coxph(sim, formula=Surv(time,cens)~x)  #no convergence!
# time-dependent covariate
test2 <- data.frame(list(start=c(1, 2, 5, 2, 1, 7, 3, 4, 8, 8),
                         stop =c(2, 3, 6, 7, 8, 9, 9, 9,14,17),
                         event=c(1, 1, 1, 1, 1, 1, 1, 0, 0, 0),
                         x    =c(1, 0, 0, 1, 0, 1, 1, 1, 0, 0) ))

summary( coxphf( formula=Surv(start, stop, event) ~ x, pl=FALSE, data=test2))


# time-dependent effect
# the coxphf function can handle interactions of a (fixed or time-dependent)
# covariate with time
# such that the hazard ratio can be expressed as a function of time

summary(coxphf(formula=Surv(start, stop, event)~x+x:log(stop), data=test2, pl=FALSE, firth=TRUE))

# note that coxph would treat x:log(stop) as a fixed covariate
# (computed before the iteration process)
# coxphf treats x:log(stop) as a time-dependent covariate which changes (
# for the same individual!) over time


# time-dependent effect with monotone likelihood

test3 <- data.frame(list(start=c(1, 2, 5, 2, 1, 7, 3, 4, 8, 8),
                         stop =c(2, 3, 6, 7, 8, 9, 9, 9,14,17),
                         event=c(1, 0, 0, 1, 0, 1, 1, 0, 0, 0),
                         x    =c(1, 0, 0, 1, 0, 1, 1, 1, 0, 0) ))

summary( coxphf( formula=Surv(start, stop, event) ~ x+x:log(stop), pl=FALSE, maxit=400, data=test3))


# no convergence if option "firth" is turned off: 
# summary( coxphf(formula=Surv(start, stop, event) ~ x+x:log(stop), pl=F,
#                 data=test3, firth=FALSE)


data(breast)
fit.breast<-coxphf(data=breast, Surv(TIME,CENS)~T+N+G+CD)
summary(fit.breast)


coxphf documentation built on Aug. 11, 2023, 5:06 p.m.