Solution (source code)

= Solution

A suitable <generalized linear model> is a <Gamma regression with logarithmic link>:
$$
Y_i\mid x_i\text{ has a gamma distribution},
\qquad \mathbb E(Y_i\mid x_i)=\mu_i,
\qquad
\operatorname{Var}(Y_i\mid x_i)=\phi\mu_i^2,
$$
with
$$
\log\mu_i
=\beta_0+\beta_K\operatorname{numeric}(\text{Kilometres}_i)
+\beta_{\text{Brand}_i}+\beta_{\text{Bonus}_i}.
$$
The <gamma distribution> is appropriate for a positive, continuous, right-skewed payment, and its <variance function> allows the conditional variance to grow like the square of the conditional mean instead of assuming constant variance. The <logarithmic link function> also guarantees positive fitted means and represents covariate effects multiplicatively, which accords with the <Box–Cox transformation> evidence for a logarithmic scale.