I am modeling a random variable as
$T_i\sim\Gamma(\mu_i, \alpha_i)$,
where $log(\mu_i) = X_i + ZU + \epsilon$
$\mu_i$ represents the mean of the gamma distribution and $\alpha_i$ is the shape.
I'm modeling this in R and my current function call is:
glm(T ~ Z, family = Gamma(link="log"))
My question is: is this modeling the mean the way I wrote it down? If not, how can I modify it to do so? I am also interested in modeling the variance, where:
$T_i\sim\Gamma(\alpha_i, \beta_i)$,
where $log(var) = log(\frac{\alpha_i}{\beta_i^2}) = V_i + ZU + \epsilon$
Is it possible to write this in R's glm()
function?
Thank you!