-
-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_predicted(): zero-inflation options #413
Comments
do you have a reproducible example with a model that has these components so I can play around? |
Away from computer. The second example in ?glmmTMB |
library(glmmTMB)
m <- glmmTMB(count ~ spp + mined + (1|site),
zi=~spp + mined,
family=nbinom2, data=Salamanders)
head(insight::get_predicted(m))
#> [1] 0.5387752 1.0768783 0.3554236 2.4701755 2.4950498 2.1819828
head(insight::get_predicted(m, type = "zprob"))
#> [1] 2.040119 2.040119 2.040119 1.174339 1.174339 1.174339 Created on 2021-08-04 by the reprex package (v2.0.0) custom types should work after the latest commit. So now it becomes a question or wether we want to change / add to the behaviour of our main |
Yes, I think the predict argument should have options for zero inflated and dispersion parameters |
I think we should revert the Instead, I think we add options to Existing
Existing labels, need adjusted behavior
New labels
For |
The needed steps to add/edit I believe are:
Line 275 in 1540c06
Lines 645 to 652 in 1540c06
Lines 633 to 643 in 1540c06
(essentially since we have one "master" argument predict, it is then passed to the |
@DominiqueMakowski can insight be submitted, or is there anything that needs to be addressed for modelbased? |
I wouldn't say that this issue of adding more options for glmmTMB is urgent so probably not a blocker for a CRAN update |
I think this will be closed in #501 |
Currently, for zero-inflated models,
get_predicted()
and its downstream functions likemodelbased::estimate_expectation()
always return the equivalent totype = "conditional"
(predicted values assuming non-zero). It would be good to allow users to specify other methods, such as predicting unconditional response predictions (incorporating both parts of the model) or just the zero-inflation parts.It would also be good I think to make the default equivalent to
type = "response"
(incorporating both model parts).See the
type
argument inpredict.glmmTMB()
:The text was updated successfully, but these errors were encountered: