florianhartig / DHARMa

Diagnostics for HierArchical Regession Models
http://florianhartig.github.io/DHARMa/
201 stars 21 forks source link

Offset problem when updating models in glmmTMB #351

Open florianhartig opened 1 year ago

florianhartig commented 1 year ago

Have to investigate, but seems the update doesn't work with offset, which makes LRT tests on glmmTMB models with offsets fail.

m0 = glmmTMB(SiblingNegotiation ~ FoodTreatment + 
               offset(log(BroodSize)),
             family = nbinom1, data = Owls)

m1 = glmmTMB(SiblingNegotiation ~ FoodTreatment + 
               offset(log(BroodSize)),
             dispformula = ~ FoodTreatment,
             family = nbinom1,
             data = Owls)

simulateLRT(m0,m1, n = 10)
florianhartig commented 1 year ago

So, it seems the problem is that I extract the data from the model.frame in getRefit, and this is the transformed data, for a proper update I would need the original data.

Could also be a more general for all refits, check

Not sure if that is in any way related to https://github.com/glmmTMB/glmmTMB/issues/549