CoxModel[…]
represents the symbolic proportional hazards model obtained from CoxModelFit.
CoxModel
CoxModel[…]
represents the symbolic proportional hazards model obtained from CoxModelFit.
Details and Options
- Properties of a Cox model are obtained from CoxModel[…]["property"].
- CoxModel[…][{prop1,prop2,…}] gives several properties.
- CoxModel[…][x0][t] gives the value of the best-fit function at a particular point t for covariate levels x0.
- Normal gives the expression for the baseline survival function in a CoxModel.
- CoxModel[…][prop,ann] gives the annotation ann associated with the property prop.
- Possible properties available for a given type of fitted model are listed on the pages for functions such as CoxModelFit that generate the model.
- CoxModel takes the following options:
-
ConfidenceLevel 
confidence level to use for parameters and predictions ConfidenceRange All range for simultaneous confidence bands ConfidenceTransform "LogLog" confidence transform to use
Examples
open all close allBasic Examples (1)
Create a CoxModel from some right-censored data:
data = EventData[{1, 2, 3, 4}, {0, 0, 1, 0}];mod = CoxModelFit[data]Extract a property from the model:
mod["EventTimes"]Evaluate the baseline survival function at 3:
mod[3]Scope (6)
Extract a property from a CoxModel object:
mod = CoxModelFit[{1, 2, 3, 4}]The standard errors for the baseline survival function:
mod["StandardErrors"][]mod = CoxModelFit[{1, 2, 3, 4}]mod[{"MartingaleResiduals", "CoxSnellResiduals"}]Obtain a list of available properties:
mod = CoxModelFit[{1, 2, 3, 4}]mod["Properties"]Evaluate the baseline survival function at a point:
mod = CoxModelFit[{1, 2, 3, 4}];mod[2]mod /@ {1, 2, 3, 4}Use Normal to obtain an expression for the baseline survival function:
mod = CoxModelFit[{1, 2, 3, 4}];Normal[mod]mod = CoxModelFit[{1, 2, 3, 4}];Table[Row[{i, ":
", mod["BaselineList", i]}], {i, {"Description", "LongDescription"}}]//TableFormOptions (5)
ConfidenceLevel (3)
The confidence level can be changed after fitting:
ξ = {{67, 1}, {11, 0}, {32, 0}, {50, 1}, {65, 1}, {44, 1}, {20, 1}, {26, 0}, {69, 1}, {50, 1}, {25, 1}, {18, 0}, {63, 1}, {41, 0}, {30, 0}, {32, 1}, {46, 1}, {35, 0}, {33, 0}, {22, 0}};
e = EventData[Automatic, {{8, 22, 6, 4, 12, 11, 2, 34, 25, 15, 8, 6, 34, 6, 32, 1, 15, 9, 9, 6},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0}, None}];model = CoxModelFit[{ξ, e}, {Subscript[x, 1], Subscript[x, 2]}, {Subscript[x, 1], Subscript[x, 2]}]Plots of baseline survival with pointwise confidence bands:
Table[Plot[Evaluate@{model["SF"][][t], model["PointwiseBands", "SF", ConfidenceLevel -> i][][t]}, {t, 0, 35}, PlotLabel -> i], {i, {.9, .95, .99}}]Change the confidence level for parameter confidence intervals:
ξ = {{67, 1}, {11, 0}, {32, 0}, {50, 1}, {65, 1}, {44, 1}, {20, 1}, {26, 0}, {69, 1}, {50, 1}, {25, 1}, {18, 0}, {63, 1}, {41, 0}, {30, 0}, {32, 1}, {46, 1}, {35, 0}, {33, 0}, {22, 0}};
e = EventData[Automatic, {{8, 22, 6, 4, 12, 11, 2, 34, 25, 15, 8, 6, 34, 6, 32, 1, 15, 9, 9, 6},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0}, None}];model = CoxModelFit[{ξ, e}, {Subscript[x, 1], Subscript[x, 2]}, {Subscript[x, 1], Subscript[x, 2]}];model["ParameterConfidenceIntervals"]The level can be changed after fitting:
Table[model["ParameterConfidenceIntervals", ConfidenceLevel -> i], {i, {.85, .9, .95}}]Specify confidence level in summary tables:
ξ = {{67, 1}, {11, 0}, {32, 0}, {50, 1}, {65, 1}, {44, 1}, {20, 1}, {26, 0}, {69, 1}, {50, 1}, {25, 1}, {18, 0}, {63, 1}, {41, 0}, {30, 0}, {32, 1}, {46, 1}, {35, 0}, {33, 0}, {22, 0}};model = CoxModelFit[{ξ, EventData[Automatic, {{8, 22, 6, 4, 12, 11, 2, 34, 25, 15, 8, 6, 34, 6, 32, 1, 15, 9, 9, 6},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0}, None}]}, {Subscript[x, 1], Subscript[x, 2]}, {Subscript[x, 1], Subscript[x, 2]}]Summarize the cumulative hazard function with 90% confidence limits:
model["EventTable", "CHF", ConfidenceLevel -> .90][{50, 1}]ConfidenceRange (1)
Set the confidence range for simultaneous intervals and bands:
model = CoxModelFit[EventData[Automatic, {{{2081, Infinity}, {1602, Infinity}, {1496, Infinity}, {1462, Infinity},
{1433, Infinity}, {1377, Infinity}, {1330, Infinity}, {996, Infinity}, {226, Infinity},
{1199, Infinity}, {1111, Infinity}, {530, Infinity}, {1182, Infinity}, {1167, Infinity}, 418,
383, 276, 104, 609, 172, 487, 662, 194, 230, 526, 122, 129, 74, 122, 86, 466, 192, 109, 55, 1,
107, 110, 332}, None, None}]]The bands are only defined over the confidence range:
Plot[Evaluate@{model["SF"][][x], model["EqualPrecisionBands", ConfidenceRange -> {172, 383}][][x]}, {x, 100, 500}, PlotRange -> {0, 1}]By default, the range is set to All:
Plot[Evaluate@{model["SF"][][x], model["EqualPrecisionBands", ConfidenceRange -> All][][x]}, {x, 0, 2081}, PlotRange -> {0, 1}]Set the range to Full:
Plot[Evaluate@{model["SF"][][x], model["EqualPrecisionBands", ConfidenceRange -> Full][][x]}, {x, 0, 2081}, PlotRange -> {0, 1}]ConfidenceTransform (1)
Apply transformations to confidence intervals and bands:
ξ = {1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0};model = CoxModelFit[{ξ, EventData[Automatic, {{8, 22, 6, 4, 12, 11, 2, 34, 25, 15, 8, 6, 34, 6, 32, 1, 15, 9, 9, 6},
{0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0}, None}]}, x, x]A collection of available transforms:
tr = {"Linear", "LogLog", "ArcSinSqrt", "Log", "Logit"};Bands for survival function at time 15:
Table[{i, model["PointwiseBands", "SF", ConfidenceTransform -> i][][15]}, {i, tr}]//GridTable[Plot[Evaluate@{model["SF"][][t], model["PointwiseBands", "SF",
ConfidenceTransform -> i][][t]}, {t, 0, 35}, PlotLabel -> i], {i, tr}]"LogLog" bands and intervals are used by default:
model["PointwiseBands", ConfidenceTransform -> "LogLog"][{0}][15]model["PointwiseBands"][{0}][15]Related Guides
History
Text
Wolfram Research (2012), CoxModel, Wolfram Language function, https://reference.wolfram.com/language/ref/CoxModel.html.
CMS
Wolfram Language. 2012. "CoxModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CoxModel.html.
APA
Wolfram Language. (2012). CoxModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CoxModel.html
BibTeX
@misc{reference.wolfram_2026_coxmodel, author="Wolfram Research", title="{CoxModel}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CoxModel.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_coxmodel, organization={Wolfram Research}, title={CoxModel}, year={2012}, url={https://reference.wolfram.com/language/ref/CoxModel.html}, note=[Accessed: 13-June-2026]}