summary.internal_validate: Summarize a internal_validate object

View source: R/validate.R

summary.internal_validateR Documentation

Summarize a internal_validate object

Description

Summarize a internal_validate object

Usage

## S3 method for class '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 4 columns (apparent score, optimism, bias-corrected score, number of successful resamples/folds) and one row per score. Not all methods produce an optimism estimate so this row may be all NA. If confidence intervals have been added for all measures via confint.internal_validate, two additional columns containing lower and upper bounds for bias-corrected performance.

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)
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)
summary(m1_iv)


pminternal documentation built on April 4, 2025, 3:30 a.m.