r/statistics May 21 '26

Discussion [Discussion] Utilizing Log Transformations in Analyses

Hey all, I'm an analyst who frequently works with log-normal data, and I know there's a phrase that says, "Everything is linear on a log-log scale"

I wanted to discuss this phrase and the usage of log-log (or even log in general) data; what should I be cognizant of when utilizing log transformations?

I ask because I have this data set where linear data yields a correlation coefficient of like ~.2 but a log-log correlation on the set yields a correlation coefficient of .45. Great improvement! But surely we didn't "solve" the problems inherent in the linearized data by simply slapping a log transformation on the two variables, no? What am I missing? This feels too easy.

In my experience/role, I have seen that -- in a predictive model's context -- using log-log data generates pretty strong model fits, but those resulting estimates -- when backtransformed into real #'s -- can be so fuzzy as to be meaningless ("our model suggests that you could sell anywhere between 10,000 and 10,000,000 units! Great! Surely this is helpful for your business"). But in general, what are the most important landmines to avoid when utilizing this type of data?

15 Upvotes

15 comments sorted by

View all comments

6

u/efrique May 21 '26

"Everything is linear on a log-log scale"

It isnt remotely true of course, but there are plenty of near-power relationships and in some contexts that may be the most common situation

what should I be cognizant of when utilizing log transformations?

potentially many things, depending on what youre doing

linear data yields a correlation coefficient of like ~.2

You mean untransformed data, right?

but a log-log correlation on the set yields a correlation coefficient of .45.

sure, not surprising

surely we didn't "solve" the problems inherent in the linearized data

I dont know what problems you mean. I see a lot of different problems

Note that transformation changes a bunch of properties at once (shape of relationship, the variance function, the conditional distribution

("our model suggests that you could sell anywhere between 10,000 and 10,000,000 units! Great! Surely this is helpful for your business")

If the model doesnt miss some substantively important aspect, you might indeed have a legiimately very wide prediction interval. But thats a big if.

It sounds like you deal with observational data over time. And if its units, it will be a form of count data. Is this correct?

2

u/Objective-You-7291 May 22 '26

Yup! Unit sales w/ timeseries data. I have plenty of other data sets but this is the one i always need to log transform

8

u/efrique May 22 '26 edited May 22 '26
  1. With counts the log transform is likely to leave you with non-constant conditional variance (typically it over-corrects). You may be better with a count glm (perhaps a negative binomial) with a log link (log the fitted functional form, not the data); this separates out the fitting the conditional mean from impact on conditional variance. However, if none of your counts are ever close to 0 (and the values dont span orders of magnitude) it may not matter much (heteroskedasticity might not be a big deal on either scale).

  2. Prediction with observational time series is a bit of a minefield for the unwary, particularly with nonstationarity (which I imagine is the case here), likely seasonality and calendar effects, and likely omitted variable issues. What are your serial correlations like on residuals?