Skip to content

Commit

Permalink
fix ordbeta get_variance
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 3, 2023
1 parent cfba26c commit 62b86f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: insight
Title: Easy Access to Model Information for Various Model Objects
Version: 0.19.7.2
Version: 0.19.7.3
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

* Fixed issue in `find_formula()` for models of class `glmmPQL` (package *MASS*).

* Fixed issue in `get_variance()` for *glmmTMB* models with `family = "ordbeta"`.

# insight 0.19.7

## General
Expand Down
2 changes: 1 addition & 1 deletion R/compute_variances.R
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@
# transform mu
mu <- switch(faminfo$family,
beta = mu,
ordbeta = stats::qlogis(mu),
ordbeta = stats::plogis(mu),
exp(mu)
)
}
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-glmmTMB.R
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,9 @@ test_that("model_info, ordered beta", {
out <- model_info(m)
expect_true(out$is_orderedbeta)
expect_identical(out$family, "ordbeta")
skip_on_cran()
out <- get_variance(m)
expect_equal(out$var.distribution, 1.44250604187634, tolerance = 1e-4)
})


Expand Down

0 comments on commit 62b86f7

Please sign in to comment.