tests/testthat/test_coef.R

context("Test estimated coefficients")
library(mpcmp)

test_that("Test the estimated coefficients from the attendance dataset", 
          { 
            data("attendance")
            M.attendance <- glm.cmp(daysabs~ gender+math+prog, data=attendance)
            expect_equal(unname(round(M.attendance$nu,4)), 0.0202)
            expect_equal(unname(round(coef(M.attendance)[1],3)), 2.715)
          })

Try the mpcmp package in your browser

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

mpcmp documentation built on Oct. 26, 2020, 9:07 a.m.