Hi @Julianveda,
Welcome in the Community !
Transforming the response with log is indeed not the same as using a GLM with log link. It's like comparing the average of the log response, versus the log of the average response.
Applying a non-linear (e.g., log, inverse) transformation to the dependent variables not only normalizes the residuals, but also distorts the ratio scale properties of measured variables.
On your example, we can see that using log transformation with a standard least squares model tends to underperform for bigger Y values, as differences in big Y values lead to very small log differences (it "shrinks" the differences because of the log transformation).
Example with rows 1 and 7 (output difference is equal to 30,43), where the difference of the log of the individual responses is equal to 0,237 whereas the log of the difference between the row is 1,483.
Applying GLM and setting up this type of model with link function enable to stay in the original scale of the data, using a link function to transform the mean into a linear function of the predictor variables and a variance function to allow for variance heterogeneity in the analysis rather than trying to transform it away (for example through log transform).
I added the datatable and scripts used for the comparison, and if other experienced users want to use the dataset for further explanations.
Some references for further explanations/reading :
- https://stats.stackexchange.com/questions/47840/linear-model-with-log-transformed-response-vs-genera...
- http://faculty.washington.edu/heagerty/Courses/b571/homework/Lindsey-Jones-1998.pdf
- http://www.leg.ufpr.br/~joel/Rmodelling/Slides/transforms.pdf
- https://www.frontiersin.org/articles/10.3389/fpsyg.2015.01171/full
@Mark_Bailey you can use the dataset I attached, it shows some patterns in the actual vs. predicted and residuals :
I hope you'll better understand the difference between the two modeling techniques.
Victor GUILLER
L'Oréal Data & Analytics
"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)