My algorithm:
Make a
Module
assigned to a Function
to do this first part, where the variable is a country.
Take the first part of all of the country's coordinates (the latitude). Average it, then take the absolute value (it's quite important to take the absolute value after the summation, since otherwise, places right on the equator, instead of positive and negative latitudes negating each other, would keep adding to each other and give the wrong average latitude). Then, after getting their average, get the country's GDP per Capita. Finally, create for the country its point,
{Latitude, GDP per Capita}
.
Map
all the countries with CountryData[]
to the Function
, which will take a wee bit long (I had to run it when I went to sleep).
ListPlot[]
the points and use Tooltip[]
to label each and every point.
Data:
Conclusion: There's definitely some correlation, which supports my previous hypothesis that Latitude and GDP per Capita would correlate. There are a few outliers, obviously, like Greenland which is at the very pole, but has a relatively low GDP per Capita, and Singapore which is near the equator but has a high GDP per Capita.
Credits:
Map[]
, ListPlot[]
, Tooltip[]
, Module[]
, CountryData[]
No comments:
Post a Comment