Log-log plot of survival

The log-log plot of survival plots the curve for each category of any categorical x-variable versus ln(analysis time). If the curves are parallel, the proportional hazards assumption is not violated.

Note It is possible to adjust for additional x-variables. However, for the sake of simplicity, we will just run simple regression models for our categorical variables.

More information
help stphplot

Practical example

The first step is re-run a Cox regression model. We will start with the simple one that we did for sex. The quietly option is included in the beginning of the command to suppress the output. After this, we use the stphplot command.

quietly stcox sex if pop_cox==1, noshow
stphplot, by(sex)

Apart from the very beginning of the curves, they look quite parallel.

We can produce the curves also for our variable marstat40. The quietly option is included in the beginning of the command to suppress the output.

quietly stcox ib1.marstat40 if pop_cox==1, noshow

Then we use the stphplot command.

stphplot, by(marstat40)

These curves look quite messy. Apart from the very beginning of the curves, the ones for married and unmarried look parallel, as do the ones for married and divorced. The widowed look worse – most likely due to the small size of the group (with few cases).