Skip to contents

Estimates the Cox-Snell R2 from a reported C-statistic of a prediction model for a binary outcome. Useful for sample size calculation as seen in pmsampsize::pmsampsize.

Usage

pmsampsize_r2(auc, prop, n = 1e+06)

Arguments

auc

A numeric for the existing model's reported AUC.

prop

A numeric for the outcome proportion.

n

An integer for the simulation size.

Value

A list with two elements: R2 Nagelkerke and R2 Cox-Snell estimates.

References

Riley, R. D., Calster, B., & Collins, G. S. (2020). A note on estimating the Cox-Snell R 2 from a reported C statistic ( AUROC ) to inform sample size calculations for developing a prediction model with a binary outcome. Statistics in Medicine. https://doi.org/10.1002/sim.8806

Riley, R. D., Snell, K. I., Ensor, J., Burke, D. L., Harrell Jr, F. E., Moons, K. G., & Collins, G. S. (2018). Minimum sample size for developing a multivariable prediction model: PART II - binary and time-to-event outcomes. Statistics in Medicine. https://doi.org/10.1002/sim.7992

Examples


#----------------------------------------------------------------------------
# pmsampsize_r2() examples
#----------------------------------------------------------------------------
library(bkstat)

set.seed(1234)
pmsampsize_r2(auc = 0.81, prop = 0.77, n = 1000000)
#> $R2.nagelkerke
#> [1] 0.3183689
#> 
#> $R2.coxsnell
#> [1] 0.2100957
#>