If a tmb model component doesn't have a random effect, extract_vc will fail, and subsequently summarize_model(..., component = 'zi'). It should return an empty result with a message, allowing the fixed effects to still be displayed.
library(glmmTMB)
library(mixedup)
(m1 <- glmmTMB(
count ~ mined + (1 | site),
zi = ~ mined,
family = poisson,
data = Salamanders
))
#> Warning in Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j =
#> integer(0), : 'giveCsparse' has been deprecated; setting 'repr = "T"' for you
#> Warning in Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j =
#> integer(0), : 'giveCsparse' has been deprecated; setting 'repr = "T"' for you
#> Warning in Matrix::sparseMatrix(dims = c(0, 0), i = integer(0), j =
#> integer(0), : 'giveCsparse' has been deprecated; setting 'repr = "T"' for you
#> Formula: count ~ mined + (1 | site)
#> Zero inflation: ~mined
#> Data: Salamanders
#> AIC BIC logLik df.resid
#> 1908.4695 1930.8080 -949.2348 639
#> Random-effects (co)variances:
#>
#> Conditional model:
#> Groups Name Std.Dev.
#> site (Intercept) 0.28
#>
#> Number of obs: 644 / Conditional model: site, 23
#>
#> Fixed Effects:
#>
#> Conditional model:
#> (Intercept) minedno
#> 0.0879 1.1419
#>
#> Zero-inflation model:
#> (Intercept) minedno
#> 1.139 -1.736
summarize_model(m1, component = 'zi')
#> Error in sqrt(variance$variance): non-numeric argument to mathematical function
If a tmb model component doesn't have a random effect,
extract_vc
will fail, and subsequentlysummarize_model(..., component = 'zi')
. It should return an empty result with a message, allowing the fixed effects to still be displayed.Created on 2021-04-14 by the reprex package (v2.0.0)