0
$\begingroup$

I am looking to measure the contribution of variables in an OLS model. I have been using the "relimp" package to measure it. However, some of the variables in the model are logged, while some are not. Does anyone have information on how to specify which variables are logged to get the exact contribution of the variable? In this package or another?

I am trying to see the actual and predicted sales based on the decomp of each variable

Log(sales)= B0 + B1*Log(Spend) + B2*GRP + B3 * Distribution +....

$\endgroup$
2
  • $\begingroup$ OLS makes no assumptions about the scale or metric of the inputs. In terms of 'actual' vs 'predicted' you would need to retransform the predicted log of sales back into its original units with an exp() function. 'Contribution of variables' can imply different terms with different interpretations. One term is 'relative importance of variables.' The best review of this issue is Ulrike Groemping's papers and R module RELAIMPO (jstatsoft.org/article/view/v017i01/v17i01.pdf). The second term is 'effect size' which is typically considered at a higher level than the unique variable $\endgroup$
    – user78229
    Commented Mar 1, 2018 at 13:13
  • $\begingroup$ Thank you. Yes, I ended up doing manually eventually with exp but I was hoping to find a package where this could be done. I looked up RELAIMPO too. Thank you for trying D. $\endgroup$
    – N Gill
    Commented May 3, 2018 at 1:06

1 Answer 1

1
$\begingroup$

In order to find the relative contribution of variables, you should analyze structure coefficients. In R you can use the yhat package. The structure coefficients will not change with the transformations. Additionally, I'm not sure why you need to log transform an independent variable. This might needlessly complicate your analysis

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.