6.3 Gamma regression model
Gamma regression is an extension of generalized linear models suitable for continuous, strictly positive response variables whose variability increases with the mean. The Gamma model is an appropriate alternative for analyzing strictly positive continuous variables whose variability increases as their expected value grows. This behavior is common in economic and social variables, such as household income or consumption expenditure.
If \(Y_{k}\), the variable of interest observed for unit \(k\), follows a Gamma distribution with mean \(\mu_{k}\) and dispersion parameter \(\phi\), the model relates the expected value of the response variable to a set of covariates through a link function. The most commonly used link function is the logarithmic link, which ensures that predictions are always positive. In this case, the model is expressed as
\[ \log(\mu_{k}) = \mathbf{x}_{k}\boldsymbol{\beta} \]
Where \(\mathbf{x}_{k}\) corresponds to the vector of explanatory variables associated with the observed unit and \(\boldsymbol{\beta}\) is the vector of unknown model parameters. Equivalently, we have:
\[ \mu_{k} = E(Y_{k}\mid \mathbf{x}_{k}) = \exp(\mathbf{x}_{k}\boldsymbol{\beta}), \]
With the logarithmic link, each parameter can be interpreted as the effect of a covariate on the logarithm of the expected mean, so that \(\exp(\beta_j)\) represents the multiplicative change associated with a one-unit increase in the corresponding covariate, holding the other variables in the model constant. Under the Gamma distribution, the conditional density function of \(Y_{k}\) can be written as
\[ f(y_{k}\mid \mu_{k},\phi) = \frac{1} {\Gamma(1/\phi) (\phi\mu_{k})^{1/\phi}} y_{k}^{\frac{1}{\phi}-1} \exp\left( -\frac{y_{k}} {\phi\mu_{k}} \right), \qquad y_{k}>0, \]
where \(\Gamma(\cdot)\) denotes the Gamma function and \(\phi\) represents the dispersion parameter. Under the inference approach based on pseudo-maximum likelihood, the objective function optimized to obtain the estimators of the model parameters is given by
\[ \ell(\boldsymbol{\beta},\phi) = \sum_{k} w_{k} \log \left[ f(y_{hik}\mid\mu_{k},\phi) \right] \]
Where \(k\) represents the observation units in the sample and \(w_k\) corresponds to the expansion factor associated with each of them. This function defines the optimization criterion used to estimate the model parameters under the pseudo-maximum likelihood approach. In R, it is first necessary to define the sampling design.
gamma_design <- survey_data %>%
as_survey_design(
strata = Stratum,
ids = PSU,
weights = wk,
nest = TRUE
)The following code fits a Gamma regression model for the household income variable (Income), incorporating the complex survey design defined in the gamma_design object. The model uses household expenditure (Expenditure), age (Age), sex (Sex), and area of residence (Zone) as explanatory variables. A logarithmic link function is also specified, ensuring positive predictions and allowing the effects of the explanatory variables to be interpreted in multiplicative terms on expected income. The estimated coefficients are presented in Table 6.5:
gamma_model <- svyglm(
formula = Income ~ Expenditure + Age + Sex + Zone,
design = gamma_design,
family = Gamma(link = "log")
)| term | estimate | std.error | statistic | p.value |
|---|---|---|---|---|
| (Intercept) | 5.409 | 0.098 | 55.184 | 0.000 |
| Expenditure | 0.002 | 0.000 | 16.891 | 0.000 |
| Age | 0.002 | 0.001 | 2.430 | 0.017 |
| SexMale | 0.048 | 0.038 | 1.260 | 0.210 |
| ZoneUrban | 0.151 | 0.089 | 1.701 | 0.092 |
Because the model uses a logarithmic link, the coefficients can be interpreted as multiplicative effects on expected income. The coefficient associated with household expenditure is positive and statistically significant (\(p<0.001\)), indicating that, holding the other variables in the model constant, a one-unit increase in expenditure is associated with an approximate \(0.2\%\) increase in expected income, since \(\exp(0.002)\approx 1.002\). Age also has a positive and significant effect (\(p=0.017\)). On average, each additional year of age is associated with an increase of around \(0.2\%\) in expected income, holding the other covariates constant. By contrast, the sex and area-of-residence variables do not show sufficient statistical evidence to conclude that they influence income.