coxphfplot: Plot the Penalized Profile Likelhood Function

View source: R/coxphfplot.R

coxphfplotR Documentation

Plot the Penalized Profile Likelhood Function

Description

Plots the penalized profile likelihood for a specified parameter.

Usage

coxphfplot(
  formula,
  data,
  profile,
  pitch = 0.05,
  limits,
  alpha = 0.05,
  maxit = 50,
  maxhs = 5,
  epsilon = 1e-06,
  maxstep = 0.5,
  firth = TRUE,
  penalty = 0.5,
  adapt = NULL,
  legend = "center",
  ...
)

Arguments

formula

a formula object, with the response on the left of the operator, and the model terms on the right. The response must be a survival object as returned by the 'Surv' function.

data

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

profile

a righthand formula specifying the plotted parameter, interaction or general term, e.g. ~ A or ~ A : C.

pitch

distances between the interpolated points in standard errors of the parameter estimate, the default value is 0.05.

limits

the range of the x-axis in terms of standard errors from the parameter estimate. The default values are the extremes of both confidence intervals, Wald and PL, plus or minus half a standard error, respectively.

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 penalized log 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 2.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.

penalty

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.

adapt

strength of Firth-type penalty. Defaults to 0.5.

legend

if FALSE, legends in the plot would be omitted (default is TRUE).

...

other parameters to legend

Details

This function plots the profile (penalized) log likelihood of the specified parameter. A symmetric shape of the profile (penalized) log likelihood (PPL) function allows use of Wald intervals, while an asymmetric shape demands profile (penalized) likelihood intervals (Heinze & Schemper (2001)).

Value

A matrix of dimension m \times 3, with m = 1/\code{pitch} + 1. With the default settings, m=101. The column headers are:

std

the distance from the parameter estimate in standard errors

x

the parameter value

log-likelihood

the profile likelihood at x

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.

Examples

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)
profplot<-coxphfplot(sim, formula=Surv(time,cens)~x, profile=~x)


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