blrmStats: Compute Indexes of Predictive Accuracy and Their...

View source: R/blrm.r

blrmStatsR Documentation

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"))

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

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

Author(s)

Frank Harrell

See Also

Hmisc::rcorr.cens()

Examples

## Not run: 
  f <- blrm(...)
  blrmStats(f, pl=TRUE)   # print and plot

## End(Not run)

rmsb documentation built on April 12, 2022, 5:06 p.m.