This function calcultates the $R^2$ coefficient of OQuigley and Flandre (1994) to evaluate the predictive capacity of the proportional hazards model (or Cox model).
Usage
R2(formula, data)
Arguments
formula
A formula object or character string with the time and censoring status separated by "+" on the left hand side and the covariates separated by "+" on the right. For instance, if the time name is "Time", the censoring status is "Status" and the covariates
data
A data.frame with the data. The censoring status should be 1 for failure and 0 for censoring. No missing data accepted.
Value
If one covariate Z is present in the model, the$R^2$coefficient is$$R^2=1-\frac{\sum(Zi-E_b(Zi))^2}{\sum(Zi-E_0(Zi))^2},$$where the sums are over the failures.$E_b(Zi)$is the expectation of$Z$at the ith failure time under the model of parameter$b$= the maximum partial likelihood estimator of the regression coefficient.$E_0(Zi)$is the expectation of$Z$under the model of parameter 0 at the ith failure time.
If several covariates are present in the model, the$R^2$coefficient is evaluated as in the previous case except that the covariate Z is replaced by the prognostic index$b'Z$.
Details
The program does not handle ties in the data. We suggest to randomly split the ties before using the program.
References
OQuigley, J. (2008) Proportional hazards regression. Springer New-York. Chapter 12.
OQuigley J, Flandre P. (1994) Predictive capability of proportional hazards regression. PNAS91, 2310-2314.