Learn R Programming

sjmisc (version 1.2)

pseudo_r2: Nagelkerke's and Cox-Snell's Pseudo R-squared

Description

This method calculates Nagelkerke's and Cox-Snell's pseudo-r-squared-values of generalized linear models for binary data.

Usage

pseudo_r2(x)

Arguments

x
Fitted glm model.

Value

  • An object of class pseudo_r2 with following values:
    • CoxSnellCox-Snell's pseudo-r-squared-value
    • NagelkerkeNagelkerke's pseudo-r-squared-value

See Also

cod for Tjur's Coefficient of Discrimination.

Examples

Run this code
data(efc)

# Pseudo-R-squared values
efc$services <- dicho(efc$tot_sc_e, "v", 0, as.num = TRUE)
fit <- glm(services ~ neg_c_7 + c161sex + e42dep,
           data = efc,
           family = binomial(link = "logit"))
pseudo_r2(fit)

Run the code above in your browser using DataLab