View source: R/02_BIVARIATE_ANALYSIS.R
auc.model | R Documentation |
auc.model
calculates area under curve (AUC) for a given predicted values and observed target variable.
auc.model(predictions, observed)
predictions |
Model predictions. |
observed |
Observed values of target variable. |
The command auc.model
returns value of AUC.
bivariate
for automatic bivariate analysis.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.