3
$\begingroup$

I have a question. How on earth is it possible to have a negative estimate for a form of a nominal variable (two forms: "HM" and "LM") when it should be positive? I'm modelling a positive continuous variable (rarefied species richness) by using a single nominal predictor. See the output summary below and the box plot. How is this even possible?

P.S. This is my first gamma glm ever

Call:
glm(formula = Rarified.Richness ~ Macrophyte, family = "Gamma", 
    data = beysehir.diversity.indices.macr)

Deviance Residuals: 
     Min        1Q    Median        3Q       Max  
-0.39143  -0.09652  -0.00911   0.07579   0.43107  

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)   0.082461   0.006693  12.320 2.28e-07 ***
MacrophyteLM -0.024028   0.010597  -2.267   0.0468 *  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Gamma family taken to be 0.05929918)

    Null deviance: 0.87647  on 11  degrees of freedom
Residual deviance: 0.59465  on 10  degrees of freedom
AIC: 65.46

Number of Fisher Scoring iterations: 4

enter image description here

"LM" does have a higher mean value for the response. Shouldn't it has a positive estimate then?

P.S. KS-test and chisq tests both report a good fit for this model.

BONUS QUESTION: Do you think there is any other problem with this model?

$\endgroup$
  • 1
    $\begingroup$ I’m guessing that you’re using the inverse link function here, which is maybe not what you intended. $\endgroup$ – The Laconic Nov 5 '18 at 17:10
  • 1
    $\begingroup$ Inverse link is canonical for the gamma family. If you want to use log or identity link, you need to specify that explicitly. $\endgroup$ – The Laconic Nov 5 '18 at 17:12
  • $\begingroup$ Thank you all for your answers. It worked. I thought log link was the default one but it was not. Problem solved. $\endgroup$ – KO 88 Nov 5 '18 at 19:23
3
$\begingroup$

You’re using the inverse link function here, which is maybe not what you intended. That explains why you get a negative coefficient for LM (inverse of a smaller linear predictor yields a larger expected value).

Inverse link is canonical for the gamma family. If you want to use log or identity link, you need to specify that explicitly.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.