.

Why do we take logs of variable in Regression analysis?

We should remember that a regression equation has two parts

i) The Dependent variable (Predictand)

ii) The Independent variables (Predictors) ; which can be one or more and can be of different types (Categorical or Continuous).

The nature of the regression that we should run depends on the type of Dependent variable that we are dealing with in our model. For example, if the dependent variable is Continuous then we might run OLS (though this does require some other conditions to be satisfied for better results) to get the estimates of the parameters, or if our Predictand is a Categorical variable (Binomial Categorical, 0 or 1) then we might want to run a Logistic regression.

It has to be noted that Linear Regression has certain conditions that need to be satisfied for it to provide good/desirable results, one of them being normal residuals, which in many instances are not. If the error between the observed and the expected values are not normally distributed, that could be because the response variable is skewed. In such cases we can take a log transformation of the variable to normalize it. The question is, whether we should do it. According to some statisticians, there are other regression methods that can handle these problems with efficiency without going through such transformations, the justification being, it is advisable to "use a method that fits the data than to make the data fit the method". So if the residuals are non-normal we can take help of Robust Regression, Quantile Regression or in some cases MARS. It has to be noted here that OLS regression does not require the variables to be normal, but only the errors which are estimated by the residuals. However, if there are outliers in the dependent or the independent variables in the model taking logarithmic transformations can reduce the effect of those observations.

So if transforming variables for the sake of normalizing them is not a great move, what else could be the reason why variables are still transformed in practice?

One good reason if because it can make substantive sense, one is when the raw values of the variables are not exactly linearly related. For example, a unit change in X can cause a constant percentage change in Y. So a unit change in X might have a small effect on Y to begin with but subsequent increments in X might have greater and greater impacts on Y and thus yielding a non-linear relationship between the raw values of the variables. Taking logarithmic transformation of the response variable helps us in estimating the relationship. A similar transformation of X can be made if a percentage change in X causes a constant unit change in Y, such a transformation is generally taken when the impact of the independent variable on the dependent variable decreases as the value of independent variable increases. Finally we can even take logs of both the response and the independent variable if a percentage change in X causes a constant percentage change in Y which is called a Double-log or a log-log model. The estimated parameter here is interpreted as the elasticity.

In some cases the relationship between variables can be given by

Y= K^a. L^b , where a and b are the parameters you want to estimate. Taking logs on both sides and adding a constant c can help us estimate the relationship using a Linear Regression.

Or, in some other cases a transformation is used to stabilize the variance (Reduce heteroskedasticity).

At the end of the day, all we do is choose a line/functional form that best fits the data and while doing so the primary consideration must be the evaluation of the nature of the relationship between the response and the independent variable. Whatever we do, there has to be a perfectly good reason for doing it.

- Using a business rules engine to streamline decision-making
- IBM boosts vertical cloud push with financial services cloud
- Exploring GRC automation benefits and challenges
- Check model accuracy with Facebook AI's new data set
- AR use cases gain ground due to COVID-19, maturing tech
- Air Force's data overhaul makes analytics a priority
- AI adoption in the supply chain requires a strategic approach
- New DataRobot CEO sees bright AI future for the vendor
- Why consider an augmented data catalog?
- Consider IoT TPM security to augment existing protection
- 11 Best Data Science Blogs to Follow

Posted 12 April 2021

© 2021 TechTarget, Inc. Powered by

Badges | Report an Issue | Privacy Policy | Terms of Service

**Most Popular Content on DSC**

To not miss this type of content in the future, subscribe to our newsletter.

- Book: Applied Stochastic Processes
- Long-range Correlations in Time Series: Modeling, Testing, Case Study
- How to Automatically Determine the Number of Clusters in your Data
- New Machine Learning Cheat Sheet | Old one
- Confidence Intervals Without Pain - With Resampling
- Advanced Machine Learning with Basic Excel
- New Perspectives on Statistical Distributions and Deep Learning
- Fascinating New Results in the Theory of Randomness
- Fast Combinatorial Feature Selection

**Other popular resources**

- Comprehensive Repository of Data Science and ML Resources
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- 100 Data Science Interview Questions and Answers
- Cheat Sheets | Curated Articles | Search | Jobs | Courses
- Post a Blog | Forum Questions | Books | Salaries | News

**Archives:** 2008-2014 |
2015-2016 |
2017-2019 |
Book 1 |
Book 2 |
More

**Most popular articles**

- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Time series, Growth Modeling and Data Science Wizardy
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- How to Automatically Determine the Number of Clusters in your Data
- Fascinating New Results in the Theory of Randomness
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions

## You need to be a member of Data Science Central to add comments!

Join Data Science Central