Applications of Linear Regression

Applications of Linear Regression

Nathanael O'Donnell

Linear regression, while one of the simplest machine learning algorithms available to practitioners, can be surprisingly effective and is widely used in research as well as industry. It is perhaps true that the simplicity of linear regression is also part of its strength: if you can visualize a trend line fitting a certain problem (say, SAT scores affecting college admission rates), then linear regression can be of use. And even if the problem in question is not truly linear—for example, if the relationship between SAT scores and college admission rates is logarithmic as opposed to linear—linear regression can still often provide an approximation that is good enough to solve the business problem at hand.

Because of its broad set of potential use-cases, there are plenty of real-world examples of situations where linear regression could be useful. I will explore some of these examples, which I have drawn from the article linked here: http://intellspot.com/linear-regression-examples/

1) E-Commerce Revenue vs Advertising Spend: In digital marketing, a common and continually relevant question is how every incremental dollar of advertising spend translates into revenue (or margin). Now, as mentioned above, this relationship could very well be nonlinear, but applying linear regression to this problem could give a useful starting point or, depending on the level of precision required, could suffice as a production model. It's worth noting that the accuracy of this model could potentially be improved by adding more variables (and thus more parameters, i.e. coefficients) to this model by including such measurements as the date and/or time of day a particular advertisement is run, the type of advertising target (i.e., impressions vs. clicks vs. conversions), or the average duration an advertisement was kept active.

Image source: Inntellspot


2)  Price of Used Cars vs. Age: It is common knowledge that the market price of a used car will generally decrease as the car becomes older. There are some exceptions to this trend—such as the appreciation enjoyed by owners of collectible vintage and/or limited-edition vehicles—but if we were to collect a large data set that included price vs. age data for a number of cars, we would most likely see a strong negative correlation (price decreasing as age increases). Again, similar to the example of revenue vs. advertising spend, the relationship is likely not perfectly linear, but we can expect to get a decent approximation by applying linear regression. And if the relationship satisfies a logarithmic or exponential trend, we can choose to transform the data (by taking logarithms of the data points) before applying linear regression.

Image source: Intellspot


3) Percent of population that is urban vs. GDP: For the final example I'm sharing this week, I wanted to show how logging variables can allow us to apply linear regression to a nonlinear relationship. In this example, we take the logarithm of GDP to transform a skewed relationship into a "linear-log" relationship, to which we can productively apply our linear regression model. (This example is taken from the following article: https://kenbenoit.net/assets/courses/ME104/logmodels2.pdf)

A scatter plot of the untransformed data appears thusly:

Source: Kenneth Benoit, London School of Economics

While after transforming it, the data exhibits a clear linear (linear-log) trend:

Source: Kenneth Benoit, London School of Economics

From these three examples, it should be clear that linear regression has a wide range of applications, especially in light of the fact that logarithmic transformations can make data more amenable to the algorithm. And while more sophisticated algorithms can often achieve better results, there is much to be said for using linear regression as a quick-and-dirty method that adds value immediately. Thank you for reading, and I hope you can find useful applications of linear regression in your own work!

Comments

Popular posts from this blog

The Future of Machine Learning

Applications of Neural Networks

Applications of Logistic Regression