Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed May 22, 2023
1 parent 59dab14 commit ec8df28
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-nestedLogit.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,17 @@ test_that("get_statistic", {
c("Parameter", "Statistic", "Response", "Component")
)
})

test_that("get_varcov", {
skip_if_not_installed("sandwich")
expect_equal(
diag(get_varcov(mnl1)$work),
c(`(Intercept)` = 0.14727, hincome = 0.00039, childrenpresent = 0.08542),
tolerance = 1e-3
)
expect_equal(
diag(get_varcov(mnl1, vcov = "HC3")$work),
c(`(Intercept)` = 0.17421, hincome = 0.00051, childrenpresent = 0.08741),
tolerance = 1e-3
)
})

0 comments on commit ec8df28

Please sign in to comment.