cstat: Calculate the C-statistic for predicted probabilities against...

View source: R/cstat.R

cstatR Documentation

Calculate the C-statistic for predicted probabilities against a binary outcome.

Description

Calculate the C-statistic for predicted probabilities against a binary outcome.

Usage

cstat(preds, obs)

Arguments

preds

A vector of predicted probabilities.

obs

A vector containing the observed binary outcomes (0 or 1).

Value

The C-statistic as a single numeric value. This value is equivalent to the area under the curve of the receiver operatoing characteristic.

Examples

# Generate some predictions
predictions <- runif(1000)
# Generate some binary outcomes
observations <- sample(0:1, size = 1000, replace = TRUE)
# Calculate the C-statistic
cstat(predictions, observations)

gweissman/gmish documentation built on Aug. 12, 2024, 10:36 a.m.