Statistics & probability

Cox proportional hazards regression calculator with right censoring

Fit a Cox proportional-hazards model to right-censored observations and estimate covariate hazard ratios.

Your numbers

Comma-separated follow-up times in one shared positive time unit.
1 = event observed; 0 = right censored.
One predictor row per subject; do not add an intercept column.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Fit a Cox proportional-hazards model to right-censored observations and estimate covariate hazard ratios. The output also builds a Breslow baseline cumulative hazard, giving a useful separation between a relative hazard effect and an estimated survival curve.

THE FORMULAℓ(β)=Σ_event_times[Σ_events xᵢ·β−d_t log Σ_(j:T_j≥t) exp(xⱼ·β)]; HR_j=exp(β_j).

A worked example

The 36 prefilled subjects have one predictor taking −1, 0 or 1 and both observed events and right censoring. The fitted coefficient is approximately -0.028560, so a one-unit predictor increase multiplies the fitted hazard by 0.971844. It does not multiply a survival probability by that number.

Good to know

20–200 subjects; 1–3 finite predictors without an intercept; positive times and binary status. Constant-coefficient Cox model, Breslow tied-event likelihood and Newton fit. Reject separation, singular information, unstable predictors or nonconvergence. Baseline curve is right-continuous after each event time. No left truncation, strata, time-dependent covariates, confidence intervals or proportional-hazards test.

Start with risk sets rather than a binary outcome

A censored subject contributes information until the recorded follow-up ends. At an observed event time, the model compares the subject who experienced the event with everyone still at risk. This is why simply classifying subjects as event versus no event loses essential timing information.

The input time must mean the same thing for every subject, such as days since enrollment. The status indicator says whether the event happened at that time or whether observation ended without that event. A zero status does not mean the subject can never experience it.

Relative hazard and baseline survival are different outputsFollow-up timeBreslow fitHR ≈ 0.9718x = 0 and x = 1
Scroll across to see the full diagram.
The 36 prefilled subjects have one predictor taking −1, 0 or 1 and both observed events and right censoring. The fitted coefficient is approximately -0.028560, so a one-unit predictor increase multiplies the fitted hazard by 0.971844. It does not multiply a survival probability by that number.

Compare this with the Kaplan Meier survival from censored observations calculator. Kaplan–Meier gives an unadjusted survival curve, not covariate hazard ratios.

A hazard ratio is a relative rate at a given time

The coefficient multiplies a predictor inside an exponential, making the hazard ratio for a one-unit increase exp(β). A predictor measured in tens instead of single units consequently has a different numerical coefficient even when its fitted predictions express the same relationship.

The proportional-hazards assumption makes that ratio constant over follow-up. It does not imply equal survival curves, a constant absolute hazard, or a causal treatment effect. The calculator estimates within the assumption and does not test whether the assumption is appropriate for the submitted data.

Breslow ties use the whole pre-event risk set

Several events can share one recorded time because measurements are rounded or events are genuinely simultaneous. The Breslow convention repeats the same risk-set log denominator for each event at that time, producing a specific approximation to the tied-event partial likelihood.

Subjects censored at the shared time remain in the pre-event risk set before removal. Other tie conventions can produce different coefficients. Record the convention when comparing an independently fitted model; a difference from an Efron fit is not automatically a software error.

The prefilled coefficient has a concrete interpretation

The example includes 36 follow-up records and three levels of one predictor. Its fitted coefficient is about -0.0286. Exponentiating gives a hazard multiplier about 0.9718 for the change from predictor zero to predictor one.

The baseline survival corresponds to predictor zero. Survival for predictor value x uses exp(−H₀(t)exp(xβ)), so its change is nonlinear in both time and predictor value. Dividing two survival probabilities would not recover the hazard ratio used by this model.

The score and information help diagnose the fit

Newton updates use the partial-likelihood score and observed information. The page checks that the final score is small and that the information matrix is numerically positive definite, which helps reject unidentified columns and unresolved likelihood limits.

A small score only demonstrates numerical convergence within the specified model and data. It does not demonstrate adequate sample size, correct measurement, independent censoring or external predictive accuracy. Those scientific and design questions remain separate from solving the likelihood equations.

Separation can prevent a finite answer

If predictors perfectly separate the ordering of observed events and risk sets, the likelihood may improve while a coefficient diverges. Returning a large arbitrary coefficient at an iteration cap would disguise that failure as a precise estimate.

The implementation instead rejects unresolved line searches, singular information and coefficients outside its finite bounds. Predictor rescaling can help numerical conditioning, but it does not repair a genuinely unbounded likelihood or create event information that the data do not contain.

Keep the baseline curve within observed follow-up

The estimated cumulative baseline hazard increases at observed event times. It remains unchanged between those times and after the final observed event in the displayed step representation, because the fit supplies no additional event increments there.

That flat final step is not a forecast that risk disappears. Do not extrapolate a nonparametric tail into an unsupported future period or interpret the fitted association as a personalized medical recommendation. Any applied use needs subject-matter review and appropriate validation.

A few questions, answered

Why is there no intercept?

A separate intercept is absorbed into the unspecified baseline hazard and is not identified by this Cox partial likelihood.

What does status zero mean?

The record is right censored: the event was not observed before that follow-up ended.

Which tie convention is used?

Breslow ties, with events processed before censoring removals at the same recorded time.

Does a hazard ratio multiply survival probability?

No. It multiplies the instantaneous hazard under proportional hazards; survival uses the estimated cumulative baseline hazard.

Find your calculator

Start typing to explore the library.