Step 15: Model specification check
Now, we will perform model diagnostics to check if the multiple regression model is correctly specified. Before performing the tests for model diagnostics, we need to specify for which model the diagnostics should be performed for. Therefore we need to perform the analysis of our full model before the model diagnostics. We use the “quietly” option in our command to suppress the output.
| Note For more review, re-visit Model diagnostics. |
quietly stcox i.depression i.mothereduc i.famtype i.sex i.support if pop==1, noshow |
linktest |

As we can see from the output, _hat is statistically significant (P=0.000) and _hatsq is not (P=0.410). This tells us that the model is correctly specified.
| Note For more review, re-visit Link test. |
Step 16: Multicollinearity check
Examine whether the multiple regression model has an issue with multicollinearity.
estat vce, corr |

The correlations are all less than 0.7 and also more than -0.7. This tells us that there is no problem with multicollinearity.
| Note For more review, re-visit Correlation matrix. |
Step 17: Proportional hazards assumption
Examine if the proportional hazards assumption holds, both for the x-variable depression (based on the multiple regression model) and for the multiple regression model as a whole.
quietly stcox i.depression i.mothereduc i.famtype i.sex i.support if pop==1, noshow |
stphplot, by(depression) |

| Note For more review, re-visit Log-log plot of survival. |
stcoxkm, by(depression) |
The lines seem to be parallel from around 1.5 years.

The predicted curves overlap perfectly with the observed curves regarding the children whose mothers did not have postpartum depression. In the children whose mothers did have postpartum depression the lines are not perfectly aligned, but this might be due to the fact that there are few observations.
estat phtest, detail |

The global test (p=3.41) suggests that the model does not violate the proportionality assumption. All the other individual variables also show a p-value above 0.05.
| Note For more review, re-visit Schoenfeld residuals. |
| Note Now, all the diagnostics in this example looked great, and this is of course not always the case. If you do find a problem with multicollinearity, the proportional hazards assumption, or other diagnostic tests, first of all, don’t panic! But most of all, don’t hesitate to discuss this with your supervisor. Not all tests will be relevant to your analysis. |