drizopoulos / GLMMadaptive

GLMMs with adaptive Gaussian quadrature
https://drizopoulos.github.io/GLMMadaptive/
59 stars 14 forks source link

hurdle.lognormal() needs to trigger error message when zi_fixed is omitted #48

Closed edseab closed 1 year ago

edseab commented 1 year ago

In the mixed_model function, this early if statement:

if (family$family %in% c("zero-inflated poisson", "zero-inflated negative binomial", "hurdle poisson", "hurdle negative binomial", "hurdle beta", "zero-inflated binomial") && is.null(zi_fixed)) { stop("you have defined a family with an extra zero-part;\nat least argument ", "'zi_fixed' needs to be defined, and potentially also argument 'zi_random'.") }

should also include the hurdle lognormal family. Otherwise omitting zi_fixed leads to this confusing error:

'data' must be of a vector type, was 'NULL'

Thanks!

drizopoulos commented 1 year ago

Thanks for reporting. The corrected version is on GitHub now.