Cox's Proportional Hazards Model

We continue our analysis of the cancer relapse data used for Kaplan-Meier.
This is the dataset used as an example in Cox's original paper:
Cox, D.R. (1972) Regression Models and Life tables, (with discussion)
Journal of the Royal Statistical Society, 34: 187--220.
(This is a slightly revised and shorter version of a handout used
in my survival analysis short course.)

Stata reports hazard ratios (exponentiated coefficients) by default.
Here we see that treatment reduces the risk of relapse by 78%
at any duration. To obtain the coefficients you can use the
nohr option, or with just one type

. di _b[treated]
-1.5091914

Treatment of Ties

Stata has several ways of handling ties. Cox's original proposal
is called exactp for exact partial likelihood.
An alternative is exactm for the exact marginal
likelihood. Both are computationally intensive.
A good approximation is efron, due to Efron.
The default is breslow, due to Breslow and Peto.
Let us compare all four

As you can see, Efron's approximation is pretty good. Cox reports
-1.65 in his paper, a value he obtained by evaluating the partial
likelihood over a grid of points. Stata's more exact calculation
yields -16.3, so Cox did pretty well with a grid.

Proportionality of Hazards

There are many ways of testing proportionality of hazard.
Here we will let the trestment indicator interact with time
linearly. We use tvc(treatment) to indicate
that we want treatment as a time-varying covariate, and
texp(_t) to specify a linear interaction with time

We estimate a 72% reduction in risk in the first ten weeks and
an additional 42% reduction later (for a total of 84%).
However, the difference is not significant; we have no
evidence that the treatment effect is not proportional.

Baseline Survival

Stata can compute the baseline hazard using a Kaplan-Meier-like
estimate (using the estimated relative risks as weights) using
the basesurv option. (It can also compute an
estimate of the baseline hazard due to Nelson and Aalen.
This is avaiable via the basech option. This
is very similar to negative log of the Kaplan-Meier estimate.)

We use the option to compute the baseline survival, save it
in a variable called S0, and then raise it to the
relative risk to get survival in the treated group, which we
call S1

Hazard Plot

One can also use graphs to test proportionality of hazards.
This is best done by plotting the estimated cumiulative hazards,
which should be parallel. (This is because the eye is much better
at judging whether lines are parallel than at judging whether they
are proportional.) Stata can do this automatically via the
stphplot command

Notes

There are several tests for comparing survival in different groups,
the best known being Hantel-Maenzsel, which is closely related to
Cox regression with a dummy variable.

The partial likelihood estimator illustrated here is appropiate for
continuous data, with few if any ties.
Many demographic applications use survival models appropriate for
discrete data (using a logit model) or for
grouped continuous data (using a Poisson model).
These approaches are easy to implement except for computing events
and exposure,
and we will have opportunity to illustrate those calculations
using demographic survey data.

(c) 1994-2014
Germán Rodríguez,
Office of Population Research, Princeton University