Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 13, 2024
1 parent 4c87e49 commit 22921b3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions R/get_sigma.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,19 @@ get_sigma <- function(x, ci = NULL, verbose = TRUE) {


.get_sigma.glmmTMB <- function(x, ...) {
if (stats::family(x)$family == "nbinom1") {
add_value <- 1
} else {
add_value <- 0
}
stats::sigma(x) + add_value
# The commented code is what MuMIn returns for sigma for nbinom1 models.
# However, I think this is wrong. Nakagawa et al. (2017) used this in their
# code because glmmadmb models with nbinom1 family are actually Quasi-Poisson
# models (see also Supplement 2). Thus, we revert and just use "sigma()" again.
# This will return results for `get_variance()` that are in line with the code
# in the Supplement 2 from Nakaawa et al. (2017).
# if (stats::family(x)$family == "nbinom1") {
# add_value <- 1
# } else {
# add_value <- 0
# }
# stats::sigma(x) + add_value
stats::sigma(x)
}


Expand Down

0 comments on commit 22921b3

Please sign in to comment.