Cox Regression

Estimate how predictors change the hazard of an event over time, with censored data.

Cox proportional hazards regression models the time until an event — death, relapse, dropout, machine failure — as a function of one or more predictors. Like Kaplan–Meier analysis, it handles censored cases: people who had not experienced the event when the study ended still contribute the time they were observed. Unlike Kaplan–Meier, it can adjust for several predictors at once, including continuous ones such as age.

Each predictor's effect is expressed as a hazard ratio (HR). An HR of 0.50 for a treatment means that at any point in time, treated patients experience the event at half the rate of the reference group. An HR above 1 means a higher hazard. The model makes no assumption about the shape of the baseline hazard.

StatRyx fits the model with Efron's method for tied event times (the default in R's coxph). It reports, for each predictor, B, SE, z, p, the hazard ratio and its 95% confidence interval, the reference level for categorical predictors, the number of events, the likelihood-ratio test for the whole model and the concordance index (how well the model ranks who has the event first).

The key assumption is proportional hazards: each predictor's hazard ratio is constant over time. StatRyx tests it per predictor using Schoenfeld residuals and flags any violation. The data need a time column and an event column (1 = event occurred, 0 = censored).

When to use the Cox Regression

When not to use it

Worked example

PredictorBSEHR95% CIp
New drug (vs Control)-0.6840.2190.51[0.33, 0.78].002
Age0.0030.0101.00[0.98, 1.02].772

How to report it (APA 7)

A Cox proportional hazards regression (N = 160, 89 events) showed that patients on the new drug had a lower hazard of death than controls, HR = 0.51, 95% CI [0.33, 0.78], p = .002, adjusting for age, HR = 1.00, 95% CI [0.98, 1.02], p = .772. The model was significant, χ²(2) = 10.10, p = .006, concordance = .59. Schoenfeld residuals showed no violation of proportional hazards.

Frequently asked questions

Is Cox regression free on StatRyx?

Yes. You can run it without an account (3 free analyses), and a free account adds 10 more — a one-time allowance, no payment needed. Every result includes the APA 7 write-up. Paid plans (Student from $9/month) add more analyses and Word, PDF and Excel export.

How do I report a Cox regression in APA 7?

Give N and the number of events, then each predictor's hazard ratio with its 95% CI and p, the overall model test and how proportional hazards were checked: "HR = 0.51, 95% CI [0.33, 0.78], p = .002."

How do I interpret a hazard ratio?

An HR of 1 means no difference in hazard. An HR of 0.51 means the event happens at about half the rate in that group at any given time; an HR of 2 means twice the rate. For a continuous predictor, the HR applies to a one-unit increase.

What is the difference between Cox regression and Kaplan–Meier?

Kaplan–Meier describes survival curves and tests group differences with the log-rank test, without covariates. Cox regression estimates hazard ratios and can adjust for several predictors, including continuous ones.

How is the proportional-hazards assumption checked?

StatRyx tests each predictor with Schoenfeld residuals. A significant test means that predictor's hazard ratio changes over time, so a single HR does not describe it well.

Run a Cox Regression on your data →

Related analyses