Comments (4)
Do you have a reproducible example?
from performance.
Thanks for the quick response. Kindly see the following example. x1 (or the first variable of the zero-component) gets omitted. The same thing happens to my larger hurdle/zero-inflated glmmTMB files.
library(glmmTMB)
library(performance)
hnb <- readRDS(file='dummy_glmmTMB.RDS')
summary(hnb)
Family: truncated_nbinom2 ( log )
Formula: retweet_count ~ 1 + x1 + x2 + x3
Zero inflation: retweet_count ~ 1 + x1 + x2 + x3
Data: df
AIC BIC logLik deviance df.resid
297794.3 297888.2 -148888.2 297776.3 249991
Dispersion parameter for truncated_nbinom2 family (): 5.62e-10
Conditional model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -15.707384 229.293433 -0.069 0.9454
x1 -0.436397 0.048344 -9.027 <2e-16 ***
x2 -0.015658 0.007164 -2.186 0.0289 *
x3 -0.147176 0.007903 -18.624 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Zero-inflation model:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.200223 0.009541 230.62 <2e-16 ***
x1 -0.242178 0.019934 -12.15 <2e-16 ***
x2 -0.044450 0.002258 -19.69 <2e-16 ***
x3 0.227055 0.007253 31.30 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
check_collinearity(hnb)
# Check for Multicollinearity
* conditional component:
Low Correlation
Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
x1 1.07 [1.07, 1.08] 1.03 0.93 [0.93, 0.94]
x2 1.19 [1.18, 1.19] 1.09 0.84 [0.84, 0.85]
x3 1.11 [1.11, 1.12] 1.05 0.90 [0.90, 0.90]
* zero inflated component:
Low Correlation
Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
x2 1.04 [1.03, 1.04] 1.02 0.96 [0.96, 0.97]
x3 1.03 [1.02, 1.03] 1.01 0.97 [0.97, 0.98]
from performance.
Thanks! You misspecified the ziformula
- glmmTMB should throw a warning indicating that the ziformula
doesn't require an outcome. Removing the LHS from the ziformula fixes your issue:
library(glmmTMB)
library(performance)
hnb <- readRDS(file = "c:/Users/mail/Desktop/dummy_glmmTMB.RDS")
d <- insight::get_data(hnb, verbose = FALSE)
m <- glmmTMB(
retweet_count ~ x1 + x2 + x3,
data = d,
family = truncated_nbinom2,
ziformula = ~ x1 + x2 + x3,
dispformula = ~1
)
check_collinearity(m)
#> # Check for Multicollinearity
#>
#> * conditional component:
#>
#> Low Correlation
#>
#> Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
#> x1 1.07 [1.07, 1.08] 1.03 0.93 [0.93, 0.94]
#> x2 1.19 [1.18, 1.19] 1.09 0.84 [0.84, 0.85]
#> x3 1.11 [1.11, 1.12] 1.05 0.90 [0.90, 0.90]
#>
#> * zero inflated component:
#>
#> Low Correlation
#>
#> Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
#> x1 1.04 [1.03, 1.04] 1.02 0.96 [0.96, 0.97]
#> x2 1.03 [1.02, 1.03] 1.01 0.97 [0.97, 0.98]
#> x3 1.02 [1.01, 1.02] 1.01 0.98 [0.98, 0.99]
m <- glmmTMB(
retweet_count ~ x1 + x2 + x3,
data = d,
family = truncated_nbinom2,
ziformula = retweet_count ~ x1 + x2 + x3,
dispformula = ~1
)
#> Warning in f(init, x[[i]]): discarding LHS of second argument
check_collinearity(m)
#> # Check for Multicollinearity
#>
#> * conditional component:
#>
#> Low Correlation
#>
#> Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
#> x1 1.07 [1.07, 1.08] 1.03 0.93 [0.93, 0.94]
#> x2 1.19 [1.18, 1.19] 1.09 0.84 [0.84, 0.85]
#> x3 1.11 [1.11, 1.12] 1.05 0.90 [0.90, 0.90]
#>
#> * zero inflated component:
#>
#> Low Correlation
#>
#> Term VIF VIF 95% CI Increased SE Tolerance Tolerance 95% CI
#> x2 1.04 [1.03, 1.04] 1.02 0.96 [0.96, 0.97]
#> x3 1.03 [1.02, 1.03] 1.01 0.97 [0.97, 0.98]
Created on 2023-12-21 with reprex v2.0.2
from performance.
Ah my mistake then, thanks so much! Everything works now.
Maybe one last question: will check_overdispersion() be available someday for pscl based models?
from performance.
Related Issues (20)
- difficult-to-diagnose errors using "difftime" response in a linear model HOT 9
- `check_singularity` doesn't work for `glmmTMB` HOT 9
- `icc` doesn't work for `glmmTMB` HOT 4
- R-squared for Dirichlet regression (`r2`)
- QQ plot blank in check model for glmmTMB with tweedie distribution HOT 4
- Error checking normality for t.test HOT 1
- spurious(?) viewport-too-small error with new ggplot2 version 3.5.0 HOT 11
- incorrect warning with old `ggplot2`/failure to load `see` HOT 2
- check_model "Error in match.arg" HOT 5
- Error in performance::check_distribution(): in call bw.SJ() HOT 2
- Revising `check_model()` HOT 1
- check_model failing on logistic regression HOT 2
- Check_model in version 0.11.0 no longer produces qq plot residuals HOT 19
- r2_nakagawa and glmmTMB with beta_family HOT 4
- Outlier detection in Linear mixed models failed? HOT 5
- cannot apply check_model title with patchwork::plot_annotation HOT 4
- check_model error suggestions are not complete HOT 5
- Error and Incomplete Output Using performance::check_collinearity with Cox Models HOT 1
- Normality of Residuals of check_model is abnormal. HOT 2
- Revise compare_models() for Bayesian models HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from performance.