Continuous and Categorical Predictors
What you'll learn: How to include both continuous and categorical variables in Cox models and interpret their effects on survival hazard.
The Two Types of Predictors
The Cox proportional hazards model is flexible enough to handle different types of predictors simultaneously. Continuous predictors (like age, blood pressure, or income) take numerical values along a scale, while categorical predictors (like treatment group, gender, or risk category) represent distinct groups.
How Each Type Works in the Model
Continuous predictors affect the hazard ratio incrementally. If age has a coefficient of 0.05, each additional year increases the log-hazard by 0.05, meaning the hazard ratio is exp(0.05) ≈ 1.051 per year. A 10-year difference would yield a hazard ratio of exp(0.05 × 10) ≈ 1.65.
Categorical predictors are encoded using dummy variables (one fewer than the number of categories). If you have three treatment groups (A, B, C), you'd create two dummy variables. One group becomes the reference (baseline), and coefficients show how other groups compare to it. A coefficient of 0.40 for Treatment B means the hazard is exp(0.40) ≈ 1.49 times higher than the reference group.
Interpreting Combined Models
When your Cox model includes both types, interpret each coefficient while holding others constant. For example, with age (continuous) and treatment (categorical):
- Age coefficient = 0.03 → each year increases hazard by 3%, regardless of treatment
- Treatment B coefficient = -0.50 → Treatment B reduces hazard by exp(-0.50) ≈ 0.61 compared to reference, regardless of age
Think of it like a recipe: continuous variables adjust the outcome smoothly (like turning a dial), while categorical variables create distinct step-changes (like flipping switches).
Key Takeaway: Cox models accommodate both continuous predictors (interpreted per unit change) and categorical predictors (interpreted relative to a reference group), allowing you to assess multiple risk factors simultaneously in survival analysis.