Gamma GLM
A random variable X that is gamma-distributed with shape k and scale θ is denoted by:
The Gamma distribution $Y \in G(\alpha,\beta x/\alpha$); Var[Y] = $(\beta x)^2)$
$$ \hat{\beta} = \frac{\alpha \sum y_i/x_i}{\sum alpha} = \frac{\sum \hat{\beta}_i}{k} $$
We try another generalized linear model using the Gamma family this time with the link function in this case being the inverse function. For this part, we look at two models: one containing all the interactions and one which is a minimal model just containing the explanatory variables.\\
In the first model, containing all the interactions, we see that a very decent fraction of the explanatory variables are statistically significant but the AIC score suffers a little compared to the Poisson model and it’s value is 1758.7 in this instance. In the minimal model, we get fewer statistically significant variables and the AIC score also takes a hit becoming 1848.6 now. Therefore, we can say that the model containing all the interactions performs better between the two but there might be scope for improvement using model reduction.\\
In addition to model reduction, there is another method to improve generalized linear models which is the use of different link functions. At first we used the inverse link function.
Afterwards we have found that cubic root link function is also suitable for gamma distributed models, thefore we specified the link function as „power (1/3)“ in R.
We found out that AIC scores improved (decreased) and also more variables were significant. We proceeded with tuning our link function and our model reduction to finally obtain a model with an AIC score as low as 1722 (referred to as gamma9 in our code) and all selected variables significant. This link function is defined as power (1/3.75).
