[R-sig-ME] Improving residual distribution in glmmTMB

Timothy MacKenzie |@w|@wt @end|ng |rom gm@||@com
Sun May 14 05:55:03 CEST 2023


Greetings,

I'm modeling the number of downloads (downs) of certain forms
(Document) by a number of school districts (District) of various
student sizes (ELs).

I've tried genpois(), nbinom1(), and nbinom2() families but the fitted
vs. residual doesn't look promising.

In glmmTMB, are there any additional ways to improve the residual
distribution for count-type data?

Thank you,
Tim M
### Reproducible data and code:
d = read.csv("https://raw.githubusercontent.com/fpqq/w/main/b.csv")

model = glmmTMB(downs ~ I(ELs/20) + Document +
                           (1|District) +
                           (1|Document),
                         family=genpois(),
                     #  ziformula = ~ Document,
                  # dispformula = ~ Document,
                         data = d)

plot(resid(model,type="pearson") ~ fitted(model))



More information about the R-sig-mixed-models mailing list