strengejacke / sjPlot

sjPlot - Data Visualization for Statistics in Social Science
https://strengejacke.github.io/sjPlot
603 stars 91 forks source link

tab_model not reporting correct estimates for glmer with Gamma family and "identity" link specified. #795

Closed juju-bowow closed 2 years ago

juju-bowow commented 2 years ago

Estimates listed in tab_model output differ from those reported in summary(glmer( . . . )) for glmer models with family=Gamma(link="identity").

Example: data(cake) summary(glmer(angle~recipe*temperature + (1|recipe:replicate),cake,family=Gamma(link="identity"))) tab_model(glmer(angle~recipe*temperature + (1|recipe:replicate),cake,family=Gamma(link="identity")))

It seems that the estimates reported in tab_model() are the exp() of the estimates reported in summary(). E.g.

summary(glmer...) Intercept: 33.9347193

tab_model(glmer...) Intercept: 546589587560955.62

exp(33.9347193) = 5.465896e+14

I note that by default tab_model will automatically use "exp" as transformation of estimates for applicable classes of model (e.g. logistic or poisson regression), though this automatic transformation does not seem applicable when family=Gamma(link="identity") is specified.

Please forgive me if I have misunderstood the reported estimates or the intention of tab_model here. Thank you for creating such useful packages. Best regards,

strengejacke commented 2 years ago

Thanks, should be fixed in the latest GitHub version.

juju-bowow commented 2 years ago

Thats great news and the quick fix is much appreciated. Thank you very much once again.