News for hackers. Stuff that matters.
Re:Maps Distort How We See the World by zimpenfish on Thursday June 22, 2023 @04:46AM (#36429528)
Assuming I've converted [1] and [2] correctly into this SQLite3 database and queried it correctly, not really, no.

    |      name      | gdp_pos |   gdp    | land_pos |  land   |
    |----------------|---------|----------|----------|---------|
    | United States  | 1       | 26854599 | 4        | 9147593 |
    | China          | 2       | 19373586 | 3        | 9596961 |
    | Japan          | 3       | 4409738  | 62       | 377976  |
    | Germany        | 4       | 4308854  | 63       | 357114  |
    | India          | 5       | 3736882  | 7        | 3287263 |
    | United Kingdom | 6       | 3158938  | 79       | 242495  |
    | France         | 7       | 2923489  | 49       | 543940  |
    | Italy          | 8       | 2169745  | 72       | 301339  |
    | Canada         | 9       | 2089672  | 2        | 9984670 |
    | Brazil         | 10      | 2081235  | 5        | 8515767 |
[1] https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nomi...

[2] https://en.wikipedia.org/wiki/List_of_countries_and_dependen...

Re:Maps Distort How We See the World by dwaltrip on Thursday June 22, 2023 @10:03AM (#36432335)
The countries with the 2 highest GDPs, China and the US, are in the top 4 largest countries. India, #5 in GDP, is #7 in area.

I guarantee that if you plot the countries of the world by GDP and area, you will see a trend line.

It also makes sense. More area = higher chance of larger population and more natural resources. And more space to carry out economic activities with said people and resources.

Edit: I just queried Wolfram Alpha about this. It generated a plot for me, which shows what I expected. Check it out: https://www.wolframalpha.com/input?i=list+of+countries+with+...

Edit2: bonus feature, GPT-4 wrote me a script to plot this also, check it out: https://chat.openai.com/share/ffa45c61-8b7a-44e1-b757-041f31...

Re:Maps Distort How We See the World by jgeada on Thursday June 22, 2023 @12:41PM (#36434880)
Seriously, a loglog plot? Even in that, there is a seriously wide dispersion to your correlation. And then look at the same data on a linear plot.
Re:Maps Distort How We See the World by dwaltrip on Thursday June 22, 2023 @12:49PM (#36435042)
The linear plot in that Wolfram link is messed up. It doesn't show all the data (caps out at 800 billion GDP). Here's a corrected linear plot, from the script that I linked (commenting out the log-log scaling):

https://ibb.co/9bBgwH8

There is clearly a correlation, even on linear. It's a little messy, but it's undeniably there.

The starting point for this discussion was about the relationship between a country's size and population and it's power and influence. The correlation between area and GDP demonstrates that there is a meaningful relationship.

Btw, what is your specific complaint about a log-log plot? Country data points for area and GDP span many orders of magnitude, which makes it harder to visualize any patterns on a linear plot.

I also don't understand your point about the dispersion. The correlation and trend is pretty clear. No one said the correlation was 99%.

Edit: I've calculated Pearson's correlation coefficient for this data [1]. The result is 0.82, which indicates a strong positive correlation.

[1] https://en.wikipedia.org/wiki/Pearson_correlation_coefficien...

Re:Maps Distort How We See the World by zimpenfish on Thursday June 22, 2023 @04:02PM (#36437992)
> The result is 0.82, which indicates a strong positive correlation.

datamash gave me 0.52 for Pearson. Which is "eh, maybe".

Re:Maps Distort How We See the World by erwald on Friday June 30, 2023 @02:17PM (#36539680)
That's weird, are you looking only at the top 10 countries?

I've reproduced dwaltrib's results using World Bank data on 251 countries, and I get a Pearson's r of 0.82 and a p value of 5.6e-61 (!). I.e. a strong correlation, with high confidence. It makes sense too -- larger countries generally have more people, and more people generally generate more economic activity.

Code if you want to try yourself:

import pandas as pd

gdp = pd.read_csv("~/Downloads/API_NY.GDP.MKTP.CD_DS2_en_csv_v2_5551501.csv").set_index("Country Name")

land_area = pd.read_csv("~/Downloads/API_AG.LND.TOTL.K2_DS2_en_csv_v2_5552158.csv").set_index("Country Name")

gdp["GDP"] = gdp["2020"]

gdp["Land"] = land_area["2020"]

gdp = gdp.dropna(subset=["GDP", "Land"])

from scipy import stats

print(stats.pearsonr(gdp.Land, gdp.GDP))

#+RESULTS: : PearsonRResult(statistic=0.8151313879150333, pvalue=5.621180589722219e-61)

Re:Maps Distort How We See the World by dwaltrip on Monday July 10, 2023 @01:41PM (#36669969)
Thanks for double checking. I ran out of steam on the convo heh.