tests/testthat/test-02-glmm.R

context("glmer and bglmer")

test_that("bglmer matches glmer exactly", {
  source(system.file("common", "glmmData.R", package = "blme"))
  
  control <- glmerControl(optimizer = "Nelder_Mead")
  
   glmerFit <-  glmer(y ~ x.1 + x.2 + (1 | g), testData, family = binomial(), control = control)
  bglmerFit <- bglmer(y ~ x.1 + x.2 + (1 | g), testData, family = binomial(), control = control,
                      cov.prior = NULL)
  
  expect_equal(glmerFit@theta, bglmerFit@theta)
  expect_equal(glmerFit@beta, bglmerFit@beta)
  expect_equal(glmerFit@u, bglmerFit@u)
})

Try the blme package in your browser

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

blme documentation built on Jan. 6, 2021, 1:08 a.m.