SPSS command: SPSS COXREG

Cox regression in your browser

Cox regression models how covariates change the hazard, the instantaneous risk of the event, without assuming a shape for the baseline survival curve.

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs the SPSS COXREG procedure on your device with Breslow handling of tied times, indicator-coded categorical covariates, optional strata, hazard ratios Exp(B) with 95% intervals and the survival function at the covariate means.

  • The hazard ratio Exp(B) for each covariate: how much the risk of the event is multiplied per unit, holding the others constant.
  • Whether the covariates together improve on a model with none, by the score and likelihood-ratio chi-square tests.
  • A Wald test per coefficient and, for categorical covariates with several levels, a joint test of the whole term.
  • The estimated survival curve and cumulative hazard for a case at the average of every covariate.

When to use it

Use it when

  • Time-to-event outcomes with censoring where you want to adjust a group comparison for age, severity or other covariates.
  • Estimating the effect of a continuous predictor, such as dose or monthly spend, on the risk of an event.
  • Baseline risk differs by site or cohort: put that variable in Strata so each stratum gets its own baseline hazard.

Use something else when

  • Hazards clearly cross over time (one group is worse early and better late): the proportional hazards assumption fails; compare Kaplan-Meier curves or split follow-up into periods.
  • You need interaction terms between ordinary covariates: compute the product first and enter it as a covariate.
  • There is no time dimension, only whether the event happened: use binary logistic regression.
  • Survey data with sampling weights, strata and clusters: use Complex Samples Cox regression.

How to run it in Crosstabs

  1. 01

    Open your data

    Open a file with one row per case and switch to Statistics mode.

  2. 02

    Choose Cox Regression

    In the Survival group, pick Cox Regression (COXREG).

  3. 03

    Set Time, Status and the event value

    Choose the Time and Status variables and the Value indicating the event has occurred.

  4. 04

    Choose covariates

    Tick up to 12 Covariates. Under Categorical covariates (indicator coding, last category is the reference), tick the ones to dummy-code; text variables and nominal variables are ticked by default.

  5. 05

    Add strata if needed

    Choose a Strata (optional) variable to fit a separate baseline hazard per level while sharing the coefficients.

  6. 06

    Choose a plot and run

    Set Plot to Survival or Hazard (cumulative) at the covariate means, declare any weight as a frequency weight, and press Run.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Try with example data

Data

120 synthetic patients alternately assigned to a drug or placebo, with age drawn from a normal distribution (mean 60, SD 10). Survival times follow an exponential model in which the hazard rises 3% per year of age and is 40% lower on the drug; follow-up stops at 36 months. Fixed seed.

Case Processing Summary
ItemNPercent
Event7865.0%
Censored4235.0%
Total120100.0%
Omnibus Tests of Model Coefficients
-2 Log LikelihoodOverall (score) Chi-squaredfSig.Change From Previous Step Chi-squaredfSig.
651.27229.0682<.00129.0272<.001

Beginning block -2 Log Likelihood: 680.300. Ties are handled with Breslow's method.

Variables in the Equation
ItemBSEWalddfSig.Exp(B)95% CI for Exp(B)
age0.0280.0134.4661.0351.0281.002 – 1.055
treatment(1)−1.2310.24824.6201<.0010.2920.180 – 0.475

treatment: indicator coding; (1) = Drug; reference = Placebo.

How to read it

The model is significant overall (likelihood-ratio χ²(2) = 29.03, p < .001). Holding age constant, the drug multiplies the hazard by Exp(B) = 0.292 (95% CI 0.180 – 0.475), and each additional year of age multiplies it by 1.028 (95% CI 1.002 – 1.055). A hazard ratio below 1 means a lower instantaneous risk of the event, not a fixed difference in survival time.

Output tables explained

Case Processing Summary
Events, censored cases and totals with percentages. As a rule of thumb, aim for at least ten events per coefficient.
Step Summary
With a stepwise method: the starting model, then each covariate entered (score statistic) or removed (conditional, LR or Wald statistic) with the model's -2 log likelihood and its change from the previous step.
Omnibus Tests of Model Coefficients
-2 log likelihood of the fitted model, the overall score chi-square, and the likelihood-ratio change from the empty model, each with df and significance. The beginning-block -2LL is in the footnote.
Variables in the Equation
B, SE, Wald, df, significance, Exp(B) and its 95% confidence interval for each coefficient; multi-level categorical terms get an extra joint-test row. Footnotes list the indicator coding and reference category.
Covariate Means
The (weighted) mean of every design column, including dummy columns; the survival table is evaluated at these values.
Survival Table
At each event time: baseline cumulative hazard (all covariates 0), survival at the covariate means with its SE, and cumulative hazard at the means; one block per stratum.

Assumptions and notes

  • Proportional hazards: each covariate multiplies the hazard by the same factor at every time point.
  • Continuous covariates act linearly on the log hazard; transform or categorise them if that is implausible.
  • Censoring is non-informative given the covariates, and observations are independent.
  • Enough events and no covariate that perfectly separates event times; otherwise the coefficients diverge and the panel reports it.

How the results are validated

On a 150-case reference file with a continuous and a three-level covariate, coefficients and standard errors match statsmodels 0.15 PHReg and R survival 3.8.12 coxph (Breslow ties) to 1e-7, unweighted and with case weights; -2LL and the score chi-square match to 1e-9; the Kalbfleisch-Prentice survival at the covariate means and its SE match R to 1e-7; a stratified fit matches coxph with strata() to 1e-7. Forward and backward stepwise selection with conditional, LR and Wald removal follows an independent R survival stepping implementation step for step (statistics within 1e-6), and a time-dependent covariate x·ln(T_) matches coxph with tt() to 1e-6. Validation evidence

Questions

How do I interpret Exp(B)?

It is the hazard ratio. Exp(B) = 0.70 for a treatment indicator means treated cases have 30% lower instantaneous risk at any time than the reference category, other covariates held constant. For a continuous covariate it is the ratio per one-unit increase.

Which category is the reference?

The last category in sorted order, as in SPSS's default indicator coding. Recode the variable if you want a different reference; the footnote under Variables in the Equation lists the coding.

Score test or likelihood-ratio test?

Both test all coefficients at once and usually agree. The likelihood-ratio test (Change From Previous Step) is generally preferred in small samples; the score test needs no iteration.

How are tied event times handled?

With Breslow's approximation, the method SPSS uses. With many ties the Efron method can give slightly different estimates, which is why results may differ a little from software that defaults to Efron.

Is the dataset sent anywhere?

No. The model is fitted in your browser, which suits clinical or customer data that must stay on your machine.

Run Cox Regression on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.