tests/testthat/test_coef.R

data(cats, package = "MASS")
l1 <- linmod(Hwt ~ Bwt * Sex, data = cats)
l2 <- lm(Hwt ~ Bwt * Sex, data = cats)

test_that("same estimated coefficients as lm function", {
  expect_equal(coef(l1), coef(l2), tolerance = 1e-3)
})
BST262/Linreg documentation built on May 28, 2019, 11:36 a.m.