placestats

Basic sanitation vs. HIV prevalence

Holds up after adjusting for income

Across 148 countries, Basic sanitation and HIV prevalence rise and fall together at r = -0.29 (on a scale from −1 to +1, where 0 means no link). It holds up almost unchanged when only countries with similar income (GDP per person) are compared (r = -0.19, q = 0.0083, allowing for the many pairs tested). Caution: direction is not consistent across regions.

Comparing countries across the middle half of basic sanitation, 56.5% to 98.1% of population, hiv prevalence is better by 1.5% of adults aged 15-49 at the top of that range than the bottom. Comparing only countries with similar national income, the gap is 1.62% of adults aged 15-49.

Link before adjusting (r)-0.292p = 0.000 · 148 countries
After adjusting for national income-0.193p = 0.019 · likely range [-0.34, -0.03]
p, allowing for regions0.000standard error 0.024 · 7 regions
Check for luck (q)0.008across 12,497 pairs

How to read these.r runs from −1 (one goes up as the other goes down) to +1 (they rise together), and 0 means no link. Adjusting for national income means comparing countries with the same GDP per person, so differences in wealth can’t explain the link. Income is used in percentage terms, since an extra $1,000 means more to a poor country than to a rich one. p is how likely a link this strong would be if there were really none. Below 0.05 means it is unlikely to be chance. Very small values are written in short form: 1.1e-32 means a decimal point followed by 31 zeros and then 11, so very close to zero. The likely range is where the true figure probably lies, and a range that crosses zero means the link could easily be chance. Countries in the same region tend to resemble each other, so the third figure allows for that, which gives a fairer p. The standard error is the typical size of the error in r. Finally, testing this many pairs means some will look strong by luck alone. A q below 0.05 means this link is unlikely to be one of those.

Basic sanitation · % of populationlink with income +0.79 · high
HIV prevalence · % of adults aged 15-49link with income -0.40 · moderate

“Link with income” is how closely each measure tracks GDP per person across countries, from −1 to +1.

Every country as a dot

Basic sanitation · % of population →HIV prevalence · % of adults aged 15-49 →10.4%100%0.1%23.4%Afghanistan: 54.5% of population, 0.1% of adults aged 15-49Angola: 50.3% of population, 1.6% of adults aged 15-49Albania: 99.3% of population, 0.1% of adults aged 15-49United Arab Emirates: 99.1% of population, 0.1% of adults aged 15-49Argentina: 94.8% of population, 0.4% of adults aged 15-49Armenia: 93.7% of population, 0.4% of adults aged 15-49Antigua and Barbuda: 99.6% of population, 1.1% of adults aged 15-49Australia: 100% of population, 0.1% of adults aged 15-49Azerbaijan: 99% of population, 0.1% of adults aged 15-49Burundi: 44.6% of population, 0.8% of adults aged 15-49Belgium: 99.5% of population, 0.2% of adults aged 15-49Benin: 22.2% of population, 0.7% of adults aged 15-49Burkina Faso: 31.8% of population, 0.5% of adults aged 15-49Bangladesh: 67.6% of population, 0.1% of adults aged 15-49Bulgaria: 86.1% of population, 0.1% of adults aged 15-49Bahrain: 100% of population, 0.1% of adults aged 15-49Bahamas, The: 93.7% of population, 1.1% of adults aged 15-49Belize: 84.3% of population, 1.2% of adults aged 15-49Bolivia: 71.6% of population, 0.4% of adults aged 15-49Brazil: 92.4% of population, 0.7% of adults aged 15-49Barbados: 98.1% of population, 1% of adults aged 15-49Bhutan: 86.8% of population, 0.2% of adults aged 15-49Botswana: 72.1% of population, 15.7% of adults aged 15-49Central African Republic: 14% of population, 2.4% of adults aged 15-49Canada: 98.6% of population, 0.1% of adults aged 15-49Switzerland: 99.9% of population, 0.2% of adults aged 15-49Chile: 100% of population, 0.7% of adults aged 15-49Cote d'Ivoire: 40.4% of population, 1.7% of adults aged 15-49Cameroon: 47.1% of population, 2.5% of adults aged 15-49Congo, Dem. Rep.: 16.3% of population, 0.7% of adults aged 15-49Congo, Rep.: 20.6% of population, 3.2% of adults aged 15-49Colombia: 96.6% of population, 0.6% of adults aged 15-49Comoros: 57.2% of population, 0.1% of adults aged 15-49Cabo Verde: 83.1% of population, 0.9% of adults aged 15-49Costa Rica: 98.8% of population, 0.6% of adults aged 15-49Germany: 99.2% of population, 0.2% of adults aged 15-49Djibouti: 67% of population, 0.9% of adults aged 15-49Dominica: 80.4% of population, 0.5% of adults aged 15-49Denmark: 99.6% of population, 0.1% of adults aged 15-49Dominican Republic: 90.1% of population, 1% of adults aged 15-49Algeria: 85.9% of population, 0.1% of adults aged 15-49Ecuador: 91.2% of population, 0.4% of adults aged 15-49Egypt, Arab Rep.: 97.1% of population, 0.1% of adults aged 15-49Spain: 99.9% of population, 0.3% of adults aged 15-49Estonia: 99% of population, 0.7% of adults aged 15-49Ethiopia: 10.4% of population, 0.7% of adults aged 15-49Fiji: 92.8% of population, 1% of adults aged 15-49France: 98.6% of population, 0.3% of adults aged 15-49Gabon: 57.4% of population, 2.8% of adults aged 15-49United Kingdom: 99.1% of population, 0.2% of adults aged 15-49Georgia: 90.7% of population, 0.4% of adults aged 15-49Ghana: 31.6% of population, 1.5% of adults aged 15-49Guinea: 32.6% of population, 1.3% of adults aged 15-49Gambia, The: 48.2% of population, 1.3% of adults aged 15-49Guinea-Bissau: 28.9% of population, 2.2% of adults aged 15-49Greece: 99% of population, 0.3% of adults aged 15-49Guatemala: 71.2% of population, 0.2% of adults aged 15-49Guyana: 91.3% of population, 1.6% of adults aged 15-49Honduras: 87.7% of population, 0.2% of adults aged 15-49Croatia: 95.8% of population, 0.1% of adults aged 15-49Haiti: 29.1% of population, 1.6% of adults aged 15-49Indonesia: 88.2% of population, 0.4% of adults aged 15-49India: 83.4% of population, 0.2% of adults aged 15-49Ireland: 89.7% of population, 0.2% of adults aged 15-49Iraq: 98.5% of population, 0.1% of adults aged 15-49Iceland: 98.8% of population, 0.1% of adults aged 15-49Italy: 99.9% of population, 0.3% of adults aged 15-49Jamaica: 91.6% of population, 1.1% of adults aged 15-49Jordan: 96.4% of population, 0.1% of adults aged 15-49Kazakhstan: 97.9% of population, 0.3% of adults aged 15-49Kenya: 40.9% of population, 3% of adults aged 15-49Kyrgyz Republic: 98.5% of population, 0.3% of adults aged 15-49Cambodia: 83.3% of population, 0.5% of adults aged 15-49St. Kitts and Nevis: 95% of population, 0.8% of adults aged 15-49Kuwait: 100% of population, 0.1% of adults aged 15-49Lao PDR: 88.7% of population, 0.4% of adults aged 15-49Lebanon: 99.2% of population, 0.1% of adults aged 15-49Liberia: 23.3% of population, 0.9% of adults aged 15-49Libya: 88.5% of population, 0.1% of adults aged 15-49St. Lucia: 83.4% of population, 0.4% of adults aged 15-49Sri Lanka: 95.4% of population, 0.1% of adults aged 15-49Lesotho: 47.9% of population, 17.1% of adults aged 15-49Lithuania: 96.4% of population, 0.2% of adults aged 15-49Luxembourg: 97.6% of population, 0.3% of adults aged 15-49Latvia: 92.5% of population, 0.5% of adults aged 15-49Morocco: 87.8% of population, 0.1% of adults aged 15-49Moldova: 86.9% of population, 0.9% of adults aged 15-49Madagascar: 15.4% of population, 0.5% of adults aged 15-49Maldives: 99.7% of population, 0.1% of adults aged 15-49Mexico: 93% of population, 0.5% of adults aged 15-49North Macedonia: 99% of population, 0.1% of adults aged 15-49Mali: 47.8% of population, 0.8% of adults aged 15-49Malta: 100% of population, 0.3% of adults aged 15-49Myanmar: 74.2% of population, 0.9% of adults aged 15-49Montenegro: 97.8% of population, 0.1% of adults aged 15-49Mongolia: 74.3% of population, 0.1% of adults aged 15-49Mozambique: 38.6% of population, 11.5% of adults aged 15-49Mauritania: 58.7% of population, 0.1% of adults aged 15-49Malawi: 49.2% of population, 6.2% of adults aged 15-49Malaysia: 96% of population, 0.3% of adults aged 15-49Namibia: 38.7% of population, 9% of adults aged 15-49Niger: 16.3% of population, 0.2% of adults aged 15-49Nigeria: 47.9% of population, 1.2% of adults aged 15-49Netherlands: 97.7% of population, 0.1% of adults aged 15-49Norway: 98% of population, 0.1% of adults aged 15-49Nepal: 86% of population, 0.1% of adults aged 15-49New Zealand: 100% of population, 0.1% of adults aged 15-49Oman: 99.3% of population, 0.1% of adults aged 15-49Pakistan: 71.9% of population, 0.2% of adults aged 15-49Panama: 89.1% of population, 1.1% of adults aged 15-49Peru: 78.8% of population, 0.4% of adults aged 15-49Philippines: 87.2% of population, 0.3% of adults aged 15-49Papua New Guinea: 23.6% of population, 1.5% of adults aged 15-49Portugal: 99.7% of population, 0.5% of adults aged 15-49Paraguay: 95.9% of population, 0.5% of adults aged 15-49Qatar: 99.9% of population, 0.1% of adults aged 15-49Romania: 90.5% of population, 0.2% of adults aged 15-49Rwanda: 81.3% of population, 2% of adults aged 15-49Saudi Arabia: 97.6% of population, 0.1% of adults aged 15-49Sudan: 65.7% of population, 0.2% of adults aged 15-49Senegal: 62.5% of population, 0.3% of adults aged 15-49Singapore: 100% of population, 0.1% of adults aged 15-49Solomon Islands: 34.6% of population, 0.1% of adults aged 15-49Sierra Leone: 24.9% of population, 1.4% of adults aged 15-49El Salvador: 88% of population, 0.4% of adults aged 15-49Somalia, Fed. Rep.: 44.5% of population, 0.1% of adults aged 15-49Serbia: 97.9% of population, 0.1% of adults aged 15-49Suriname: 90% of population, 1.6% of adults aged 15-49Slovak Republic: 97.5% of population, 0.1% of adults aged 15-49Slovenia: 98.3% of population, 0.1% of adults aged 15-49Sweden: 98.7% of population, 0.1% of adults aged 15-49Eswatini: 64.5% of population, 23.4% of adults aged 15-49Syrian Arab Republic: 95.6% of population, 0.1% of adults aged 15-49Chad: 13.1% of population, 0.9% of adults aged 15-49Togo: 25.2% of population, 1.6% of adults aged 15-49Thailand: 99.4% of population, 1% of adults aged 15-49Tajikistan: 96% of population, 0.2% of adults aged 15-49Timor-Leste: 72.9% of population, 0.2% of adults aged 15-49Tunisia: 98.5% of population, 0.1% of adults aged 15-49Tuvalu: 89.7% of population, 0.4% of adults aged 15-49Tanzania: 37.2% of population, 3.5% of adults aged 15-49Uganda: 23.9% of population, 4.9% of adults aged 15-49St. Vincent and the Grenadines: 89.7% of population, 0.8% of adults aged 15-49Viet Nam: 95.4% of population, 0.4% of adults aged 15-49Vanuatu: 47.8% of population, 0.1% of adults aged 15-49South Africa: 77.4% of population, 17.2% of adults aged 15-49Zambia: 37.5% of population, 9.4% of adults aged 15-49Zimbabwe: 34.6% of population, 9.8% of adults aged 15-49BWAETHKWTLSOMDGNERNZLSGPSWZZAF

best-fit line line after adjusting

Four ways to measure the link

MethodrpCountries
Standard (Pearson), not adjusted-0.2920.000148
By rank (Spearman), not adjusted-0.5391.6e-12148
Standard (Pearson), adjusted for national income-0.1930.019148
By rank (Spearman), adjusted for national income-0.4014.8e-7148

The rank version uses only each country’s place in line, from lowest to highest, so a few extreme countries count for less. The adjusted and unadjusted versions use the same 148 countries: those that report both measures and GDP per person. So the gap between them comes from the adjustment, not from a change in which countries are counted. Drop in the size of r after adjusting: +0.100 (a minus sign means it grew).

How solid is it?

Leaving out one country at a time, r ranges from -0.212 (without ZAF) to -0.167 (without NAM). The bar above shows that range on a scale from −1 to +1, with the solid line at the full result. The single country that moves r most: NAM (+0.026).

Fragile: this link may not hold up.
  • direction is not consistent across regions

Within each region

Countries are not separate, unrelated cases, and neighbors share a lot. A link that holds inside each region is far more believable than one that shows up only when comparing regions.

nr
East Asia & Pacific18-0.09
Europe & Central Asia35-0.30
Latin America & Caribbean27-0.38
Middle East, North Africa, Afghanistan & Pakistan19-0.48
Sub-Saharan Africa42+0.19

By income third

If the link shows up only in the richest third of countries, it is a feature of rich countries, not a general pattern.

nr
Poorest third50-0.14
Middle third49-0.41
Richest third49-0.32

By largest religious group

Countries grouped by a label they share, such as main religion, rather than by a number. Groups of fewer than twelve countries are not shown. These groups differ in income, region and history all at once. So a gap between them is a place to start asking questions, not an answer.

nr
Christians89-0.10
Muslims42-0.62

By last european coloniser

Countries grouped by a label they share, such as main religion, rather than by a number. Groups of fewer than twelve countries are not shown. These groups differ in income, region and history all at once. So a gap between them is a place to start asking questions, not an answer.

nr
France25-0.66
Never a European colony14-0.38
Spain16-0.07
United Kingdom51-0.27

Without outliers (countries far outside the middle half of countries on either measure, by more than one and a half times the width of that middle half): r = -0.337 after dropping 16 countries.

Two series, one country

Both measures over the years for one country you pick. The two charts are stacked so they share only the years along the bottom.

Loading…

Over time, within countries

Everything above compares countries with each other at one moment. This section compares each country only with itself over 25years. So a link here can’t come from anything about a country that stays the same, such as its history, geography, institutions or culture.

Within countries over time, there is no link that is clearly more than chance (r = +0.009, comparing each country only with itself over the years, and each year only with the same year elsewhere). Whatever the cross-country picture shows, countries whose basic sanitation moved did not tend to see their hiv prevalence move with it.

Across countries (adjusted)-0.193for comparison
Within countries-0.173each country vs itself
…and vs the same year elsewhere+0.009q = 0.961 · 152 countries
Year-on-year changes+0.002q = 0.989
Read with care.
  • Almost all of this indicator's variation is between countries, not within them, so the within-country estimate rests on a small part of the data.

3,681 country-years (one country in one year), 152 countries, 2000–2024, about 24 years each on average. Share of the variation that happens within countries over time: 5% for Basic sanitation, 2% for HIV prevalence. The margins of error allow for each country appearing many times, and for each year’s value being close to the year before.

Year-to-year changes are a cautious test, not a final answer. Looking only at changes from one year to the next removes each country’s own trends. But it also makes measurement mistakes louder, which pulls the results toward zero. A near-zero result here is weak evidence of no link, not proof.

With one measure years behind the other

0.20−0.2-100+10years HIV prevalence trails Basic sanitation →lag -10: r = 0.102 (n = 3,669)lag -9: r = 0.101 (n = 3,670)lag -8: r = 0.097 (n = 3,671)lag -7: r = 0.091 (n = 3,672)lag -6: r = 0.084 (n = 3,673)lag -5: r = 0.074 (n = 3,674)lag -4: r = 0.062 (n = 3,680)lag -3: r = 0.050 (n = 3,682)lag -2: r = 0.036 (n = 3,684)lag -1: r = 0.022 (n = 3,684)lag +0: r = 0.009 (n = 3,681)lag +1: r = 0.002 (n = 3,543)lag +2: r = -0.004 (n = 3,403)lag +3: r = -0.009 (n = 3,261)lag +4: r = -0.015 (n = 3,117)lag +5: r = -0.021 (n = 2,973)lag +6: r = -0.027 (n = 2,828)lag +7: r = -0.035 (n = 2,682)lag +8: r = -0.041 (n = 2,530)lag +9: r = -0.047 (n = 2,381)lag +10: r = -0.052 (n = 2,228)

Same year (lag 0): +0.009. A peak away from zero does not show which comes first. These series change slowly — this year’s value is close to last year’s. That makes the curve smooth and nearly symmetric, whatever produced the data. Even a sharp peak at one lag (a gap of some years) would not prove that one measure changes the other.

This curve peaks at the edge of the window (lag -10), so it is still drifting where the search stops. That pattern usually reflects a slow trend left over in the data, not a link with real timing. The peak value should not be read as the “true” link at the right lag.

The data


% of population

% of adults aged 15-49
Years
Singapore SGP100%0.1%2024
New Zealand NZL100%0.1%2024
Malta MLT100%0.3%2024
Kuwait KWT100%0.1%2024
Bahrain BHR100%0.1%2024
Australia AUS100%0.1%2024
Chile CHL100%0.7%2024
Qatar QAT99.9%0.1%2024
Spain ESP99.9%0.3%2024
Switzerland CHE99.9%0.2%2024
Italy ITA99.9%0.3%2024
Maldives MDV99.7%0.1%2024
Portugal PRT99.7%0.5%2024
Antigua and Barbuda ATG99.6%1.1%2024
Denmark DNK99.6%0.1%2024

World Bank, World Development Indicators
World Bank, World Development Indicators

Sources

Basic sanitation

People using at least basic sanitation services (% of population)

World Bank · CC BY 4.0 · updated quarterly

HIV prevalence

Prevalence of HIV, total (% of population ages 15-49)

UNAIDS · CC BY 4.0 · updated quarterly

Estimates from a statistical model. Very lopsided: a few southern African countries sit about ten times higher than everyone else. So a link with this is largely a link with them, and the "leave one out" check on each pair page shows by how much.

How this was computed

Data used: most recent value in 2010-2025; values come from 2016–2024. To adjust for income, each measure is first predicted from GDP per person (in percentage terms, on a log scale) with a straight-line fit. Only what is left over is then compared. This is called a partial correlation. The line is drawn the standard way (ordinary least squares), which picks the line that comes closest to all the countries at once. The error margins allow for countries in the same region resembling each other, using 7 World Bank regions. The q-value corrects for testing all 12,497 pairs at once, using the Benjamini–Hochberg method. Underlying data last updated DYB 2024. How the country data works · explore Basic sanitation and HIV prevalence

This page shows that two measures go together. It does not show that Basic sanitation changes HIV prevalence, or the reverse. These figures also describe countries, not individual people. See the ecological fallacy.

More links with Basic sanitation or HIV prevalence