2

I am running a multivariate OLS regression as below using weekly sales and media data. I would like to understand how to calculate the sales contribution when doing log transforms like log-linear, linear-log and log-log.

For example: Volume_Sales = b0 + b1.TV_GRP + b2.SocialMedia + b3.PaidSearch + e

In this case, the sales contributed by TV is b1 x TV_GRPs (coefficient multiplied by the TV GRP of that month)

Now, my question is: How do we calculate sales contribution for the below cases:

Log-Linear: ln(Volume_Sales) = b0 + b1.TV_GRP + b2.SocialMedia + b3.PaidSearch + e
Linear-Log: Volume_Sales = b0 + b1.TV_GRP) + b2. ln(SocialMedia) + b3. ln(PaidSearch) + e
Log-Log: *ln(Volume_Sales) = b0 + b1.TV_GRP) + b2. ln(SocialMedia) + b3. ln(PaidSearch) + e**

A.M. Das
  • 63
  • 6

2 Answers2

2

In general terms, a log transformation takes something that acts on the multiplicative scale and re-represents it on the additive scale so certain mathematical assumptions hold: among them, linearity. So to step beyond the "transform data we don't like" paradigm that many of us are guilty of, I like thinking in terms of "does it make most sense if an effect to this variable is additive (+3 units) or multiplicative (3 times as much, 20% reduction, etc)?" That and your diagnostic plots (residual, q-q, etc.) will do a good job of telling you what's the most appropriate in your case.

As for interpreting coefficients, here are some ways I've seen it done.

Linear: y = b0 + b1x + e

Interpretation: there is an estimated b1-unit increase in the mean of y for every 1-unit increase in x.

Log-linear: ln(y) = b0 + b1x + e

Interpretation: there is an estimated change in the median of y by a factor of exp(b1) for every 1-unit increase in x.

Linear-log: y = b0 + b1ln(x) + e

Interpretation: there is an estimated b1*ln(2)-unit increase in the mean of y when x is doubled.

Log-log: ln(y) = b0 + b1ln(x) + e

Interpretation: there is an estimated change in the median of y by a factor of 2^b1 when x is doubled.

Note: these can be fairly readily derived by considering what happens to y if you replace x with (x+1) or with 2x.

These generic-form interpretations tend to make more sense with a bit of context, particularly once you know the sign of the coefficient. Say you've got a log-linear model with an estimated b1 of -0.3. Exponentiated, this is exp(-0.3)=0.74, meaning that there is an estimated change in the median of y by a factor of 0.74 for every 1-unit increase in x ... or better yet, a 26% decrease.

Matt Tyers
  • 2,125
  • 1
  • 14
  • 23
  • 1
    Thanks for this simple interpretation. But I am vary of using exponents to arrive at y because in this context all the media contributions should add up close to the total volume, and contributions calculated using exponents will not add up to y – A.M. Das Jun 07 '17 at 14:51
  • 1
    Understood. In that case, you can still use a linear-log model, and draw inference on what happens to y with a change in ln(x), that is, just leave x in its log-transformed state. If you transform y, then the resultant model will operate on the multiplicative scale, not additive - though you could similarly draw inferences to what happens to ln(y). – Matt Tyers Jun 07 '17 at 16:36
  • 1
    Thanks, i tried but in my model, the linear-log fits arent that great. I found a article which has a different way of calculating contributions from multiplicative effects. I tried this, in theory it makes sense, but in real data, it is returning odd values http://www.fractalanalytics.com/whitepaper/multiplicative-marketing-mix-modeling – A.M. Das Jun 14 '17 at 17:14
  • Hi A. M. Das, I am stuck in a similar situation, did you find a solution for calculation of contribution in Multiplicative models? I have Log-Lin market mix model for which I am trying to build an optimizer, where I am struggling with exact calculation of contribution from each channel. – kawsleo Aug 28 '20 at 06:56
0

Log-linear means an exponential: ln(y) = a x + b is equivalent to y = exp(a x) * exp(b), which is of the form A^x * B. Likewise, a log-log transform gives a power law: ln(y) = a ln(x) + b is of the form y = B * x^a, with B = exp(b).

On a log-linear plot an exponential will thus be a straight line, and a power law will be on a log-log plot.

  • We cannot do the power function in the context of market mix because the log takes away the additive effect of the regression equation. i.e, when you use the exponents and calculate y (Sales Volume), it wont add up. – A.M. Das Jun 07 '17 at 14:47