# How to get beta coefficients for reference group in Cox proportional hazards regression model survival analysis (R or other)?

The model was calculated using the coxph and survival functions from the survival package (R). Each of nine variables was set as categorical with a reference strata.The criterion was the survival object, comprised of time at risk and mortality status. Time at risk was calculated as the time elapsed from the time of exposure to the right censoring date, which was either the end of the sampling frame or the date of death. Mortality status was either false (for survivors) or true (for decedents).

This produces the independent contributions of strata from each level (excluding the reference stratum). My question is whether there is a method (potentially with dummy coding) to calculate the beta coefficients also for the reference strata? This would overcome the limitation of this analysis, which is the arbitrary selection of reference strata.

I’m assuming that when you say “reference stratum” you mean the reference level of a categorical predictor. (The word “strata” in Cox models technically refers to groups that are allowed to have different baseline hazards/survival functions but might share coefficients for predictors.)

The regression coefficient for the reference level of a categorical predictor is 0, for a hazard ratio of 1. For a model like yours where all predictors are categorical, you can define the baseline hazard to give the survival curve when all predictors are at their reference levels. That’s not really different in principle from any regression model with only categorical predictors, where the intercept is the predicted outcome when all are at their reference levels.

Although the choice of reference level might be arbitrary, the predicted survival based on any particular set of categorical predictor values will be the same regardless of reference-level choice. There is no practical limitation resulting from the need to choose one level as reference.

• Thanks, EdM. "For a model like yours where all predictors are categorical, you can define the baseline hazard to give the survival curve when all predictors are at their reference levels." How is this achieved? Also, "That’s not really different in principle from any regression model with only categorical predictors, where the intercept is the predicted outcome when all are at their reference levels." - do mean "analogous" - logistic regression assumes a constant effect over time whereas the Cox model does not. Aug 5 '21 at 23:45
• @phineas this answer describes how to get the cumulative baseline hazard (with just categorical predictors, the cumulative hazard with all at their reference levels) over time, $\hat H_0(t)$, for a Cox model. Hazard ratios for other predictor levels then just multiply this baseline hazard, and the estimated survival over time is $\hat S(t)=\exp(-\hat H(t))$.
– EdM
Aug 6 '21 at 2:32
• @phineas the analogy is between baseline hazard and intercepts in other regressions. In Cox models, coefficients are log-hazard differences from baseline hazard, the hazard when all predictors are at reference levels (or at 0 for continuous predictors). In logistic regression, they are difference in log-odds from the intercept, the log-odds when all predictors are at reference levels (or at 0 for continuous predictors). My point is that regression coefficients represent difference from some baseline in both cases--baseline survival over time for Cox, baseline log-odds for logistic.
– EdM
Aug 6 '21 at 2:40