Tutorials › Generalized Linear Models › Worked Reciprocal-Link Gamma Regression

Gamma Response Models · Tutorial 589 of 981

Worked Reciprocal-Link Gamma Regression

Work through fitted means and predictor contrasts under the positive reciprocal link, while checking that every required linear predictor gives a valid positive mean.

Intermediate 9 min read

What You'll Learn

  • Write the Gamma mean model using the positive reciprocal link.
  • Convert a fitted linear predictor into a fitted response mean.
  • Calculate and interpret finite predictor contrasts on the mean scale.
  • Check positivity over a specified predictor region, not only at one point.
  • Recognize why a nonpositive linear predictor cannot produce a valid reciprocal-link Gamma mean.

From a Linear Predictor to a Gamma Mean

A Gamma regression with a positive reciprocal link is linear in the reciprocal of the response mean, not in the mean itself. Consequently, a coefficient describes an additive change in the reciprocal mean; translating that change back to the response scale requires taking a reciprocal. This tutorial works through that translation numerically and checks the domain condition that makes each fitted mean valid.

Let \(Y_i\) be a positive response for observation \(i\), with predictor vector \(\mathbf{x}_i\). In the usual Gamma mean-dispersion parameterization, \(E[Y_i\mid\mathbf{x}_i]=\mu_i\) and \(\operatorname{Var}(Y_i\mid\mathbf{x}_i)=\phi\mu_i^2\), where \(\mu_i>0\) and \(\phi>0\). The positive reciprocal link sets the linear predictor equal to the reciprocal of the mean.

Definition: A Gamma regression with the positive reciprocal link has conditional mean \(\mu_i=E[Y_i\mid\mathbf{x}_i]\), linear predictor \(\eta_i=\mathbf{x}_i^\top\boldsymbol{\beta}\), and link equation \(\eta_i=1/\mu_i\). Therefore, its fitted mean is \(\mu_i=1/\eta_i\), which is valid only when \(\eta_i>0\).

In a numerical worked regression, the coefficient estimates are treated as given. The task is to calculate the fitted means implied by those estimates, interpret contrasts between predictor profiles, and verify that all required predictions lie in the link’s domain. A positive fitted mean is not guaranteed merely because the response is Gamma: the fitted linear predictor must also be positive.

Worked Regression: A Continuous Predictor

Worked Example: Fitted Means at Two Exposure Levels

Suppose a Gamma regression models a positive response \(Y\), measured in hours, from exposure \(x\), measured in units of ten hours. The estimated linear predictor is \(\hat{\eta}(x)=0.10+0.02x\), with reciprocal-link mean \(\hat{\mu}(x)=1/\hat{\eta}(x)\). Calculate the fitted means at \(x=5\) and \(x=15\), and interpret the contrast.

At \(x=5\), the estimated linear predictor is

$$ \hat{\eta}(5)=0.10+0.02(5)=0.20. $$

This is positive, so the fitted mean is valid:

$$ \hat{\mu}(5)=\frac{1}{0.20}=5\text{ hours}. $$

At \(x=15\), the calculation gives

$$ \hat{\eta}(15)=0.10+0.02(15)=0.40, \qquad \hat{\mu}(15)=\frac{1}{0.40}=2.5\text{ hours}. $$

Thus, increasing exposure from \(x=5\) to \(x=15\) increases the fitted reciprocal mean by \(0.20\), while the fitted response mean decreases by \(2.5\) hours. The coefficient \(0.02\) is not a change of \(0.02\) hours in the mean. It is the change in the reciprocal mean for a one-unit increase in \(x\).

Finite Predictor Contrasts on the Mean Scale

For any two predictor profiles \(A\) and \(B\), write their linear predictors as \(\eta_A\) and \(\eta_B\). If both are positive, their fitted means are \(1/\eta_A\) and \(1/\eta_B\). Their difference follows from a simple reciprocal identity. The identity is useful because it gives the exact mean-scale effect without treating the coefficient as though it were already a mean difference.

Result: If \(\eta_A>0\) and \(\eta_B>0\), then
$$ \mu_B-\mu_A = \frac{1}{\eta_B}-\frac{1}{\eta_A} = -\frac{\eta_B-\eta_A}{\eta_A\eta_B}. $$

Proof. Both denominators are nonzero because both linear predictors are positive. Put the two fractions over a common denominator:

$$ \frac{1}{\eta_B}-\frac{1}{\eta_A} = \frac{\eta_A-\eta_B}{\eta_A\eta_B} = -\frac{\eta_B-\eta_A}{\eta_A\eta_B}. $$

This proves the identity. Since \(\eta_A\eta_B>0\), a positive change in the linear predictor gives a negative change in the fitted mean. \(\square\)

For a predictor contrast from \(\mathbf{x}_A\) to \(\mathbf{x}_B\), the linear-predictor change is \(\eta_B-\eta_A=(\mathbf{x}_B-\mathbf{x}_A)^\top\boldsymbol{\beta}\). Substituting that change into the identity gives the mean difference, provided both profile-specific predictors are positive. The denominator depends on both profiles, so the same predictor change need not produce the same mean difference at different starting points.

Worked Example: A Treatment Indicator Contrast

Suppose \(z=0\) denotes the reference group and \(z=1\) denotes the treatment group. The fitted linear predictor is \(\hat{\eta}(z)=0.25+0.10z\). Find the fitted means and the treatment-minus-reference difference.

For the reference group, \(z=0\), so \(\hat{\eta}_0=0.25\) and \(\hat{\mu}_0=1/0.25=4\). For the treatment group, \(z=1\), so \(\hat{\eta}_1=0.25+0.10=0.35\) and \(\hat{\mu}_1=1/0.35=20/7\), approximately \(2.857\).

The estimated treatment-minus-reference difference is

$$ \hat{\mu}_1-\hat{\mu}_0 = \frac{20}{7}-4 = -\frac{8}{7} \approx -1.143. $$

Check the reciprocal-contrast identity: the predictor change is \(0.10\), so it gives

$$ -\frac{0.10}{(0.25)(0.35)} = -\frac{0.10}{0.0875} = -\frac{8}{7}. $$

The two calculations agree. Both fitted means are positive because both linear predictors are positive. The coefficient \(0.10\) is an additive change in reciprocal mean, not a decrease of \(0.10\) in the response mean.

How the Mean Changes with a Continuous Predictor

The finite-contrast formula also shows why the mean-scale effect depends on the predictor profile. The same coefficient increment is divided by the product of the two profile-specific linear predictors. Locally, this dependence can be expressed as a derivative. Assume \(\eta(x)=\beta_0+\beta_1x\) and restrict attention to values of \(x\) for which \(\eta(x)>0\). Then \(\mu(x)=1/\eta(x)\), and differentiation gives

$$ \frac{d\mu(x)}{dx} = -\frac{\beta_1}{\{\beta_0+\beta_1x\}^2} = -\beta_1\mu(x)^2. $$

Derivation. The derivative of \(u^{-1}\) with respect to \(u\) is \(-u^{-2}\). Here \(u=\beta_0+\beta_1x\), whose derivative with respect to \(x\) is \(\beta_1\). Applying the chain rule gives \(-\beta_1(\beta_0+\beta_1x)^{-2}\). Since \(\mu(x)=1/(\beta_0+\beta_1x)\), its square is \(\mu(x)^2=(\beta_0+\beta_1x)^{-2}\), which gives the second expression. The calculation applies only where the denominator is positive. \(\square\)

Therefore, if \(\beta_1>0\), the mean decreases as \(x\) increases within the valid region; if \(\beta_1<0\), it increases there. The size of the local change depends on \(\mu(x)^2\), not only on \(\beta_1\). This is a statement about the fitted mean curve, not by itself a claim about uncertainty or statistical significance.

Positivity Must Hold Over the Prediction Region

A reciprocal-link model requires a positive linear predictor at every predictor value for which a fitted mean is reported. Checking one observation is not enough if the analysis also reports predictions at other covariate values. When predictors vary over a specified range, inspect the linear predictor across that range; for a linear function over a rectangular range, its minimum can be found at an endpoint for each predictor.

Result: For a finite real number \(\eta\), the reciprocal-link expression \(\mu=1/\eta\) is a finite, positive mean if and only if \(\eta>0\). If \(\eta=0\), the reciprocal is undefined; if \(\eta<0\), it is negative and cannot be a Gamma mean.

Proof. If \(\eta>0\), then \(1/\eta\) exists and is positive. Conversely, if \(1/\eta\) exists and is positive, \(\eta\) is nonzero. A positive reciprocal has a positive denominator, so \(\eta>0\). At \(\eta=0\), division by zero is undefined; at \(\eta<0\), \(1/\eta<0\). Neither case yields a positive Gamma mean. \(\square\)

Worked Example: Checking a Prediction Range

Suppose the fitted model is \(\hat{\eta}(x,z)=0.30-0.025x+0.04z\), where \(0\leq x\leq10\) and \(z\) is either 0 or 1. Determine whether predictions are valid across this range, calculate two fitted means, and check what happens at \(x=13,z=0\).

The coefficient of \(x\) is negative, so for either fixed \(z\), \(\hat{\eta}\) decreases as \(x\) increases. The coefficient of \(z\) is positive, so the smaller predictor occurs at \(z=0\). Hence the minimum over the stated range occurs at \(x=10,z=0\):

$$ \hat{\eta}(10,0)=0.30-0.025(10)+0.04(0)=0.05. $$

Every predictor in the stated range has \(\hat{\eta}\geq0.05>0\), so fitted means are valid throughout that range. At \(x=8,z=0\), \(\hat{\eta}=0.30-0.20=0.10\), giving \(\hat{\mu}=10\). At \(x=8,z=1\), \(\hat{\eta}=0.30-0.20+0.04=0.14\), giving \(\hat{\mu}=1/0.14=50/7\), approximately \(7.143\).

At the extrapolated value \(x=13,z=0\),

$$ \hat{\eta}(13,0)=0.30-0.025(13)=-0.025. $$

The reciprocal is \(-40\), which is not a valid fitted Gamma mean. This model therefore does not provide a valid prediction at that extrapolated profile. The negative value must not be reported as a mean or silently changed to a positive value.

Common Mistake and Practical Interpretation

A common mistake is to read a positive reciprocal-link coefficient as a direct increase in the response mean. For example, seeing a coefficient of \(0.10\) for a treatment indicator and reporting that treatment raises the mean by \(0.10\) reverses the scale being modeled. The coefficient changes \(\eta=1/\mu\); the mean must be computed by taking the reciprocal at each profile. In the treatment example, the predictor rose from \(0.25\) to \(0.35\), while the fitted mean fell from \(4\) to about \(2.857\).

Another mistake is to check only that the observed responses are positive and assume the predictions must therefore be valid. The responses can all be positive while a fitted predictor at an observed or requested covariate profile is zero or negative. The correction is to calculate \(\hat{\eta}\) at every profile where the model will be used and verify \(\hat{\eta}>0\) before taking its reciprocal. If this condition fails, the model as specified does not yield an admissible mean at that profile; truncating or taking the absolute value of the reciprocal changes the model rather than fixing its prediction.

Key takeaway: Under the positive reciprocal link, predictor contrasts are additive on \(1/\mu\), not on \(\mu\). Convert each profile’s linear predictor separately, interpret mean differences from the resulting reciprocals, and verify strict positivity throughout the prediction region.

Check Your Understanding

Answer each question using the reciprocal-link mean equation and show the positivity check when needed.

  1. If \(\hat{\eta}=0.20\) at a predictor profile, what is the fitted mean? What does a predictor value of \(-0.20\) imply?
  2. A two-profile contrast changes the linear predictor from \(0.40\) to \(0.50\). Calculate both fitted means and their difference.
  3. In a model with \(\eta(x)=0.6-0.04x\), for which values of \(x\) is the reciprocal-link fitted mean positive?
  4. Why is a coefficient in a positive reciprocal-link model not the change in the response mean?
  5. A model is valid over \(0\leq x\leq8\), but gives a negative linear predictor at \(x=10\). What can and cannot be concluded about predictions at those values?
Clinical Biostats