Skip to contents

Nagelkerke R2

Usage

r2(fit)

Arguments

fit

Output of glm()

Value

A named vector:

  • mf: McFadden \(R^2\)

  • cs: Cox-Snell \(R^2\)

  • ng: Nagelkerke \(R^2\)

Examples

fit <- glm(am ~ hp + wt, data = mtcars, family = binomial)
r2(fit)
#>        mf        cs        ng 
#> 0.7673104 0.6453351 0.8708970