0

I'm using the VGAM package to do a regression between two samples which are Gamma distributed. Is it possible to choose the identity function for the link? If yes, how?

I'm using these code line and it works:

fit <- vglm(Y ~ X , family = gammaR, trace = TRUE)

But when I try to change the link function it doesn't work, e.g.:

fit <- vglm(Y ˜ X, family = gammaR(link= "identitylink"), trace = TRUE)

I have the following error message:

unused argument (link = "identitylink")
David Arenburg
  • 91,361
  • 17
  • 137
  • 196
Didi86
  • 1
  • I'm having difficulty understanding how this would work. The gamma function is only defined on positive values (and this makes sense since its canonical link function is 'log'). How is the algorithm supposed to weight negative deviations if the link were 'identity'? – IRTFM Jan 08 '15 at 22:45
  • It wouldn't allow negative predictions for the observed data. Problem solved. – Dason Jan 09 '15 at 01:06
  • Thanks for your answers. I didn't mention that my values in Y are strictely positive. I'm sorry I didn't get your points as I'm not famialiar with the VGLM. I thought it would work, as when I use the glm package of R with the same variables with the Gamma distribution and identity link I have no problem to estimate the mean of the distribution of Y|X but with the VGLM package it is impossible to have the scale and rate parameters. – Didi86 Jan 15 '15 at 14:03

1 Answers1

0

I was stuck similarly like you with the gamma distribution in VGAM. Luckily, I found a VGAM-Reference Card!

There it´s a bit cryptic to read but it lists GLMs always ending with "ff", e.g. "poissonff", "binomialff", but no "gammaff". However, it works! The solution for me was to use:

fit <- vglm(Y ˜ X, gammaff(link= "identitylink"))

To sum up: "gammaff" instead of gammaR should work.

Jens
  • 2,363
  • 3
  • 28
  • 44