Calculating the Hazard Ratio for a Cox-regression model stratified by a variable (R)

I have built a Cox-regression model for 6 month mortality. When I created the original Kaplan–Meier curve, grouped by my variable of interest (hospital-acquired infection, Present vs Absent) the lines crossed – suggesting non-proportionality if used in a Cox regression model [subsequently confirmed via Schoenfeld residuals).

Therefore, I created a stratified Cox-regression model (adjusted for age):

coxph(Surv(Time, Status) ~ age + strata(HAI), data = survival)

The resultant summary of the above function, provides only co-efficients for age.

However, the co-efficient (and hence hazard ratio) I am interested in is for the stratified variable.

I appreciate stratification gives different baseline hazard ratios, but is there a way to generate a given HR for HAI?

Cross Validated Asked by FrenchToast on November 14, 2021

2 Answers

2 Answers

In general one cannot stratify by a variable and report its effect.

Consider trying the restricted mean survival time, which can handle situations where the proportional hazards assumption does not hold. Obtaining adjusted measures using this method is complicated, but possible.

Answered by Todd D on November 14, 2021

If there aren't proportional hazards then no single hazard ratio adequately summarizes the results. The hazard ratio between the two groups is changing with time.

A vignette for the R survival package on time-dependent survival models covers both time-dependent covariates and how to deal with time-dependent coefficients/hazard ratios. Start there for ideas about handling specific time periods differently (which might have a reasonable rationale for HAI) or developing a function of time informed by the changes in scaled Schoenfeld residuals over time.

A couple more notes. For one, it's possible that some of your problem might be coming from important predictors that aren't included in your model. I suspect that there are many variables besides age and HAI that contribute to mortality. You often want to include as many predictor variables as possible as you can in a Cox model without overfitting the data. Also, there's a little ambiguity in the way you phrased the question: you do a Cox regression but speak of "6-month mortality," which sounds more like a logistic regression. Does that mean simply that you didn't collect data longer than 6 months from study entry for an individual (however you defined the study entry time)?

Answered by EdM on November 14, 2021

Add your own answers!

Related Questions

Eacf table interpretation in R

2  Asked on December 8, 2020


What is the difference between $beta_1$ and $hat{beta}_1$?

3  Asked on December 8, 2020 by stan-shunpike


Check if residuals are IID (timeseries)

4  Asked on December 5, 2020 by mgr


ARIMA model with multiple covariates, XREG

1  Asked on December 3, 2020 by bromideh


ARIMA(0,0,0) model but residuals not white noise

0  Asked on November 30, 2020 by mathias-schinnerup-hejberg


Ask a Question

Get help from others!

© 2021 All rights reserved.