Learn R Programming

sjmisc (version 1.0.2)

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

Description

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

Usage

pseudo_r2(x)

Arguments

x
a fitted glm.

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

Examples

Run this code
data(efc)

# Pseudo-R-squared values
efc$services <- dicho(efc$tot_sc_e, "v", 0, asNum = 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