constructs a model of the baseline hazard for events times ei.


constructs a Cox model of the form , where the fi depend on the xk.

Details and Options

  • CoxModelFit is used in survival, reliability, and duration analysis. It quantifies relative survival risk and estimates an underlying baseline hazard.
  • CoxModelFit returns a symbolic CoxModel object to represent the proportional hazards model it constructs. The properties and diagnostics of the model can be obtained from model["property"].
  • A list of available model properties can be obtained using model["Properties"].
  • The form of events ei follows the form used in EventData.
  • CoxModelFit produces a conditional hazard function proportional to the baseline hazard function .
  • The model is semiparametric, with parameters found by maximizing a partial likelihood. The baseline hazard is estimated using nonparametric methods.
  • A null model that only estimates can be specified using CoxModelFit[e], which is equivalent to CoxModelFit[{ξ,e},{},{x1,,xp}].
  • Constant values specified in the basis functions fi are ignored in the fitting and absorbed in the estimation of the baseline hazard .
  • The following tables of properties pertain to the estimates, diagnostics, and testing of the parametric components of the model.
  • Properties related to data and the fitted function obtained using model["property"] include:
  • "BaselineList"list containing baseline covariate levels for each stratum
    "BasisFunctions"list of basis functions
    "BestFitParameters"parameter estimates
    "Data"the matrix of covariate input data
    "EventData"the event input data
    "RelativeRisk"relative risk for the model parameters
    "StrataModels"list containing submodels for each stratum
    "StrataSummary"list containing name and count pairings for each stratum
  • Properties that measure goodness of fit include:
  • "AIC"Akaike information criterion
    "BIC"SchwartzBayes information criterion
    "LogLikelihood"model log likelihood
    "MaxRSquared"maximum possible coefficient
    "RSquared"pseudo coefficient of determination
  • Types of residuals and influence measures:
  • "BetaDifferences"DFBETAs measure of influence on parameter values
    "CoxSnellResiduals"CoxSnell type residuals
    "DevianceResiduals"scaled Martingale residuals
    "MartingaleResiduals"estimate of the excess number of events over time
    "ScaledBetaDifferences"DFBETAs computed using the model standard deviation
    "SchoenfeldResiduals"Schoenfeld-type residuals
    "ScoreResiduals"score residuals
  • Properties and diagnostics for parameter estimates include:
  • "CovarianceMatrix"covariance estimate for model parameters
    "InformationMatrix"information matrix for model parameters
    "LikelihoodRatioStatistic"likelihood ratio of fitted model to the null model
    "ParameterConfidenceIntervals"confidence intervals about the parameter estimates
    "ParameterStandardErrors"standard errors of model parameters
    "ParameterTable"table of fitted parameter information
    "ParameterTableEntries"entries in the parameter table
    "RelativeRiskConfidenceIntervals"confidence intervals about relative risk estimates
    "RiskScores"risk scores for each observation
    "ScoreStatistic"score statistic comparing fitted and null models
    "TestTable"table of significance information for model parameters
    "TestTableEntries"entries from the test table
    "TestTableEntriesFunction"entries from table created with test table function
    "TestTableFunction"creates a test table under a specified null hypothesis
    "WaldStatistic"Wald statistic comparing fitted and null models
  • As in SurvivalModelFit, it is possible to obtain information about the nonparametric component of the model , including estimates of survival probabilities, survival confidence intervals, and moment estimates.
  • CoxModelFit has all of the properties available to SurvivalModelFit.
  • Properties related to are specified as in SurvivalModelFit, but additionally require that the covariate level x0 be given as model["property"][x0].
  • Different functional forms of the hazard rate for covariate levels x0 can be obtained by specifying the form h in model[h][x0]. The following forms can be used.
  • "CDF"cumulative distribution function
    "CHF"cumulative hazard function
    "SF"survival function
  • The value of the fitted function h from CoxModelFit at a particular point t and covariate levels x0 can be found from model[h][x0][t]. model[h][][t] gives the form h of the baseline hazard h0[t].
  • Specifying Normal[model] gives a pure function form of model["SF"][][t].
  • CoxModelFit takes the following options:
  • ConfidenceLevel95/100level to use for intervals and bands
    ConfidenceRangeAllrange for simultaneous confidence bands
    ConfidenceTransform"LogLog"confidence transform to use
    MethodAutomaticmethod to use for model fitting
    NominalVariablesNonevariables considered as categorical
    StrataVariablesNonevariables considered as strata
    WorkingPrecisionAutomaticprecision used in internal computations
  • With ConfidenceLevel->p, probability-p confidence intervals and bands are computed for the various functional forms and parameter estimates.
  • ConfidenceRange->{tmin,tmax} gives probability-p simultaneous confidence intervals and bands for the fitted function between tmin and tmax.
  • Possible settings for ConfidenceTransform include "Linear", "LogLog", "ArcSinSqrt", "Log", "Logit", or a pure function g.
  • The setting Method->m specifies the method for handling ties. Possible settings include the following.
  • "Breslow"use Breslow's partial likelihood
    "Efron"use Efron's partial likelihood
    "Exact"use the exact marginal likelihood
  • By default, the "Breslow" method is used for handling ties.
  • Additional method settings can be found in the options section of examples.


open all close all

Basic Examples  (1)

Fit a Cox proportional hazards model to some data with right-censored event times:

Click for copyable input
Click for copyable input

Summarize parameter estimates:

Click for copyable input

Survival estimates at each covariate level:

Click for copyable input

Test overall model significance:

Click for copyable input

Scope  (26)

Options  (13)

Applications  (5)

Properties & Relations  (4)

Introduced in 2012