appraisal: appraisal

Description Usage Arguments Details Value Examples

Description

Estimates of prediction model performance

Usage

1
2
appraisal(observed, LP, plots = TRUE, title = "", weight = rep(1,
  length(observed)))

Arguments

observed

Number of observations in the data set.

LP

Calculated linear predictor for all indiviuals in the data set based on the prediction model being validated.

plots

Logical. If TRUE, calibration plots are returned.

title

Optional title string for calibration plots.

weight

Optional weights for weighted analyses.

Details

This function calculates simple measures of prediction model performance, currently Harrell's c-index, O:E ratios and optional calibration plots.

This function is currently only compatible with logistic regression models.

Value

appraisal returns a matrix of performance estimates and optional calibration plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Example 1: validation of a simple prediction rule. Unweighted analysis
covmat <- matrix(c(0.2,0,0,0.2), nrow=2)
set.seed(123)
d <- datafy(obs = 100, means = c(0,0), covmat = covmat,
     var.names = c("X1", "X2", "Y"), genmod = c(-1.5, 1, 1))
m <- glm(d$Y ~ d$X1 + d$X2, family=binomial)
set.seed(456)
covmat <- matrix(c(0.4,0,0,0.4), nrow=2)
v <- datafy(obs = 100, means = c(0.0,0.0), covmat = covmat,
     var.names = c("X1", "X2", "Y"), genmod = c(-2, 1.2, 1.2))
LP <- m$coef[1] + m$coef[2]*v$X1 + m$coef[3]*v$X2
appraisal(obs = v$Y, LP = LP, plots = TRUE, title = "Calibration plot")

rpajou/predsims documentation built on May 28, 2019, 12:35 a.m.