Fitting the Cox Model
What you'll learn: How the Cox proportional hazards model is actually estimated from data and put into practice using software.
Understanding Partial Likelihood Estimation
Unlike ordinary regression models that use standard maximum likelihood, the Cox model uses a clever trick called partial likelihood estimation. This method was developed because the Cox model doesn't specify the baseline hazard function—it lets the data speak for itself about the shape of that baseline.
Here's the intuition: at each time an event occurs, the partial likelihood asks, "Given that someone had the event right now, what's the probability it was this particular person rather than someone else still at risk?" It compares the hazard for the person who experienced the event to the hazards of everyone in the risk set at that moment.
This calculation repeats for every event time, and the product of all these conditional probabilities forms the partial likelihood. Maximizing this partial likelihood gives us estimates of the regression coefficients (the log hazard ratios for our covariates).
Fitting in Software
In practice, you don't calculate this by hand. Statistical software handles the optimization using numerical methods similar to logistic regression. You provide:
- Time-to-event data
- Event indicator (1 = event occurred, 0 = censored)
- Covariates (the variables you believe affect survival)
The software then estimates the coefficients, standard errors, and p-values. You can interpret these coefficients as log hazard ratios—exponentiate them to get the actual hazard ratios you learned about in the previous lesson.
Why This Matters
Partial likelihood lets you estimate covariate effects without making strong assumptions about the baseline hazard's shape. This flexibility is what makes the Cox model so powerful and widely used in survival analysis.
Key Takeaway: The Cox model is fit using partial likelihood estimation, which compares observed events to the risk set at each event time; software handles the complex optimization automatically, giving you interpretable hazard ratios.