2

I have implemented a model using the glm() function and specifiy the family distribution as gamma:

glmer(FirstSteeringTime ~ error_rate + (1 + error_rate | pNum), family = Gamma, data = modellingdata)

I know that you can apply link functions such as "identity" or "log" to the gamma distributions. Thus I have two questions:

1) What is the default link function when I specify my model as I have without explicitly mentioned a link function?

2) What is the purpose of the different link functions? I'm confused as to the effect they have on my data...

Any help is most appreciated - thank you!

codegoblin1996
  • 302
  • 2
  • 12

1 Answers1

3

Typing args(Gamma) shows you the following:

function (link = "inverse") 
NULL

That is, the canonical link function is the inverse link.

As for the purpose of the link function it allows you to model non-linear relationships between your predictors and your response. In a simple linear regression you model the expected value directly as a linear combination of the predictors. In a glm on the other hand, you model a function of the expected value.

The benefit of that is best seen with logistic regression. With the help of the link function you guarantee that the values are indeed between 0 and 1. Because without it some linear combinations may likely yield values outside this range.

This questions is however very statistics related and is more appropriate on Cross Validated.

thothal
  • 16,690
  • 3
  • 36
  • 71
  • So the args() function shows the most suitable link function, but what link function is applied if I don't explicitly specify one? – codegoblin1996 Aug 29 '19 at 10:55
  • 3
    `args`shows the standard function signature. You see that the standard value for the optional link argument is `inverse`. Thus, if you do not provide any link function yourself, the function will fall back to this default value. Hence, it will use the `inverse` link function per default. – thothal Aug 29 '19 at 11:05
  • I see, makes sense. Thank you! – codegoblin1996 Aug 29 '19 at 12:20