COVID-19 visualizations with Stata Part 6: Animations

Asjad Naqvi
The Stata Guide
Published in
11 min readSep 23, 2020

--

In this guide we will learn how to make animations in Stata. Here, we will use the Oxford COVID-19 Government Response Tracker (OxCGRT) dataset (introduced in Guide 3 and Guide 4), and we will go through all the steps to create a video that shows the global evolution of the Health Containment Index:

This guide will also introduce new elements of Stata like formatting locals, label masks, and fine-tuning custom color schemes.

A related guide on animations is also given on the official Stata blog here which provides a good introduction on this topic.

Preamble: Set up Stata

Like all previous guides, this guide assumes a basic knowledge of Stata. This guide deals with advanced usage of locals, loops, and code structures that require some experience and familiarity with Stata programming. If you are using this guide for the first time, and are new to Stata, then Guide 1 and Guide 2 are highly recommended, followed by the next set of guides which are in increasing order of difficulty.

This guide uses the following folder structure for the work-flow management:

--

--

Asjad Naqvi
The Stata Guide

Here you will find stuff on Stata, data visualizations, data wrangling, workflows, and programming.