Econometrics 101 for data scientists
By: Mahbubul Alam
Tags: Statistics, Machine Learning, Economics, Data Science, Modeling

People in data science are typically interested in working with micro-scale data to advance domain specific business problems. However, there is a huge opportunity for them to break into economics and social science problems at a macro scale which are traditionally subject matters of social science disciplines. Econometrics is probably the closest domain for data scientist to get in that direction. The purpose of this article is to introduce — to data scientists coming from different backgrounds — some basic concepts and tools used in econometrics and how they relate to data science practices as we know it. This is mostly an introductory post scratching the surface but if there is enough interest I might write more posts with specific tools and use cases.

What is econometrics?

There are basically two kinds of economists: those who develop theories and those who test those theories. Econometricians are the latter kinds of people who use statistical techniques to understand and explain social phenomena that has economic dimensions.

One example of econometrics use case is testing the hypothesis that the length of education has anything to do with wage rate and to be able to quantify that relationship using a combination of economic theory and data. Another example would be measuring price elasticity of gasoline demand — i.e. sensitivity of gasoline consumption to a change in market price — using historical data.

What problems typically econometrics solves?

Econometrics deal in the domain of all the societal problems that has anything to do with economics. The domain largely deals with macro-economic phenomena such as employment, wage, economic growth, environment, agriculture, inequality etc. Here’s just a small sample of such macro-economic issues from the Journal of Econometrics:

The econometrics toolbox

With some exceptions, most things in econometrics toolbox should be familiar to data scientists or any computational scientists. Here is a sample of some commonly used tools:

Descriptive statistics (measures of central tendency and dispersion)

Inferential statistics and hypothesis testing

Time series modeling and forecasting

Regressions of all kinds

Causal inference methods

In addition to statistical models, economists use a wide range of mathematical models too. In fact, economists are often “accused” that they are using too much mathematics in modeling human behavior. There is widespread criticism of the discipline that they try to mimic deterministic models of natural systems to describe complex human behavioral problems that are rather unpredictable or probabilistic, to say the least.

And last but not least, arguably the most important and powerful tool in econometrics toolbox is the Panel Data Models. This topic deserves a separate post but I will briefly touch upon below.

Panel data models

If you haven’t heard about “panel data” or “longitudinal data” before then here is some description if it. A panel data is basically a multi-dimensional data of an observation that is measured repeatedly over time. In other words, it’s a dataset where multiple variables are measured, over time, on the same units — such as individuals, organizations, households, city, country.

This is how a panel data looks like. [source]

So as the name suggests, a panel data model is a statistical tool that provides information on the difference across individuals and over time. The following 4 are the most popular kinds of panel data models:

Pooled OLS

Fixed effects

Random effects

Mixed effects

Understanding each of these models require some discussion and mathematical formulation. This link provides a nice discussion on these modeling frameworks.

Some resources for data scientists

Econometrics with R: an open source book with theories along with R implementation of econometrics models

Principles of Econometrics With R: another book with R implementation. I think this book might be more accessible to beginners in this field

In this source there are panel data modeling related resources in one place

Those who likes to watch rather than read, here’s a couple of YouTube channels on simple explanation of panel data models, their estimators and associated codes in R

Last words

Data scientists have a great edge in diving into social and environmental issues that society is facing today. They should not feel worried that this is a domain of economists and they are the outsiders. I’d rather say, data scientists with diverse background and outside box thinking capability are rather better positioned to describe and predict societal problems than people trained in traditional disciplines.

I’m on Twitter if you want to get in touch with questions.