strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

Pseudo R2 for pscl::zeroinfl() and pscl::hurdle() #49

Closed tbx200 closed 5 years ago

tbx200 commented 6 years ago

Hello,

I'm trying to calculate a pseudo R2 for a glmmTMB poisson model without random effects. However the following happens:

data(Salamanders) m1 <- glmmTMB(count~ mined, zi=~mined, family=poisson, data=Salamanders) r2(m1)

Error in sum(sapply(vals$vc[terms], function(Sigma) { : invalid 'type' (list) of argument

Is this not implemented yet, or am I trying to do something that makes no sense?

Thanks in advance,

Tristan

strengejacke commented 6 years ago

I actually expect glmmTMB models to have random effects. Else, the "non-mixed-model" alternatives would be pscl::zeroinfl() or pscl::hurdle(), but these models are currently not supported. I have no idea what would be the best approach for pseudo-r-squared values for poisson models with zero-inflation.

r2() for glmmTMB objects only works if random effects are present.

tbx200 commented 6 years ago

Thanks for the rapid reply. I'll give them a try ;-)

strengejacke commented 6 years ago

Any help or hints for best practice in how to calculate pseudo-r-squared for pscl::zeroinfl() or pscl::hurdle() are appreciated. :-)

strengejacke commented 5 years ago

Closing in favor of https://github.com/easystats/performance/issues/29