tests/testthat/test-check_autocorrelation.R

test_that("check_autocorrelation", {
  data(mtcars)
  m <- lm(mpg ~ wt + cyl + gear + disp, data = mtcars)
  set.seed(123)
  out <- check_autocorrelation(m)
  expect_equal(as.vector(out), 0.316, ignore_attr = TRUE, tolerance = 1e-2)
})

Try the performance package in your browser

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

performance documentation built on Nov. 2, 2023, 5:48 p.m.