tests/testthat/test-r2_coxsnell.R

test_that("r2_coxsnell", {
  model <- glm(vs ~ wt + mpg, data = mtcars, family = "binomial")
  expect_equal(r2_coxsnell(model), c(`Cox & Snell's R2` = 0.440140715155838), tolerance = 1e-3)
})

Try the performance package in your browser

Any scripts or data that you put into this service are public.

performance documentation built on Oct. 19, 2024, 1:07 a.m.