auc.model {PDtoolkit} | R Documentation |
Area under curve (AUC)
Description
auc.model
calculates area under curve (AUC) for a given predicted values and observed target variable.
Usage
auc.model(predictions, observed)
Arguments
predictions |
Model predictions. |
observed |
Observed values of target variable. |
Value
The command auc.model
returns value of AUC.
See Also
bivariate
for automatic bivariate analysis.
Examples
suppressMessages(library(PDtoolkit))
data(gcd)
#categorize numeric risk factor
gcd$maturity.bin <- ndr.bin(x = gcd$maturity, y = gcd$qual, y.type = "bina")[[2]]
#estimate simple logistic regression model
lr <- glm(qual ~ maturity.bin, family = "binomial", data = gcd)
#calculate auc
auc.model(predictions = predict(lr, type = "response", newdata = gcd),
observed = gcd$qual)
[Package PDtoolkit version 1.2.0 Index]