Learn R Programming

rmsb (version 1.1-1)

blrmStats: Compute Indexes of Predictive Accuracy and Their Uncertainties

Description

For a binary or ordinal logistic regression fit from blrm(), computes several indexes of predictive accuracy along with highest posterior density intervals for them. Optionally plots their posterior densities. When there are more than two levels of the outcome variable, computes Somers' Dxy and c-index on a random sample of 10,000 observations.

Usage

blrmStats(fit, ns = 400, prob = 0.95, pl = FALSE, dist = c("density", "hist"))

Value

list of class blrmStats whose most important element is Stats. The indexes computed are defined below, with gp, B, EV, and vp computed using the intercept corresponding to the median value of Y. See https://fharrell.com/post/addvalue for more information.

"Dxy"

Somers' Dxy rank correlation between predicted and observed. The concordance probability (c-index; AUROC in the binary Y case) may be obtained from the relationship Dxy=2(c-0.5).

"g"

Gini's mean difference: the average absolute difference over all pairs of linear predictor values

"gp"

Gini's mean difference on the predicted probability scale

"B"

Brier score

"EV"

explained variation

"v"

variance of linear predictor

"vp"

variable of estimated probabilities

Arguments

fit

an object produced by blrm()

ns

number of posterior draws to use in the calculations (default is 400)

prob

HPD interval probability (default is 0.95)

pl

set to TRUE to plot the posterior densities using base graphics

dist

if pl is TRUE specifies whether to plot the density estimate (the default) or a histogram

Author

Frank Harrell

See Also

Examples

Run this code
if (FALSE) {
  f <- blrm(...)
  blrmStats(f, pl=TRUE)   # print and plot
}

Run the code above in your browser using DataLab