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?


1 Answer 1


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


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.

  • $\begingroup$ Thanks. I think this triggered some understanding. If I read survfit.coxph correctly, your formula above will produce a survival curve based on the mean of each covariate. If I use newdata to formulate a loan where each variable is 0, the exponentiated regression part will equal out to 1 and I'll have the baseline hazard function, correct? Thanks for your insight! $\endgroup$
    – Roger S.
    Mar 27, 2017 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.