# Proportional hazard assumption: graphical approach vs subsampling

Hopefully someone can guide me on the following. I have a large dataset (> 151k firms with multiple observations per firm). My dataset looks at firm failure using counting process style and my independent variables are gender, age & nationality diversity and team size. These variables can vary over time (but I wouldn't call it time-dependent yet as time itself does not cause a team to change in composition but over time a team can change).

When trying to asses the proportional hazard assumption I'm a bit puzzled by the results.

Using Schoenfeld residuals I see the assumption is violated (significance p< 0.001), but graphically my line is horizontal for my independent variables (edit: when looking at the slope it's slightly different from 0, eg. 0,007).

However, when I perform a Cox analysis based on different subsamples in time (eg. a subsample looking at quarter 0 to quarter 10 of the firms, the next subsample quarter 11 to 20, etc. up until quarter 31 to 40 of the firms), I see quite some differences between the Hazard Ratios. Which makes me think the assumption would not hold.

As a note, the subsamples do differ in size as some firms do not survive up until the 10-year/40-quarter mark.

Sample 1: cox analysis if quarter = 0-10 --> N = 157K subjects, 23K failures

Sample 2: cox analysis if quarter = 11-20 --> N = 133K subjects, 49K failures

Sample 3: cox analysis if quarter = 21-30 --> N = 83K subjects, 28K failures

Sample 4: cox analysis if quarter = 31-40 --> N = 55K subjects, 18K failures

For example for gender diversity in quarter 0-10 the hazard ratio (HR) = .2, for quarter 31-40 the hazard ratio (HR) = .98

How would I interpret the above results/handle this issue. Thanks in advance for your help and time!

Best regards, Laura

Edit: I forgot to mention I am currently using STATA as my statistical software program

• By any chance, are you using the survminer package to generate the plots of scaled Schoenfeld residuals versus time? Earlier versions of that package had a serious bug that led to greatly expanded y-axis scales, which in turn made it hard to evaluate the curve shapes Try using the standard survival package for plots instead and see if it makes a difference.
– EdM
Commented Sep 13, 2023 at 20:48
• Hi, sorry I forgot to mention, I am using STATA not R, and using the stcox and estat phtest commands for the (scaled) schoenfeld residuals. But thanks for the info! Commented Sep 14, 2023 at 6:32
• Note that generally tests with large samples are very sensitive and will easily reject a model assumption even if it is only very lightly violated. This doesn't necessarily mean that an analysis based on that assumption is invalid. The subsamples observation is maybe more worrying but it also depends on the sizes of these subsamples and maybe more details of the data and situation that are not explained (it's hard to make sense of things like "Y0-Y2" if you don't say what this means; don't assume readers will guess what your notation means). Commented Sep 20, 2023 at 8:22
• @ChristianHennig, thank you I have edited the question to add more detail. Indeed the subsamples would lead me to believe that given the large changes in the hazard ratio's, the PH assumption does not hold even though visually the line in the plot appears horizontal (more for some covariates then others, but I'm not sure where to draw the line when it comes to a 0 degree slope for the assumption). Commented Sep 20, 2023 at 12:10
• "for gender diversity in quarter 0-10 the HR = .2, for quarter 31-40 the HR = .98" - as long as you have all variables in the model and not only gender diversity, computing a HR specifically for gender diversity (or any other single variable) isn't very informative, because this will also depend on how the other variables are related to gender diversity. Therefore it wouldn't necessarily have to be constant. (I'm assuming I understand what you mean by "HR for gender diversity" here but I'm not 100% sure.) Commented Sep 20, 2023 at 14:12