cod: Tjur's Coefficient of Discrimination

Description Usage Arguments Value Note References See Also Examples

View source: R/pseudo_r2.R

Description

This method calculates the Coefficient of Discrimination D for generalized linear (mixed) models for binary data. It is an alternative to other Pseudo-R-squared values like Nakelkerke's R2 or Cox-Snell R2.

Usage

1
cod(x)

Arguments

x

Fitted glm or glmer model.

Value

The D Coefficient of Discrimination, also known as Tjur's R-squared value.

Note

The Coefficient of Discrimination D can be read like any other (Pseudo-)R-squared value.

References

Tjur T (2009) Coefficients of determination in logistic regression models - a new proposal: The coefficient of discrimination. The American Statistician, 63(4): 366-372

See Also

r2 for Nagelkerke's and Cox and Snell's pseudo r-squared coefficients.

Examples

1
2
3
4
5
6
7
8
library(sjmisc)
data(efc)

# Tjur's R-squared value
efc$services <- ifelse(efc$tot_sc_e > 0, 1, 0)
fit <- glm(services ~ neg_c_7 + c161sex + e42dep,
           data = efc, family = binomial(link = "logit"))
cod(fit)

sjstats documentation built on Nov. 23, 2017, 1:05 a.m.