drizopoulos / GLMMadaptive

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

predict() has no default for newdata? #8

Closed florianhartig closed 5 years ago

florianhartig commented 5 years ago

Hi Dimitris, as you know, I'm trying to integrate GLMMadative in DHARMa.

I'm currently fighting with a somewhat surprising behavior of your predict() function - is it so that predict requires newdata? My expectation from other packages would have been that the function would fall back on the fit data if newdata is not provided, so that you could do, e.g.

fm1 <- mixed_model(fixed = y ~ year * group, random = ~ 1 | id, data = DF,
                   family = binomial())
predict(fm1) 
drizopoulos commented 5 years ago

Thanks! This should now work in GLMMadaptive_0.4-9999999.

florianhartig commented 5 years ago

yes, thanks! Side comment: I find it a bit confusing that the S3 methods in GLMMadaptive deviate so strongly from most other packages, e.g. that the usual type = "response" etc. can't be used in this way. One can find out from the help of course, but it isn't very intuitive for a new user.

Not sure if it's worth switching now though.

drizopoulos commented 5 years ago

I'm aware of that, but to maintain consistency with the use of the type argument in other functions in the package, I decided to do it like this. I can understand that this may cause issues, but I hope that it is well-documented.