Title: | R-Squared Measure Based on Partial LR Statistic, for the Cox PH Regression Model |
---|---|
Description: | Calculate the R-squared, aka explained randomness, based on the partial likelihood ratio statistic under the Cox Proportional Hazard model [J O'Quigley, R Xu, J Stare (2005) <doi:10.1002/sim.1946>]. |
Authors: | Hyeri You, Ronghui Xu |
Maintainer: | Hyeri You <[email protected]> |
License: | GPL-2 |
Version: | 1.0 |
Built: | 2024-11-09 02:51:12 UTC |
Source: | https://github.com/cran/CoxR2 |
Calculate the R-squared, aka explained randomness, based on the partial likelihood ratio statistic under the Cox model.
##object is the result of a 'coxph' coxr2(object)
##object is the result of a 'coxph' coxr2(object)
object |
The result of a coxph fit |
Calculate the R-squared based on the partial likelihood ratio statistic under the Cox model. Difference in log partial likelihoods between the fitted model and the null model with no regressors is divided by the number of uncensored events, while the existing summary function divides it by the number of total observations.
nevent |
number of uncensored events |
logtest |
partial likelihood ratio test statistics |
rsq |
explained randomness |
Hyeri You, Rounghui Xu
John O'Quigley, Ronghui Xu and Janez Stare, (2005), Explained randomness in proportional hazards models, STATISTICS IN MEDICINE, 24:479-489.
coxph, summary.coxph
# Create the simplest test data set test <- list(time=c(4,3,1,1,2,2,3), event =c(1,1,1,0,1,1,0), x =c(5,2,1,1,1,5,5)) # Fit a Cox model coxmodel <- coxph(Surv(time, event ) ~ x , test) coxr2(coxmodel)
# Create the simplest test data set test <- list(time=c(4,3,1,1,2,2,3), event =c(1,1,1,0,1,1,0), x =c(5,2,1,1,1,5,5)) # Fit a Cox model coxmodel <- coxph(Surv(time, event ) ~ x , test) coxr2(coxmodel)