Learn R Programming

survMisc (version 0.5.4)

rsq: r^2 measures for a a coxph or survfit model

Description

r^2 measures for a a coxph or survfit model

Usage

rsq(x, ...)

# S3 method for coxph rsq(x, ..., sigD = 2)

# S3 method for survfit rsq(x, ..., sigD = 2)

Arguments

x

A survfit or coxph object.

sigD

significant digits (for ease of display). If sigD=NULL, will return the original numbers.

...

Additional arguments (not implemented).

Value

A list with the following elements:

cod

The coefficient of determination, which is $$R^2=1-\exp(\frac{2}{n}L_0-L_1)$$ where \(L_0\) and \(L_1\) are the log partial likelihoods for the null and full models respectively and \(n\) is the number of observations in the data set.

mer

The measure of explained randomness, which is: $$R^2_{mer}=1-\exp(\frac{2}{m}L_0-L_1)$$ where \(m\) is the number of observed events.

mev

The measure of explained variation (similar to that for linear regression), which is: $$R^2=\frac{R^2_{mer}}{R^2_{mer} + \frac{\pi}{6}(1-R^2_{mer})}$$

References

Nagelkerke NJD, 1991. A Note on a General Definition of the Coefficient of Determination. Biometrika 78(3):691--92. JSTOR

O'Quigley J, Xu R, Stare J, 2005. Explained randomness in proportional hazards models. Stat Med 24(3):479--89. Wiley (paywall) Available at UCSD

Royston P, 2006. Explained variation for survival models. The Stata Journal 6(1):83--96. The Stata Journal

Examples

Run this code
# NOT RUN {
data("kidney", package="KMsurv")
c1 <- coxph(Surv(time=time, event=delta) ~ type, data=kidney)
cbind(rsq(c1), rsq(c1, sigD=NULL))
# }

Run the code above in your browser using DataLab