Description Usage Arguments Details Value Examples

View source: R/check_zeroinflation.R

`check_zeroinflation()`

checks whether count models are
over- or underfitting zeros in the outcome.

1 | ```
check_zeroinflation(x, tolerance = 0.05)
``` |

`x` |
Fitted model of class |

`tolerance` |
The tolerance for the ratio of observed and predicted
zeros to considered as over- or underfitting zeros. A ratio
between 1 +/- |

If the amount of observed zeros is larger than the amount of predicted zeros, the model is underfitting zeros, which indicates a zero-inflation in the data. In such cases, it is recommended to use negative binomial or zero-inflated models.

A list with information about the amount of predicted and observed zeros in the outcome, as well as the ratio between these two values.

1 2 3 4 5 |

```
Loading required package: glmmTMB
# Check for zero-inflation
Observed zeros: 387
Predicted zeros: 298
Ratio: 0.77
Model is underfitting zeros (probable zero-inflation).
Warning message:
In checkMatrixPackageVersion() : Package version inconsistency detected.
TMB was built with Matrix version 1.2.15
Current Matrix version is 1.2.17
Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.