statistics.raplot: Statistical metrics

View source: R/rap.R

statistics.raplotR Documentation

Statistical metrics

Description

The function statistics.raplot calculates the reclassification metrics. Used by CI.raplot.

Usage

statistics.raplot(x1, x2, y, t = NULL, NRI_return = FALSE)

Arguments

x1

Either a logistic regression fitted using glm (base package) or lrm (rms package) or calculated probabilities (eg through a logistic regression model) of the baseline model. Must be between 0 & 1

x2

Either a logistic regression fitted using glm (base package) or lrm (rms package) or calculated probabilities (eg through a logistic regression model) of the new (alternative) model. Must be between 0 & 1

y

Binary of outcome of interest. Must be 0 or 1 (if fitted models are provided this is extracted from the fit which for an rms fit must have x = TRUE, y = TRUE).

t

The risk threshold(s) for groups. eg t<-c(0,0.1,1) is a two group scenario with a threshold of 0.1 & t<-c(0,0.1,0.3,1) is a three group scenario with thresholds at 0.1 and 0.3. Nb. If no t is provided it defaults to a single threshold at the prevalence of the cohort.

NRI_return

Flag to return NRI metrics, default is FALSE.

Value

A matrix of metrics for use within CI.raplot


JohnPickering/risk-assessment-plot-package documentation built on July 3, 2023, 8:41 a.m.