roclines: Calculate x-y pairs of true/false positives for ROC charts

Description Usage Arguments Examples

View source: R/mMisc.R

Description

Returns a matrix of true/false positive rates which can be plotted as a ROC curve.

Usage

1
roclines(truth, fitted, thresholds = 0:100/100)

Arguments

truth

a vector of [0 | 1] values representing the true classification

fitted

a vector in the range [0,1] values representing the predicted classification

Examples

1
2
3
4
m0 = glm(outcome ~ predictor1 + predictor2, family = binomial(), data = train)
testprobs = predict(m0, newdata = test, type = "response")
roc.vals.train = roclines(train$outcome, m0$fitted)
roc.vals.test = roclines(train$outcome, testprobs)

townleym/mMisc documentation built on May 6, 2019, 10:52 a.m.