Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 9, 2024
1 parent c89147d commit 123dee8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-bayesian_as_frequentist.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,15 @@ test_that("brms 0 + Intercept to freq", {

expect_equal(coef(m1), coef(m2), tolerance = 1e-2)
})


test_that("brms Interaction terms to freq", {
skip_if_not_or_load_if_installed("brms")

set.seed(333)
m <- brms::brm(qsec ~ mpg * as.factor(am), data = mtcars, refresh = 0)
m1 <- lm(qsec ~ mpg * as.factor(am), data = mtcars)
m2 <- convert_bayesian_as_frequentist(m)

expect_equal(coef(m1), coef(m2), tolerance = 1e-2)
})

0 comments on commit 123dee8

Please sign in to comment.