Skip to content

please help! what are the different using log-link function and log transformation?

4 messages · pigpigmeow, Rubén Roa, Bill Venables

#
I'm new R-programming user, I need to use gam function.

y<-gam(a~s(b),family=gaussian(link=log),data)
y<-gam(loga~s(b), family =gaussian (link=identity),data)
why these two command results are different?
I guess these two command results are same, but actally these two command
results are different, Why?

--
View this message in context: http://r.789695.n4.nabble.com/please-help-what-are-the-different-using-log-link-function-and-log-transformation-tp3608931p3608931.html
Sent from the R help mailing list archive at Nabble.com.
#
The two commands you give below are certain to lead to very different results, because they are fitting very different models.

The first is a gaussian model for the response with a log link, and constant variance.

The second is a gaussian model for a log-transformed response and identity link.  On the original scale this model would imply a constant coefficient of variation and hence a variance proportional to the square of the mean, and not constant.

Your problem is not particularly an R issue, but a difficulty with understanding generalized linear models (and hence generalized additive models, which are based on them).

Bill Venables.