0
$\begingroup$

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!

$\endgroup$
7
  • $\begingroup$ Is $U$ a noise variable? Are $Z$ a set of covariates measured with some multiplicative error? $\endgroup$
    – AdamO
    Commented Mar 21, 2018 at 17:39
  • $\begingroup$ Sorry, $Z$ and $U$ are covariates and their effect sizes, $\epsilon$ is the noise variable $\endgroup$ Commented Mar 21, 2018 at 17:43
  • $\begingroup$ So is $X$ an offset then with a covariate value of 1 or is there a coefficient term for it, like $B$ or $\beta_1$ or something like that? $\endgroup$
    – AdamO
    Commented Mar 21, 2018 at 17:49
  • $\begingroup$ $X$ is the intercept term so the covariate can be thought of as 1. We are interested in estimating the intercept here. Thanks for thinking about this! $\endgroup$ Commented Mar 21, 2018 at 18:02
  • $\begingroup$ For, what I understand to be the R-related part of this question, see: stats.stackexchange.com/a/58546/1390 $\endgroup$ Commented Mar 21, 2018 at 18:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.