Asjad Naqvi Profile picture
Oct 31, 2022 11 tweets 15 min read Read on X
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
The #bimap package that actually was the result of the #30DayMapChallenge last year allows you to combine two variables to check for interesting spatial correlations.

Install from SSC (ssc install bimap, replace)

See GitHub for further instructions
github.com/asjadnaqvi/sta… ImageImageImageImage
One can now also clip maps in @Stata using the #clipgeo package:

ssc install cligeo, replace
github.com/asjadnaqvi/sta…

Clip your polygons however you want! Rectangles, squares, or any other regular polygon shape.

Zoom in to the regions! ImageImageImageImage
There are also several guides written in the past years to completely rework how maps are made. For example the #OpenStreetMaps to @Stata guide shows how to get the layers in Stata:

medium.com/the-stata-guid…

Some examples below including an entry from the 2021 #30DayMapChallege ImageImageImageImage
This guide tells how to complete reprogram maps to draw whatever you want!
medium.com/the-stata-guid…

Some more examples from the challenge last year that use this: ImageImageImageImage
One is also not confined to actual maps. Maps can also be made in a lot of other ways. Here are examples of #joyplots, #scatter plots, #tilemaps.

For these, data is usually extracted from rasters and other layers and plotted. Africa/USA tilemap guides:
medium.com/the-stata-guid… ImageImageImageImage
Here is a classic one from 2 years ago for the #DuBoisChallenge that got my started on maps in #Stata.

This was the first complete fully customized map replication in #Stata. You can fine more on this here:
github.com/asjadnaqvi/DuB… ImageImage
There are really cool packages out there as well. For example #getcensus allows direct access to ACS data. See detailed thread here on how to pull the data and map it:


Also see #hexmaps that are part of the #maptile package for some cool USA maps. ImageImageImageImage
You can also look at the 2021 #30DayMapChallenge entries here

github.com/asjadnaqvi/30D…

where 20 of the 30 maps were made in @Stata. Here is one of my fav ones. Any animation that color blends across months and years to show the Antarctica ice sheet extent.
Some more map-related #Stata content will be released this month + early 2023, so stay tuned!

First releases r always here:
medium.com/the-stata-guide

Otherwise, if you want to make a particular map, or are lost, or need the code, support, just msg!

Good luck 😎

/END

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Asjad Naqvi

Asjad Naqvi Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @AsjadNaqvi

Sep 13, 2023
#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
More options have been added to define start and end colors

twoway (scatter under5 medage, msize(2) colorvar(region) colordiscrete colorstart(red) colorend(eltblue))

But still we end up with hues where categories 3 and 4 are not discernible. Image
Read 9 tweets
Oct 28, 2022
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/
2/ @ChathamHouse brings an interactive resource website that allows you to explore bi-lateral #trade linkages. Data currently ranges from 2000-2020.

resourcetrade.earth
Read 13 tweets
Oct 15, 2022
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/
There are three types of common color-blindnesses that can we can check in #Stata: "Protanopia" & "Deuteranopia" where shades of red and green are not discernable, & "Tritanopia" where blue-green, purple-red, yellow-pink are hard to differentiate.

Test yourself 👇👇

3/ Image
Read 13 tweets
Oct 11, 2022
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!)
The authors provide a discussion and recommendations on:

1) clustering strategy in the design process (e.g. sampling, DGP etc.)

2) clustering strategy in the assignment process (e.g. clustering of treatments etc.)

Second can also help understand the data better.
Read 5 tweets
Sep 14, 2022
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 👇
Read 38 tweets
Sep 9, 2022
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…
3) 𝘀𝘁𝗿𝗲𝗮𝗺𝗽𝗹𝗼𝘁: A #Stata package for centered area graphs

github.com/asjadnaqvi/sta…
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(