# Category: Illustrated

## Bivariate Maps for Chinese Regional Data (Update)

Asjad Naqvi released a new version of the bimap package, let me provide a small update of the following blog. The main difference will be that I will…

## Heterogeneous Difference-in-Differences with Stata (Again)

Yesterday, Stata released two videos on how to use Difference-in-Differences commands built-in within Stata. The videos are very pedagogical, so allow me to share them with you: Treatment…

## Bayesian quantile regression

In the latest edition of the Stata News, I learned that Stata has adapted the Bayesian quantile estimator of Yu and Moyeed (2001). You need to have access…

## Graph combine and loops with STATA

In this blog, I will show how to use the Stata commands ‘graph combine’ and ‘foreach loop’ to produce high-quality graphs that may be included in the Data…

## Vector Autoregressions with RATS

Estima, the company that develops and sells the RATS software, has released a new version of their online help. Notably, they incorporated the user guide version of the…

During the past twenty years, the US monetary policy has been characterized by an alternance of easing and tightening cycles. We can easily distinguish five cycles. The tightening…

## Using the delimiter ; for loops with Stata

In Stata, you can write long commands over several lines. You have basically three choices: first, change the end-of-line delimiter to ‘;’ with the following commands : “delimit…

## Tables of descriptive statistics with Stata

In Stata 18, you can easily create the “Table 1” for your research work using the new dtable command. In the following, I will show how to use…

## A recent article on Local Projections

In a recent article published in the Journal of econometrics, we have some further insights about the bias-variance trade-off between IRF (Impulse Response Function) produced by the VAR…

## Drawing maps at different regional levels

1 Introduction This short note aims to demonstrate the drawing of choropleth maps at different regional levels thanks to Natural Earth Data and GADM data. Drawing maps on…

## Computing the number of months to reach peak depreciation during a monetary cycle

In the following working paper, we assess the relative resilience of emerging countries during US monetary cycles. One possible measure of resilience is the number of months to…

## Panelview with Stata

A good way to visualize panel data with Stata is to rely on the package panelview created and maintained by Yiqing Xu: Other possibilities include Ben Jann’s heatplot:…

## Two-Way Histograms

Sometimes, you need to draw histograms using two variables, with one variable containing the frequencies. Using fictional data, I will show you, in some simple steps, how to…

## BigQuery with GDELT

After two blogs on how to start with GDELT data, I will show how to construct a histogram of bilateral Goldstein score for bilateral events between the US…

## Drawing bivariate maps with Stata for the NUTS regions (removing Turkey)

A small update of the following blog if you want to remove Turkey:

## Drawing bivariate maps with Stata for the NUTS regions

After three blogs on how to draw maps with Stata for the NUTS regions and on how to download data from DBnomics, this time I will show you…

## Drawing maps with Stata for the NUTS regions (Hourly Wages)

After two blogs on how to draw maps with Stata for the NUTS regions and on how to download data from DBnomics, this time I will show you…

## Drawing Maps for East Asia and Pacific Region

After a series of blogs on maps, today, I will show how to draw a map for the East Asian and Pacific Region, following the World Bank classification.…

## Explaining the Infrastructure Vulnerability Score for the Russia Federation

After a first blog on how to visualize the ND-GAIN vulnerability scores, I was keen to explore the sub-categories of the vulnerability scores. Among them, I was particularly…

## Bivariate Maps for Chinese Regional Data

Asjad Naqvi released a new version of the bimap package, let me show a small example of how this package works with some regional data for China. I…

## Feeling the Heat: Heatmaps for Vulnerability Scores

After a series of blogs where I explained the functioning of the DBnomics package: www.jamelsaadaoui.com I will show how to directly download the Vulnerability Index built by the…

## Measuring friendliness and like-mindedness

In his last post, Cullen S. Hendrix from the PIIE proposed to measure friendliness and like-mindedness using mean absolute distance with the US for two variables, the polyarchy…

## API with GDELT data at the regional level

Did you know that you can use an API to display instability scores computed from GDELT data? Below, an example for the French region (first administrative level): https://api.gdeltproject.org/api/…

## Create a variable with a reference to a specific country

After a previous post on mapping the Political Ties with Stata, let me show how to compute how to create an idea point relatively a specific country. This…

## Starting with GDELT data

When you are interested in geopolitical risks, up to some point you will heard about the GDELT project: https://www.gdeltproject.org Here, the brief description on their website: A Global…

## Geopolitical risk and oil prices: When refining capacities are targeted

As we recall in a recent article, written with Valérie Mignon, oil production facilities may be military objectives during a war or a conflict: Mignon, V., & Saadaoui,…

## Visualizing quantile regressions with Stata

When I wanted to make some simple graphs on quantile regressions, I was quite surprised to not find a nice blog where each step is clearly explained over…

## Currency fluctuations in emerging countries since the end of 2021

Last week, I saw this picture in a post written by Ziad Daoud, the Chief Emerging Markets Economist at Bloomberg. It would be interesting to explore if ex-ante…

## The best of EconMacro on Medium

Happy to announce that I now have a Medium page: https://medium.com/@jamelsaadaoui, where I will make a selection of my best blogs on EconMacro. These blogs will stay free…

## On the use of Chinese renminbi in international trade

During the 16th FIW conference, I had the chance to attend the policy panel on the “Tectonic shifts in the international economic order”. Giorgia Giovannetti gave us some…

## NUTS Data with DBnomics

Let me show you how to use DBnomics to build databases at the NUTS 0, NUTS 1, NUTS 2 levels. I recommend you to consult my blog series…

## Panel Data with DBnomics

What if I told you that you can build a panel dataset of 3 variables for almost 200 countries and around 60 years in less than four minutes?…

## Cold War 2.0?

The levels of Geopolitical Risks are now close to those of the Cold War, as mentioned by Cullen S. Hendrix in this PIIE chart: https://www.piie.com/research/piie-charts/2024/2020s-mark-return-cold-war-levels-geopolitical-risk. What does it…

## Reshape faster… much faster

As mentioned in the last Stata News 39-1, the reshape command is now faster, much faster. For an ongoing project, I had to reshape daily data for sovereign…

Today, I will show how to add shaded areas for NBER recession dates with Stata. I begin by importing the data of the Sahm Rule with Stata: The…

## Descriptive Statistics by Country in Panel Data with Stata

In this blog, I will show you how to compute descriptive statistics by country in a panel data thanks to the Stata command putexcel in a few simple…

## From panel data to time series with Stata [Updated]

In this blog, I will show you that it is simple to switch back and forth between panel data and time series with the Stata command reshape. I…

## Dates and Times in Excel and in Stata

Usually in Statistics, time is a continuous quantitative variable that uses the interval scale when we are looking at dates (the ratio scale when we elaborate on duration,…

## Built a website using GitHub pages

Thanks to the wonderful guidance of Hashir Shoaib (hashirshoaeb), I finally manage to use GitHub pages to built a portfolio for my recent projects jamelsaadaoui.github.io/ Feel free to…

## Heterogeneous Difference-in-Differences with Stata

A few days ago, I assisted to wonderful presentation by Di Liu of StataCorp LLC. His explanations were crystal clear about the difference-in-difference commands introduced in Stata 18.…

## Estimating a nonlinear DSGE model with Stata

Today, I will show how to estimate a DSGE model with Stata in a few steps. The model consists of 8 equations and is a variant of the…

## Illustrating that the sample variance bias decreases with the sample size using R and Mathematica

In my previous blog, I recall that we can demonstrate in a few steps that the sample variance is an unbiased estimator of the population variance when we…

## Illustrating the sample variance bias with R and Mathematica

In my previous blog, I recall that we can demonstrate in a few steps that the sample variance is an unbiased estimator of the population variance when we…

## A Simple Proof for the Chebyshev Inequality: Clearly Explained!

In the Appendix A of this book: Statistics: Principles and Methods written by Giuseppe Cicchitelli, Pierpaolo D’Urso and Marco Minozzo published by Pearson in 2021, I found the…

## Addressing Conditional Heteroscedasticity in SVAR Models with GAUSS

It is a great pleasure and an honor to announce that I wrote my first blog for APTECH with Eric Clower. In this blog, we will look more…

## Kurtosis Illustrated

Kurtosis tells you virtually nothing about the shape of the peak – its only unambiguous interpretation is in terms of tail extremity; i.e., either existing outliers (for the…