Skip to contents

Summarize a internal_validate object

Usage

# S3 method for internal_validate
summary(object, ignore_scores = "^cal_plot", ...)

Arguments

object

created by call to validate

ignore_scores

a string used to identify scores to omit from summary. score_binary produces scores with prefix 'cal_plot' when a calibration plot is desired (see cal_plot) and these are ignored by default.

...

ignored

Value

a data.frame with 3 rows (apparent score, optimism, bias-corrected score) and one column per score. Not all methods produce an optimism estimate so this row may be all NA.

Examples

library(pminternal)
set.seed(456)
# simulate data with two predictors that interact
dat <- pmcalibration::sim_dat(N = 2000, a1 = -2, a3 = -.3)
mean(dat$y)
#> [1] 0.1985
dat$LP <- NULL # remove linear predictor

# fit a (misspecified) logistic regression model
m1 <- glm(y ~ ., data=dat, family="binomial")

# internal validation of m1 via bootstrap optimism with 10 resamples
# B = 10 for example but should be >= 200 in practice
m1_iv <- validate(m1, method="boot_optimism", B=10)
#> It is recommended that B >= 200 for bootstrap validation
summary(m1_iv)
#>                C   Brier Intercept   Slope   Eavg    E50    E90   Emax    ECI
#> Apparent  0.7779  0.1335     0.000 1.00000 0.0076 0.0064 0.0115  0.058  0.011
#> Optimism  0.0016 -0.0011    -0.019 0.00083 0.0052 0.0038 0.0088  0.078  0.037
#> Corrected 0.7764  0.1346     0.019 0.99917 0.0024 0.0026 0.0027 -0.020 -0.026