# Finding appropriate parameters for Gamma when bootstrapping a GLM

I'll illustrate what I want to do with a Poisson GLM first. I have a GLM with only factor co-variates, thus, to bootstrap this GLM what I can do is e.g. take a single random observation without the response, predict the response using my Poisson GLM, and get a value $$\lambda$$. Since this is Poisson, the predicted expected value (response) is exactly the same as the parameter I need to for the distribution: I can sample a number from uniform $$[0, 1]$$ and quantile this number from a $$POI(\lambda)$$.

Now, is it possible to do this with the Gamma GLM (log-link)? The expected value of a gamma distribution is $$\alpha\beta$$ or $$\frac{\alpha}{\beta}$$, depending on your definition. I'm also open to other ideas.

• With a gamma glm the parameterization you would start with a shape-mean parameterization with the glm; the glm gives you the mean and you can then estimate the shape (e.g. in R, the package MASS that comes with R provides utilities for exactly this purpose). You can then easily convert to a shape-scale or shape rate parameterization as suits your needs. (In R you'd use rgamma to generate random gammas). May 21, 2023 at 11:00
• @Glen_b Can you elaborate a bit more? I couldn't find what you mean by a shape-mean parameterization, nor do I know the package that could do so in MASS. May 21, 2023 at 11:07
• MASS is a package. Search for gamma in the help file. The mean $\mu$ is shape$\times$scale, you just rewrite the density in terms of $\alpha, \mu$. A search here on stats.SE should turn up several hits. May 22, 2023 at 0:27
• Specifically, in R, library(help="MASS") should give you a window that lists the functions and data sets in MASS (which comes with R). In that list, you should be able to find gamma.dispersion and gamma.shape. (A reference for the dispersion-mean form is Dunn & Smyth Generalized Linear Models With Examples in R, page 428. The shape mean form simply replaces each $1/\phi$ with $\alpha$. Or take the shape-scale form and replace every occurrence of the scale parameter with $\mu/\alpha$; ... ctd Jun 2, 2023 at 2:31
• ctd... either way should give the same form as given by Stefan here (there $\nu$ is the shape) Jun 2, 2023 at 2:35