Asjad Naqvi Profile picture
PhD Econ @NSSRNews 12. Habilitated. Stata stuff. Climate analytics, diagnostic tools, data science. @WIFOat, @wu_vienna 🌍
Sep 13, 2023 9 tweets 4 min read
#Stata v18 has added a bunch of new features to control colors in the past updates. Let's start with an example data:

set scheme stcolor
sysuse census.dta, clear
gen under5 = (poplt5 / pop) * 100

twoway (scatter under5 medage, msize(2))

The scheme layout has minor tweaks: Image A new feature of v18 is to color by groups using a single line:

twoway (scatter under5 medage, msize(2) colorvar(region) colordiscrete)

This is amazing but 2 issues; discrete variables should have a regular legend. The line legend is confusing. The hues are not readable. Image
Oct 31, 2022 11 tweets 15 min read
The #30DayMapChallenge 2022 starts tomorrow. In the last 2 years a lot of work has been put in @Stata to mainstream some of the map elements we find in other softwares. He is a 🧵 on the different types of maps one can make. If you want the code for any, just msg! Let's go 👇 The basic #spmap package can already do a lot! Here are some examples using standard spmap syntax.

These were made for the online #GIS tutorials earlier this year that were fairly well attended! Over 1400+ registrations and 500+ ppl online. Might repeat it again. ImageImageImageImage
Oct 28, 2022 13 tweets 12 min read
Half through sorting the #dataviz bookmarks and still haven't found the links I am looking for (the curse of over bookmarking).

But here are 10+1 super amazing, interactive, and midn-blowing🤯 #environment, #climate, #trade, #emissions related websites that are just 🤩

👇👇 1/ The #WorldBank's #SDG atlas covers each #SDG goal in detail with some great datavizzes inside each of them. Check it out! Really a lot of effort went into this.

datatopics.worldbank.org/sdgatlas/
Oct 15, 2022 13 tweets 8 min read
A late night 🧵 on some tips for making grayscale (BW) & colorblind (cblind) friendly graphs in @Stata. BW in case people print out papers, and cblind to make sure documents are "barrier free".

Graphs have 3 elements that we can control: colors, line patterns, & symbols.

1/ Let's start with colors: Whatever color scheme we use, we can check whether it will pass the BW and cblind tests. This can be easily tested using the palettes package. Install these, if you haven't already:

ssc install palettes, replace
ssc install colrspace, replace

2/
Oct 11, 2022 5 tweets 1 min read
The ultimate clustering standard errors paper just dropped:

When Should You Adjust Standard Errors for Clustering?

by some big names in the field :)

academic.oup.com/qje/advance-ar… Here is a quick paper pass: The authors discuss 3 misconceptions:

1) clustering is needed when smaller units are correlated with larger units (its not!)

2) just do clustering for the sake of robustness (dont!)

3) researchers use either cluster SEs OR robust SEs (use both!)
Sep 14, 2022 38 tweets 15 min read
A 🧵 to consolidate the #Statatip posts from the past three years! Bookmark these.

If you want to read them in detail, have a look at the Awesome @Stata tips collection:

medium.com/the-stata-guid…

Its updated every 2-3 months or so. Many tips below 👇 Using value labels as variable names

#statatip

Sep 9, 2022 11 tweets 9 min read
A 🧵 to keep track of my @Stata #dataviz packages 👇

1) 𝘀𝗰𝗵𝗲𝗺𝗲𝗽𝗮𝗰𝗸: Has a large collection of ready-to-use #Stata #schemes.

Two I personally use all the time are white_tableau (clean white) and neon (black background).

github.com/asjadnaqvi/Sta… 2) 𝗷𝗼𝘆𝗽𝗹𝗼𝘁: A #Stata package for classic #ridgeline plots

github.com/asjadnaqvi/sta…
Apr 17, 2020 10 tweets 5 min read
What can be done about #COVID19 in #Pakistan? After having worked on this country esp. #Punjab for the past 15 years, let's start with what we KNOW from a data perspective GIVEN there is little testing and little enforcement and just the size of the country of 220 million 1/n... Taking a composite of satellite images, latest census, and cell phone data, and using machine learning we now know exactly what the population landscape looks like. Its highly complex. My home town, Lahore, seen as the large red color, is just 12 million alone 2/n...
Apr 13, 2020 5 tweets 4 min read
#COVID19 in #Europe thread. Below we see the trends for reported cases and deaths per 1,000,000 pop (pop normalization is imp for comparison). Belgium, France, UK, Sweden, Ireland have started showing exponential growth 1/n.... @IIASAVienna @DianaUrge @IIASA_Library If we look at the reported cases and deaths for each country, again normalized by population, then one can see the south to north wave. Northern countries are still behind the curve and could see rises in the next few days. see next graph for doubling time... 2/n...