# What is the “$R^2$” value given in the summary of a coxph model in R

What is the $R^2$ value given in the summary of a coxph model in R? For example,

Rsquare= 0.186   (max possible= 0.991 )


I foolishly included it a manuscript as an $R^2$ value and the reviewer jumped on it saying he wasn't aware of an analogue of the $R^2$ statistic from the classic linear regression being developed for the Cox model and if there was one please provide a reference. Any help would be great!

-
In most situations where the concept of $R^2$ is extended beyond classical linear regression, it is the squared correlation between the observed values and those predicted under the model. Could that possibly be applicable here? – Macro Jun 19 '12 at 12:54

Using getS3method("summary","coxph") you can look at how it is calculated.

The relevant code lines are the following:

logtest <- -2 * (cox$loglik[1] - cox$loglik[2])
rval$rsq <- c(rsq = 1 - exp(-logtest/cox$n), maxrsq = 1 -
exp(2 * cox$loglik[1]/cox$n))


Here cox$loglik is "a vector of length 2 containing the log-likelihood with the initial values and with the final values of the coefficients" (see ?coxph.object) and cox$n is "number of observations used in the fit".

-
If I'm not mistaken, that's the Cox & Snell pseudo R-squared. For explanation & comparision of various pseudo R-squareds, see ats.ucla.edu/stat/mult_pkg/faq/general/psuedo_rsquareds.htm . – onestop Jun 19 '12 at 14:16