How Rankodex builds its rankings

How Rankodex turns published rankings and agency files into one dataset, and how it computes the ranks, percentiles, combined scores and correlations you see. For short definitions of each term, see the glossary.

Where the data comes from

Most topics come from the ranking pages of World Population Review, which compiles each list from the primary sources it cites. A smaller set is built directly from files published by agencies such as the Census Bureau, the Bureau of Economic Analysis, the Bureau of Labor Statistics, the CDC, the EPA, the FBI, NOAA and the World Bank. Sources and licensing lists them, and each topic page credits its own.

From source pages to one dataset

A build pipeline turns the sources into the dataset the site reads. In order, it:

  1. Downloads the ranking pages for countries, US states, US cities, world cities and US counties into a local cache, a few at a time (the source’s robots.txt allows this), along with the agency files. Cached pages are not downloaded again unless a refresh is asked for.
  2. Reads the data tables embedded in each page, keeping the numbers, the column and page titles, the source citations and the date the page was last updated. It does not copy the pages’ articles.
  3. Matches every row to one place. Countries are identified by their three-letter ISO code, US states by postal code (the District of Columbia included), counties by their five-digit FIPS code and cities by name, so the same place lines up across every topic. Agency rows for places that are not on the site, such as World Bank regions, are dropped.
  4. Cleans the values. Figures such as “$1,234”, “12%” or “+3” are read as numbers, and placeholders such as “N/A” or “—” count as missing. Figures stored in another unit than their label are converted: populations stored in thousands, distances stored in kilometres under a miles label, money stored in millions or billions, and ratios stored the other way up (males per female under a “females per male” label).
  5. Recognises rank columns. A column named as a rank or ranking that holds whole numbers from 1 up is treated as positions (1st, 2nd…), not as an amount.
  6. Removes noise. A count column that only repeats another column of the same year is dropped, a statistic with no values is left off its topic, and a topic with nothing left is not published. A short list of hand corrections fixes column titles, units and formats the source gets wrong; individual values are never edited by hand.

Which year you see

Many statistics come with several years. Each one opens on a default year, chosen by these rules:

  • The latest year that covers at least half as many places as the best-covered year wins, so a year with only a few early figures does not.
  • Projections (years after the year the dataset is built) count only when there is nothing else.
  • If that year is more than five years older than the newest data, the newest year covering at least 15% as many places (and at least 5) wins instead.
  • An undated column that covers at least 1.5 times as many places beats the dated choice.

Topic pages let you switch to any other year the source has. Because sources publish on different schedules, two statistics on the same page or comparison can refer to different years.

Which direction is better

Each statistic has a better direction: higher is better (income, life expectancy), lower is better (crime, unemployment, costs), or neutral (population, area, preferences, years). The direction is set from the statistic’s name by fixed rules, then from its topic. Taxes residents pay count as lower-is-better, while tax collections, shares and brackets are neutral.

The rules are a judgement call, not a fact about the data. In comparisons and combined rankings you can flip any statistic’s direction, and the change is kept in the link you share.

Published ranks need care: on most lists rank 1 is the best place, but on a “worst” or “most dangerous” list rank 1 is the worst. Rankodex reads ranks by standing, so a better standing always counts as better in percentiles, colours, correlations and combined scores, and a topic page lists such a column rank 1 first, as the source does.

Ranks and percentiles

A place’s rank is its position among the places that have data, counted in the better direction (for a neutral statistic, from the highest value). Places with the same value share a rank, as in 1, 2, 2, 4, and “3rd of 50” counts only the 50 places with data.

A percentile runs from 0 (the worst place) to 100 (the best), based on ranks with ties averaged, so statistics in different units can be compared. Places without data are left out of both.

Combined rankings

A combined ranking turns several statistics into one score per place:

  1. Each statistic is put on a common scale (normalised): percentiles by default, or z-scores or min–max scaling.
  2. Each is turned so that better is higher, using its direction.
  3. Each is multiplied by its weight, and the results are averaged over the statistics the place has data for.

A place is scored only if it has data for at least half of the total weight by default (the minimum data coverage, which you can change), so a place missing most statistics is not ranked on the one or two it has. The ready-made rankings use only statistics that cover at least 85% of places, relaxed to 60% or 35% for place types with sparse data, and skip statistics that mostly track population or nearly duplicate another one.

Correlations

A correlation measures how closely two statistics move together across places, from −1 to +1. Rankodex reports two kinds:

  • Pearson r on the values themselves, which measures a straight-line relationship and can be swayed by a few extreme places.
  • Spearman ρ on the places’ ranks, which catches any steady up-or-down relationship and is not swayed by outliers.

Both use only the places that have a value for both statistics, and need at least three. The p-value is two-sided, from Student’s t distribution with n − 2 degrees of freedom; below 0.05 is called statistically significant. Strength is worded from the size of r: under 0.1 is no meaningful relationship, then weak (under 0.3), moderate (under 0.5), strong (under 0.7) and very strong.

On a topic page, “what correlates” tests the topic’s statistic (with Pearson r) against every numeric statistic of other topics for the same kind of place that shares at least 10 places and 60% of its coverage. Near-identical copies of the same series (|r| of 0.995 or more) are skipped and relationships under 0.1 are not listed. Ranks are read by standing, so with a rank a positive r means a better rank, not a bigger number.

A correlation across places is not causation, and says nothing about individual people: two statistics can move together because both depend on something else, such as income or population.

Adjustments

Topic pages and comparisons can adjust figures that are hard to compare as published. Each is offered only where it applies:

  • Cost of living puts wages and incomes at the US-average price level, using the Bureau of Economic Analysis’s Regional Price Parities for states and US cities (each city takes its metro area’s) and the World Bank’s price level for countries. Prices, rents and taxes are left as they are.
  • Share of income divides household costs such as rent, home values, child care and insurance premiums by the place’s median household income from the Census Bureau (GDP per person for countries), as a percentage of income or as years of income.
  • Per person divides totals that grow with population by the number of residents: per 100,000 people for counts and per person for money.

Place profiles and stories

A place profile calls a place best or worst at something only on rankings that cover at least half of the places of its kind, or on partial rankings of the largest places. Top lists picked by their own statistic, such as “the richest cities”, say nothing about places that are not on them, so they are not used for those claims. Totals that mostly track population are left out of strengths and weak spots, so a profile is about the place rather than its size.

Data stories are computed when the dataset is built: the charts, tables and every figure in their text come from the same dataset, and the text is written around those numbers.

Updates and limits

The dataset is rebuilt when the pipeline is run again, not on a fixed schedule. Each rebuild is committed to the public repository, so its history shows what changed and when, and the footer of every page shows the date of the current build. Topic pages show the date their source last updated the figures, when the source gives one.

Figures can lag their sources, sources can revise past values, and errors in a source carry over until it corrects them. If you spot one, report it.