Intro to using R for economic research— part 0 of “R for Applied Economics” guide

Dima Diachkov
3 min readJan 20, 2023

--

The Lord of the R journey begins…

“Still round the corner there may wait
A new road or a secret gate,
And though I oft have passed them by,
A day will come at last when I
Shall take the hidden paths that run
West of the Moon, East of the Sun.”

“The Lord of the Rings” by J.R.R.Tolkien

What is R?

R is a powerful, open-source programming language that is widely used for data analysis, economics, and machine learning. Developed in the early 90s by statisticians Ross Ihaka and Robert Gentleman, R has become one of the most popular languages for data science, due to its extensive libraries and powerful tools for data manipulation and visualization. R is a powerful tool for applied economics as well (for the same reasons). The language has a wide range of statistical and graphical capabilities, and can be easily extended with user-defined functions.

R is an implementation of the S programming language combined with lexical scoping semantics inspired by Scheme. R was created by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by the R Development Core Team.

Credits: Pinterestourmadisonlife.com

Is there a community?

R is also a popular platform for developing new statistical methods. There are a number of excellent resources for learning R, including online tutorials, books, and dedicated R websites. The R community (medium.com is one of the best at my opinion) is also very active, and there are many online forums and mailing lists where users can ask questions and share code.

How it can be applied?

One of the main strengths of R is its wide range of libraries for data analysis, including popular packages such as dplyr, tidyr, and ggplot2. These libraries make it easy to clean, manipulate, and visualize large datasets, making R a popular choice for data scientists and statisticians. R also has a large community of users, which has led to the development of many additional libraries and resources that extend the capabilities of the language.

In terms of economics, R is used by many economists and researchers as it has a lot of libraries related to economics and finance like Ecdat, tseries, quantmod, vars, urca and many more.

R is also gaining popularity in the field of machine learning, with libraries such as caret, randomForest, and xgboost that provide powerful tools for building and evaluating machine learning models. This makes R a valuable tool for building and deploying predictive models in a variety of applications, including finance, healthcare, and marketing.

Is it different from other similar tools?

When compared to other languages, R is known to be more flexible and expressive for data manipulation and visualization (this is one of the main characteristic features that are mentioned in various comparisons).

Also, R is more specialized in statistical analysis and machine learning, which makes it more powerful in these fields compared to other general purpose languages such as Python or Stata. Python is more versatile, has more libraries for non-data science purposes and its syntax is more user friendly than R. On the other hand, Stata is more specialized in econometrics and statistics, and it is more user-friendly in terms of data handling, but less powerful in terms of visualization and machine learning.

Why R we here?

In this blog, we will together explore some of the ways in which R can be used for applied economics. We will look at how to use R for data analysis, statistical modeling, and economic forecasting. We will also discuss some of the challenges and opportunities associated with using R in an applied economic context.

Today, I am excited to announce that I will be periodically posting about R for Applied Economics. For me — that is an attempt to add some value to community, to practice my writing skills and to get in touch with other enthusiasts.

This series of posts will provide a comprehensive introduction to using R for applied economics and show you how to extract, download, prepare, clean, process, manipulate and even store data, as well as automate workflows.

I hope I can make this journey educational, exciting and inspiring. The first part of the journey will be posted quite soon. Stay tuned!

Please clap 👏 and subcribe if you want to support me. Thanks!❤️‍🔥

--

--

Dima Diachkov

Balancing passion with reason. In pursuit of better decision making in economic analysis and finance with data science via R+Python