View source: R/goodness_of_fit.R
Concordance | R Documentation |
Computes the concordance statistic given observed binary outcomes and
predicted probabilities of event. In logistic regression, the concordance
statistic is equal to the area under the Receiver Operating Characteristic
(ROC) curve and estimates the probability that an individual who experienced
the event (Y_i=1
) had a higher probability of event than an individual
who did not experience the event (Y_i=0
).
Concordance(observed, predicted)
observed |
vector of binary outcomes. |
predicted |
vector of predicted probabilities. |
The concordance statistic.
Other goodness of fit functions:
ROC()
# Data simulation
set.seed(1)
proba <- runif(n = 200)
ydata <- rbinom(n = length(proba), size = 1, prob = proba)
# Observed concordance in simulated data
Concordance(observed = ydata, predicted = proba)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.