tests/testthat/test_coef.R

# 3.8.2
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(round(l1$coefficients, 3), round(l2$coefficients, 3))
})
nancy-zhang/demoLinreg documentation built on May 29, 2019, 6:40 a.m.