coxr2: R-Squared under the Cox model

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Calculate the R-squared, aka explained randomness, based on the partial likelihood ratio statistic under the Cox model.

Usage

1
2
##object is the result of a 'coxph'
coxr2(object)

Arguments

object

The result of a coxph fit

Details

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.

Value

nevent

number of uncensored events

logtest

partial likelihood ratio test statistics

rsq

explained randomness

Author(s)

Hyeri You, Rounghui Xu

References

John O'Quigley, Ronghui Xu and Janez Stare, (2005), Explained randomness in proportional hazards models, STATISTICS IN MEDICINE, 24:479-489.

See Also

coxph, summary.coxph

Examples

1
2
3
4
5
6
7
8
9
# 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)

Example output

Loading required package: survival
$nevent
[1] 5

$logtest
     test        df    pvalue 
2.4292291 1.0000000 0.1190915 

$rsq
      rsq 
0.3848233 

CoxR2 documentation built on March 19, 2020, 5:11 p.m.

Related to coxr2 in CoxR2...