Introduction
Research Question
Is there a correlation between HIV mortality and GDP per capita?
HIV/AIDS was first recognized in the United States in 1981, and since then it has become one of the major global epidemics. It is estimated that in 2020 alone, about 680,000 people died from HIV-related illnesses, and 38 million people were living with HIV (UNICEF, 2021).
I first learned about HIV/AIDS when I was 14 years old, and since then I have been interested to know more about this disease. While I was looking at HIV deaths in 2020, I realized that eight of the ten nations with the most HIV deaths are African. This led me to use mathematics to investigate whether there is a relationship between HIV deaths and GDP per capita in the 29 nations with the highest HIV mortality.
Mathematical Exploration
Correlation is used in mathematics and statistics to describe the association between two variables by its strength (strong or weak) and its direction (positive or negative). As a rough guide, a correlation coefficient above 0.5 in absolute value shows a strong correlation and one below 0.5 a weak correlation (Schober et al., 2018). A correlation is negative when one variable decreases as the other increases, and positive when both variables move in the same direction.
In this exploration, I use the Pearson correlation coefficient and a scatter plot with a least squares line to measure the correlation between HIV mortality and GDP per capita in 29 countries, and a t-test to check whether the result could be due to chance.
Pearson Correlation
The Pearson product-moment correlation coefficient r is calculated as:
where x is the explanatory variable (here, HIV deaths), y is the response variable (GDP per capita), and x̄ and ȳ are their means. The mean of a data set is:
where Σx is the sum of the values and n is the number of values. The value of r lies between −1 and 1: values close to 1 show a strong positive correlation, values close to −1 a strong negative correlation, and values close to 0 no linear correlation.
Scatter Plot
A scatter plot shows the data graphically, with the explanatory variable on the x-axis and the response variable on the y-axis. If the line of best fit rises, the gradient is positive and so is the correlation; if it falls, the gradient and the correlation are negative. If the points show no trend, the correlation coefficient is close to 0.
Aim and Hypothesis
This exploration aims to use mathematical tools (the Pearson correlation coefficient and a scatter plot) to find out whether there is a relationship between gross domestic product per capita and HIV mortality, using data for 2020.
I hypothesize that there is no correlation between GDP per capita and HIV mortality: the correlation coefficient will be close to 0, and the line of best fit on the scatter plot will be close to flat.
Data
The HIV deaths for each country were taken from Index Mundi (indexmundi.com), and GDP per capita for the same 29 countries from the World Bank figures published by Our World in Data (ourworldindata.org). The countries are the 29 with the most HIV deaths in 2020, ranked in Table 1.
| Country | HIV deaths (thousands) | GDP per capita (international $) |
|---|---|---|
| South Africa | 72 | 12,666 |
| India | 69 | 6,166 |
| Mozambique | 51 | 1,230 |
| Nigeria | 45 | 4,917 |
| Indonesia | 38 | 11,445 |
| Tanzania | 27 | 2,625 |
| Kenya | 21 | 4,340 |
| Uganda | 21 | 2,175 |
| Zimbabwe | 20 | 3,353 |
| Zambia | 17 | 3,278 |
| DR Congo | 15 | 1,082 |
| Ghana | 14 | 5,446 |
| Cameroon | 14 | 3,666 |
| Brazil | 14 | 14,064 |
| Thailand | 14 | 17,285 |
| Malawi | 13 | 1,509 |
| Angola | 13 | 6,110 |
| Ethiopia | 12 | 2,297 |
| South Sudan | 9.1 | 3,114 |
| Myanmar | 7.7 | 4,875 |
| Pakistan | 6.8 | 4,563 |
| Ukraine | 5.9 | 12,376 |
| Mali | 5.8 | 2,226 |
| Botswana | 5 | 14,655 |
| Vietnam | 5 | 8,200 |
| Lesotho | 4.8 | 2,317 |
| Republic of the Congo | 4.5 | 3,434 |
| Colombia | 4.1 | 13,449 |
| Mexico | 4 | 17,852 |
| Total | 552.7 | 190,715 |
Statistical Analysis
Means
Using the totals in Table 1:
On average, the 29 countries had 19.06 thousand HIV deaths and a GDP per capita of 6,576 international dollars.
Pearson Correlation Coefficient
Table 2 gives the deviation of each value from its mean, the products of the deviations and their squares.
| Country | x | y | x − x̄ | y − ȳ | (x − x̄)(y − ȳ) | (x − x̄)² | (y − ȳ)² |
|---|---|---|---|---|---|---|---|
| South Africa | 72 | 12,666 | 52.94 | 6,090 | 322,393 | 2,802.79 | 37,083,480 |
| India | 69 | 6,166 | 49.94 | −410 | −20,495 | 2,494.14 | 168,411 |
| Mozambique | 51 | 1,230 | 31.94 | −5,346 | −170,771 | 1,020.25 | 28,583,772 |
| Nigeria | 45 | 4,917 | 25.94 | −1,659 | −43,047 | 672.96 | 2,753,540 |
| Indonesia | 38 | 11,445 | 18.94 | 4,869 | 92,218 | 358.78 | 23,703,467 |
| Tanzania | 27 | 2,625 | 7.94 | −3,951 | −31,379 | 63.07 | 15,613,398 |
| Kenya | 21 | 4,340 | 1.94 | −2,236 | −4,342 | 3.77 | 5,001,392 |
| Uganda | 21 | 2,175 | 1.94 | −4,401 | −8,545 | 3.77 | 19,372,140 |
| Zimbabwe | 20 | 3,353 | 0.94 | −3,223 | −3,034 | 0.89 | 10,390,174 |
| Zambia | 17 | 3,278 | −2.06 | −3,298 | 6,790 | 4.24 | 10,879,306 |
| DR Congo | 15 | 1,082 | −4.06 | −5,494 | 22,300 | 16.47 | 30,188,204 |
| Ghana | 14 | 5,446 | −5.06 | −1,130 | 5,718 | 25.59 | 1,277,757 |
| Cameroon | 14 | 3,666 | −5.06 | −2,910 | 14,723 | 25.59 | 8,470,308 |
| Brazil | 14 | 14,064 | −5.06 | 7,488 | −37,877 | 25.59 | 56,064,464 |
| Thailand | 14 | 17,285 | −5.06 | 10,709 | −54,171 | 25.59 | 114,674,557 |
| Malawi | 13 | 1,509 | −6.06 | −5,067 | 30,701 | 36.71 | 25,678,333 |
| Angola | 13 | 6,110 | −6.06 | −466 | 2,826 | 36.71 | 217,510 |
| Ethiopia | 12 | 2,297 | −7.06 | −4,279 | 30,207 | 49.82 | 18,313,087 |
| South Sudan | 9.1 | 3,114 | −9.96 | −3,462 | 34,481 | 99.17 | 11,988,070 |
| Myanmar | 7.7 | 4,875 | −11.36 | −1,701 | 19,325 | 129.02 | 2,894,692 |
| Pakistan | 6.8 | 4,563 | −12.26 | −2,013 | 24,681 | 150.27 | 4,053,696 |
| Ukraine | 5.9 | 12,376 | −13.16 | 5,800 | −76,315 | 173.15 | 33,635,600 |
| Mali | 5.8 | 2,226 | −13.26 | −4,350 | 57,680 | 175.79 | 18,925,800 |
| Botswana | 5 | 14,655 | −14.06 | 8,079 | −113,574 | 197.64 | 65,264,112 |
| Vietnam | 5 | 8,200 | −14.06 | 1,624 | −22,826 | 197.64 | 2,636,144 |
| Lesotho | 4.8 | 2,317 | −14.26 | −4,259 | 60,733 | 203.31 | 18,142,312 |
| Republic of the Congo | 4.5 | 3,434 | −14.56 | −3,142 | 45,749 | 211.95 | 9,874,548 |
| Colombia | 4.1 | 13,449 | −14.96 | 6,873 | −102,805 | 223.76 | 47,232,915 |
| Mexico | 4 | 17,852 | −15.06 | 11,276 | −169,795 | 226.76 | 127,139,622 |
| Total | 552.7 | 190,715 | 0.00 | 0 | −88,452 | 9,655.19 | 750,220,813 |
Substituting the totals from Table 2 into the formula:
The correlation coefficient of r = −0.0329 is negative but so close to 0 that it shows no linear relationship between HIV deaths and GDP per capita.
Scatter Plot
The data in Table 1 are plotted in Figure 1, with the least squares line:
- One country
- Least squares line: Ŷ = 6750.98 − 9.16X, r = −.033, R² = .001
Point at a country, or use the number buttons (arrow keys move between them), to see the GDP per capita the line predicts and the residual.
Mexico
- HIV deaths (thousands)
- 4.0
- GDP per capita (international $)
- 17852
- Predicted GDP per capita
- 6714.33
- Residual
- 17852 − 6714.33 = +11137.67: 11137.67 above the line
Figure 1 data: each country’s HIV deaths, GDP per capita, predicted GDP per capita and residual
| Country | HIV deaths (thousands) | GDP per capita (international $) | Predicted GDP per capita | Residual |
|---|---|---|---|---|
| 1 | 72.0 | 12666 | 6091.38 | +6574.62 |
| 2 | 69.0 | 6166 | 6118.86 | +47.14 |
| 3 | 51.0 | 1230 | 6283.76 | −5053.76 |
| 4 | 45.0 | 4917 | 6338.73 | −1421.73 |
| 5 | 38.0 | 11445 | 6402.86 | +5042.14 |
| 6 | 27.0 | 2625 | 6503.63 | −3878.63 |
| 7 | 21.0 | 4340 | 6558.59 | −2218.59 |
| 8 | 21.0 | 2175 | 6558.59 | −4383.59 |
| 9 | 20.0 | 3353 | 6567.76 | −3214.76 |
| 10 | 17.0 | 3278 | 6595.24 | −3317.24 |
| 11 | 15.0 | 1082 | 6613.56 | −5531.56 |
| 12 | 14.0 | 5446 | 6622.72 | −1176.72 |
| 13 | 14.0 | 3666 | 6622.72 | −2956.72 |
| 14 | 14.0 | 14064 | 6622.72 | +7441.28 |
| 15 | 14.0 | 17285 | 6622.72 | +10662.28 |
| 16 | 13.0 | 1509 | 6631.88 | −5122.88 |
| 17 | 13.0 | 6110 | 6631.88 | −521.88 |
| 18 | 12.0 | 2297 | 6641.04 | −4344.04 |
| 19 | 9.1 | 3114 | 6667.61 | −3553.61 |
| 20 | 7.7 | 4875 | 6680.44 | −1805.44 |
| 21 | 6.8 | 4563 | 6688.68 | −2125.68 |
| 22 | 5.9 | 12376 | 6696.93 | +5679.07 |
| 23 | 5.8 | 2226 | 6697.84 | −4471.84 |
| 24 | 5.0 | 14655 | 6705.17 | +7949.83 |
| 25 | 5.0 | 8200 | 6705.17 | +1494.83 |
| 26 | 4.8 | 2317 | 6707.00 | −4390.00 |
| 27 | 4.5 | 3434 | 6709.75 | −3275.75 |
| 28 | 4.1 | 13449 | 6713.42 | +6735.58 |
| 29 | 4.0 | 17852 | 6714.33 | +11137.67 |
The line falls very slightly, but the points are scattered widely around it with no visible pattern. The coefficient of determination R² = 0.0011 means that HIV deaths explain about 0.1% of the variation in GDP per capita, and √R² = 0.0329 with the sign of the gradient gives the same r = −0.0329 as the Pearson table. Countries with similar numbers of deaths have very different incomes: Brazil, Thailand, Ghana and Cameroon each had about 14 thousand HIV deaths, but GDP per capita ranged from 3,666 to 17,285 international dollars.
Testing the Significance of r
To check whether a correlation this small could arise by chance, I test the hypotheses for the population correlation ρ:
- H₀: ρ = 0 (HIV deaths and GDP per capita are not correlated)
- H₁: ρ ≠ 0 (HIV deaths and GDP per capita are correlated)
The test statistic follows a t-distribution with n − 2 = 27 degrees of freedom:
For a two-tailed test at the 5% significance level with 27 degrees of freedom, the critical values of t are ±2.052, which correspond to a critical r of ±0.367. Since |t| = 0.17 is far below 2.052 (p ≈ 0.87), the correlation is not significant, and the null hypothesis cannot be rejected.
Conclusion
The aim of this exploration was to investigate whether there is a relationship between GDP per capita and HIV mortality in 29 countries. I hypothesized that there would be no correlation. The Pearson correlation coefficient was r = −0.0329, the scatter plot gave the same value, and its least squares line is almost flat (R² = 0.0011). The t-test shows that the correlation is not significant at the 5% level. The data are therefore consistent with my hypothesis: they give no evidence of a linear relationship between a country’s GDP per capita and its number of HIV deaths. This does not prove that no relationship exists, only that this data set does not show one.
Evaluation
The aim was achieved, as the mathematical tools gave a clear and consistent answer, but several features of the data limit what the result can show.
First, the two variables are measured on different scales. HIV deaths are a total for each country, while GDP is per person. A large country can have many deaths even with a low death rate: India, with about 1.4 billion people, had almost as many HIV deaths as South Africa, with about 60 million. Using HIV deaths per 100,000 people would compare countries more fairly and could give a different result.
Second, the countries were chosen because they had the most HIV deaths. Countries with few deaths, which include most high-income countries, are left out, and this narrows the range of both variables. A random sample of countries, or all countries with available data, would test the relationship more fairly.
Third, the data come from one year and from two different sources. The 2020 figures may have been affected by the COVID-19 pandemic, which disrupted both economies and health services, and the HIV estimates for some countries are uncertain. Using data for at least five years, from a single source such as UNAIDS for the death figures, would make the results more reliable.
Finally, Pearson’s r only measures a linear relationship. A future exploration could also use Spearman’s rank correlation, which is less affected by extreme values such as South Africa and India, and could include other factors, such as spending on health care, that may influence HIV mortality.