I am trying to assess the fit of the following zero-inflated negative binomial model using and R2 measure, as suggested by Martin and Hall (2016):
zero.infl.neg.bin.mod.reports.ac.year <- glmmTMB(Reports_per_week ~ (1|Park) + Reports_4w +
Number_4w_AC + factor(Year),
ziformula = ~ Reports_4w + Number_4w_AC,
data = Reports_per_park_per_week_3,
family = nbinom2, na.action = "na.fail")
It looks like the r2d function might be what I am looking for, but I don't seem to be able to run this function. I tried the following:
install.packages("remotes")
remotes::install_github("jashu/beset")
r2d(zero.infl.neg.bin.mod.reports.ac.year)
Error in r2d(zero.infl.neg.bin.mod.reports.ac.year) : could not find function "r2d"
How can I make this function run? I haven't been able to find that much information on it. I would be interested in alternative R2 functions that work for ZINB models with random effects.
Ref: Martin, J., and Hall, D. B. 2016. R2 measures for zero-inflated regression models for count data with excess zeros. Journal of statistical computation and simulation 86(18): 3777-3790.