Estimate Cox-Snell R2 using AUC
pmsampsize_r2.RdEstimates 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.
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
#>