# Underlying Hazard Function in Cox PH analysis

I’m working with a very large data set of auto loans (and monthly performance) to analyze the likelihood of default or prepayment based on different borrower or loan characteristics or macroeconomic factors. I’ve developed cox proportional hazard models in R that seem to fit well.

I would like to use the model to break out the absolute (not proportional/relative) survival curves for different subsets of the book to understand how they differ & to model cash-flows. I’d also like to stress test economic indices using the same (ie. based on what we saw, if interest rates go up the absolute probability of default on this block changes by x on time 0 through t).

I’ve read that once the cox PH coefficients are solved, non-parametric methods can be used to estimate the underlying/base hazard function. Could anyone please give a hint on how to accomplish this in R?

Example model:

loan_data <- data.frame (loan_id, credit_score, value, pmt_period, loan_age, unemployment_index, current, term)

survobj <- Surv(loan_age – 1, loan_age, current = 0)
model <- coxph(survobs ~ credit_score  + unemployment_index  + strata(term))


From here I have coefficients and can study relative hazard… what’s the best approach to estimating baseline hazard?

An estimate of the baseline survival function $S_0(t)=\exp(-\int_0^t h_0(u)du)$ can be computed by doing
survfit(model)

See the help page of survfit.coxph for more details. To compute an estimates of the survival function for specific covariate values $S_0(t)^{\exp{\beta'x}}$, use the newdata argument. This should be a data.frame containing the same variables as the fitted model and produces separate survival curve estimates for each row in the data.frame.