# Transforming dependent and independent variables with different techniques

I am learning how to transform and standardize data for building more precise models. I did not find any information if it is legit to transform independent variables with one technique (for instance, Box-Cox) and the dependent variable with a help of log transformation. Appreciate any tips.

My current situation - two independent variables looks much better with Box-Cox and the dependent variable looks much better after log transformation.

• Why do you care what the IVs or DVs 'look' like? The main reason to transform is to get a linear model. A secondary reason would be to stabilize variance. A tertiary reason would be to meet the distributional assumption of tests or intervals, but that assumption doesn't directly relate to the marginal distribution of any of the variables, only the conditional distribution of the response – Glen_b Aug 10 '20 at 5:34
• See stats.stackexchange.com/a/35717/919 for a detailed example of how and why one might choose two different transformations. – whuber Aug 10 '20 at 14:31
• @Glen_b, thanks, that is what I am trying to do. To transform it and follow the assumptions. As far as I understand, I need to make the relationship linear and I am trying to do it with the help of transformation. After transformation my variables look better in terms of distribution. – Anakin Skywalker Aug 10 '20 at 18:46
• Again, why do you care what the distribution looks like? What's "better" to you and what makes it better? – Glen_b Aug 11 '20 at 0:10
• I was not asking rhetorically (either of the times I asked that), but to elicit an answer -- to try to identify what exact notion you carried; it's easier to explain why a conception is mistaken if I understand what that conception actually is, rather than just its consequences. – Glen_b Aug 11 '20 at 8:52

## 1 Answer

There are indeed data-informed ways to transform the independent variables; however, they seem to have become a bit more obscure.

You can indeed investigate using a Box-Cox transformation for your dependent variable. For the independent variables, the similar procedure is a Box-Tidwell transform. In $$R$$, the car package has a box.tidwell() method.

Alternately, you consult one of two excellent references to determine how to explore the transformation yourself. Either Fox's Applied Regression or Weisberg's Applied Linear Regression, 2nd Edition have information on Box-Tidwell. Note that later editions of Weisberg do not have the material on the Box-Tidwell transformation.

• Kurtosis, cool nickname :) Thanks, I am working in Python, I will check it! – Anakin Skywalker Aug 10 '20 at 4:38