Solved – GLM with Gamma-Log link: How to do Predictions

gamma distributiongeneralized linear modelrregression

I am rather new to regression analysis, having a completely different background. I am trying to build a model for predictions.

The distribution of my dependent variable, Value (in US$), is right skewed and nonnegative. My explanatory variables are CurrentValue, i.e., the value of the item one year before, the age A of the item, and a categorical variable Type.

Reading a bit, also from other posts here, I came to the conclusion that a GLM with gamma distribution and log link seems a suitable choice. In R:

fit <- glm(Value ~ CurrentValue + Age + Type -1, 
           family=Gamma(link="log"), data=values)  

My question, probably trivial to the most, is the following: How do I back-transform the predicted value into the scale of my dependent variable Value? More simply, given that I call:

 predicted <- predict(fit, newvalues) 

how do I obtain values in US$, given the vector predicted?
Any help will be highly appreciated.

Best Answer

If you include type="response" in your predict code then the predicted values will be on the response scale.

predict(object, newdata = NULL, type = c("link", "response", "terms"), se.fit = FALSE, dispersion = NULL, terms = NULL, na.action = na.pass, ...)