Close Enough? Using the WGI as a Proxy for the WJP Rule of Law Index
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
TLDR: this post tests whether the Worldwide Governance Indicators’ (WGI) rule of law measure provides a reasonable proxy for the World Justice Project’s (WJP) Rule of Law Index, such as when analysis might benefit from the WGI’s availability for more countries over a longer period. Results suggest the two measures broadly agree with one another when making cross-country comparisons, but care is warranted for country-level estimates where it’s likely to be more difficult to differentiate measurement noise from genuine changes in the quality of institutions.
This is the first post in a series examining relationships between the rule of law and economic and social outcomes.
In the latter half of 2025 I was engaged by the Bingham Centre for the Rule of Law and The Law Society of England and Wales to facilitate internal discussions on the links between economic growth and the rule of law. Being subject to the Chatham House Rule means much of my work won’t see the light of day, but for those interested in the topic I’d recommend taking a look at Dr Lopez-Gomez’s literature review which provides a good summary of the issues discussed.
As somebody that dedicates a lot of time to conducting cross-country comparisons and using statistics to measure amorphous concepts, I started work on the project by identifying approaches for measuring the rule of law (RoL), to help anchor analysis and discussions to something tangible definition that was rigorous enough to satisfy a room full of lawyers, without offending institutional economists.
This led me to two composite measures:
- The World Justice Project’s (WJP) Rule of Law Index; and
- The World Bank’s Rule of Law measure from their Worldwide Governance Indicators (WGI).
Like all indices, both are constructed by collecting an assortment of indicators that are thought to proxy something important that can’t be easily be observed or quantified. A person’s performance at work is a good example of this: as even when we might know what a good employee looks it can be hard to explicitly define and quantify. Which often results in performance being proxied through some combination of vague indicators like judgement, communication and sticktoitiveness.
Composite indices work in a similar way, except that it’s often harder to validate whether they’re measuring anything useful due to the guiding concept itself being vague and divorced from our day-to-day experience. Unsurprisingly, this has resulted in the birth of a lot of terrible indices whose sole purpose appears to be to fabricate quantitative evidence for whatever concept they’re pushing, which is likely what motivated the OECD to develop this handbook on index design and construction.
But, there are also good examples out there too. Measures that earnestly attempt to define and quantify a complex phenomena while transparently admitting the inherent limitations and uncertainties of trying to do so in the first place. I’d argue both the WGI and WJP’s rule of law measures sit in this camp, with both making their data freely available and publishing statistical audits of their methodologies (see here for the WJP and here for the WGI).
Worldwide Governance Indicators: Rule of Law
The World Bank’s WGI is intended to provide a broad measure of how well a country is governed across six dimensions, including political stability, government effectiveness and the rule of law. Indicators are selected based on a set of screen criteria and their relevance to measuring a concept of interest. For instance, the WGI’s Rule of Law indicator intends to capture:
“…perceptions of the extent to which agents respect and follow the rules of society, including contract enforcement, property rights, the police, courts, and the likelihood of crime and violence.“
Indicators used to measure the rule of law include survey-based measures of crime, violence and public trust in the justice system and relevant composite indicators, such as PRS’s ‘Contract Viability’ measure.
World Justice Project: Rule of Law Index
The WJP’s index aims to provide a comprehensive picture of characteristics relevant to the rule of law, which they define as:
“…a durable system of laws, institutions, norms, and community commitment that delivers four universal principles: accountability, just law, open government, and accessible and impartial justice.”
This is done by organizing survey-based measures organized across eight factors thought to describe the relationship between the state and civil society, which are detailed in their methodology paper:
- Constraints on Government Powers: the extent to which those who govern are bound by law.
- Absence of Corruption: the absence of corruption in government
- Open Government: the extent to which a government shares information, empowers people with tools to hold the government accountable, and fosters citizen participation in public policy deliberations.
- Fundamental Rights: measures adherence to a menu of rights firmly established under the United Nations Universal Declaration of Human Rights.
- Order and Security: measures how well a society ensures the security of persons and property.
- Regulatory Enforcement: measures the extent to which regulations are fairly and effectively implemented and enforced.
- Civil Justice: measures whether ordinary people can resolve their grievances peacefully and effectively through the civil justice system.
- Criminal Justice: rates the effectiveness of the criminal justice system as a mechanism to redress grievances and bring action against individuals for offenses against society.
Why not both?
The WJP gets one of the fundamentals right of good index design: they’ve actually thought carefully about how to conceptualize and define what they’re trying to measure, providing a richer picture of different characteristics thought to be associated with the rule of law.
However, the WJP’s measure also comes with two important weaknesses for the purpose I had in mind: It covers less countries over a shorter time period than the WGI, which might matter when conducting analysis on slow moving institutions and outcomes. And, if presented in isolation, the WJP’s measure might be taken to imply that the RoL is both a necessary and sufficient condition for driving outcomes like economic growth, while the WGI presents the RoL as part of a collection of mutually supporting institutions.
In an attempt to have the best of both worlds, my first question was therefore whether it was possible to use both measures at the same time: the WJP’s measure when a more nuanced and explicit discussion of the RoL is required; and the WGI for longer-term analysis and communicating how the RoL might sit within a wider portfolio of institutions.
Conceptual and practical overlap
At the outside, aside from overlapping conceptually, the WJP and WGI also share common data sources: with five of six dimensions from the WGI sourcing data from the WJP’, including:
- Voice and Accountability: includes data from Factor 1, 3 and 4.
- Political Stability: leverages data from Factor 5.2
- Regulatory Quality: includes factor 6.
- Rule of Law: uses data from factors 1, 4, 5, 7 and 8.
- Control of Corruption: incorporates data from factor 2.
The upshot of this is that any observed relationship identified between the WJP and WGI might just reflect overlapping ingredients, rather than some deeper conceptual agreement on the rule of law. However, I’m largely going to ignore this in my analysis as:
- Before being included in the WGI, indicators from the same source are averaged to produce a single source–dimension input, which is likely to limit the WJP’s influence; and
- Sensitivity analysis reported in the 2025 WGI methodology update indicated that their estimates were largely insensitive to changes in weightings and the exclusion of individual indicators.
Making it probable that the bulk of any observed relationships are genuine, rather than being statistical truisms.
Project Setup and Data
Data used in this post can be downloaded here for the WGI and here for the WJP’s RoL index. These datasets were current as of July 2025, but publishers frequently update their results over time as the source data and methodology evolves.
#load the packages we'll probably need
library(tidyverse)
library(readxl)
library(janitor)
library(countrycode)
#import WGI data
dta_wgi_2025<-read_excel("./Data/wgidataset_with_sourcedata-2025.xlsx",
sheet="rl") |>
clean_names()
#import World Justice Project RoL data
dta_wjp_rol<-read_excel('./Data/2025_wjp_rule_of_law_index_HISTORICAL_DATA_FILE.xlsx', sheet="Historical Data")|>
clean_names()
Data Cleaning
Much of the data cleaning below relates to improving how variables are named and ensuring a standard set of country and region names are applied across indices. I’ve retained some indicators that aren’t used in this post as they’ll be drawn on later in the series.
#standardize column names
dta_wgi_2025<-dta_wgi_2025 |>
rename(country=economy_name,
iso3c=economy_code,
wgi_rol=governance_estimate_approx_2_5_to_2_5)
dta_wjp_rol<-dta_wjp_rol |>
rename(iso3c=country_code) |>
rename_with(~ str_replace(., "^x", "factor_"), starts_with("x"))
#change wjp's year variable to YYYY format and convert to numeric
#(adopts the first 4 digit year when in YYYY-YYYY format)
dta_wjp_rol <- dta_wjp_rol |>
mutate(year = as.numeric(str_sub(year, 1, 4)))
#cold-heartedly drop columns I'm not interested in
dta_wgi_2025<-dta_wgi_2025 |>
select(iso3c, income_classification, year,wgi_rol)
#drop country and region name labels so these can be standardized
dta_wjp_rol<-dta_wjp_rol |>
select(-country_year,-country,-region) |>
rename(wjp_rol=wjp_rule_of_law_index_overall_score)
#merge dataframes
dta_rol_unified<-left_join(dta_wgi_2025,
dta_wjp_rol,
by = join_by(year, iso3c),
keep=FALSE)
#add standardized and region names country names
#define country code assignments for legacy / ambigious codes
#(Note: matches devised by Claude)
ref_iso3c_custom_names <- c(ADO = "Andorra",
ANT = "Netherlands Antilles",
PRI = "Puerto Rico",
REU = "Réunion",
XKX = "Kosovo")
ref_iso3c_custom_regions <- c(ADO = "Europe & Central Asia",
ANT = "Latin America & Caribbean",
PRI = "Latin America & Caribbean",
REU = "Sub-Saharan Africa",
XKX = "Europe & Central Asia")
#assign country names and regions:
dta_rol_unified<-dta_rol_unified |>
mutate(country_name=countrycode(iso3c,
origin='iso3c',
destination = 'country.name.en',
custom_match = ref_iso3c_custom_names),
region=countrycode(iso3c,
origin='iso3c',
destination = 'region',
custom_match =ref_iso3c_custom_regions))
Comparing Coverage
Before examining the crossover of either index, it’s probably a good idea to check what’s not covered by either source. I rely on iso3c codes to do this as in my experience they tend to be specified more consistently than country names.
Overall, a little over 73 percent of countries listed in the countrycode package are covered by either index. A cursory glance of ref_missing_iso3c indicates most of the missing countries don’t have an iso3c code, no longer exist, are territories of a larger country (or claimed as one) and/or have relatively small populations. I’m also willing to take the WJP’s word for it when they say their index covers more than ninety percent of the worlds population.
#How many countries exist in either dataset
table(codelist$iso3c %in% dta_rol_unified$iso3c) |>
prop.table() |>
round(2)
#create listing of countries missing from either index
#(+ unecessarily using %notin% to undermine compatibility with R versions pre V4.6)
ref_missing_iso3c<-codelist[(codelist$iso3c %notin% dta_rol_unified$iso3c),] |>
select(iso3c, country.name.en)
#create a summary of country coverage over time
sum_rol_index_coverage_overall<- dta_rol_unified |>
group_by(year) |>
summarize(wjp = sum(!is.na(wjp_rol)),
wgi = sum(!is.na(wgi_rol)),
.groups = "drop")
Within the set of countries that are covered by be either index, the WGI provides estimates for more countries over a longer time period. Specifically, WGI RoL estimates are available from 1996 for 199 countries whereas the WJP’s measure starts in 2012 (2012-13) for 97 countries.
Although coverage has increased for both indices, it has increased more dramatically for the WJP over the period (46% compared to 8% for the WGI). The dumbbell plot below illustrates how the WJP’s coverage has increased relative to the WGI by region. Highlighting that the WJP’s coverage improvements have been heavily concentrated in Latin America and the Caribbean, and the Middle East and North Africa.

*North America’s coverage has remained the same over the period.
# compare coverage: WJP as % of WGI at index start (2012) vs end (2024)
sum_rol_index_coverage_by_region <- dta_rol_unified |>
group_by(region, year) |>
summarize(wjp = sum(!is.na(wjp_rol)),
wgi = sum(!is.na(wgi_rol)),
.groups = "drop") |>
filter(year %in% c(2012, 2024)) |>
mutate(wjp_pct_of_wgi = 100 * wjp / wgi) |>
select(region, year, wjp_pct_of_wgi) |>
pivot_wider(names_from = year, values_from = wjp_pct_of_wgi,
names_prefix = "yr_") |>
mutate(region = reorder(region, yr_2024))
plt_rol_index_coverage <- ggplot(sum_rol_index_coverage_by_region, aes(y = reorder(region,yr_2024) )) +
geom_segment(aes(x = yr_2012, xend = yr_2024, yend = region),
colour = "grey75", linewidth = 1) +
geom_point(aes(x = yr_2012, colour = "2012"), size = 5, alpha=0.7) +
geom_point(aes(x = yr_2024, colour = "2024"), size = 5, alpha=0.7) +
scale_colour_manual(values = c("2012" = "#E69F00", "2024" = "#0072B2")) +
scale_x_continuous(labels = function(x) paste0(x, "%")) +
labs(x = "Country Coverage (% of WGI)", y = NULL, colour = NULL,
title = "WJP Rule of Law index coverage by Region") +
theme_classic() +
theme(legend.position = "top",
panel.grid.major.y = element_line(colour = "grey92"))
plt_rol_index_coverage
Cross-country agreement between the indices
When examined globally, both measures exhibit strong agreement with one another. Suggesting that when a country achieves a poor (or strong) score on the WJP’s index they probably will on the WGI RoL measure too.

#association between the two measures - global plt_rol_index_comparison_global <- dta_rol_unified |> filter(!is.na(wjp_rol)) |> ggplot(aes(x = wgi_rol, y = wjp_rol)) + geom_point(aes(col = region), alpha = 0.5) + geom_smooth(method = "lm", col = "black", se = FALSE) + labs(x = "WGI rule of law index", y = "WJP rule of law index", col = "Region") + theme_classic() plt_rol_index_comparison_global
Regional agreement between the indices
This observation holds up when split by region. In fact when calculating regional correlations between the measures by year and region in dta_rol_cor_by_year_and_region the median correlation observed is 98%, with the lowest being 82% for MENA in 2019 and South Asia in 2012.

#association between the two measures - global
plt_rol_index_comparison_regional <- dta_rol_unified |>
filter(!is.na(wjp_rol)) |>
ggplot(aes(x = wgi_rol, y = wjp_rol)) +
geom_point(aes(col = region), alpha = 0.5) +
geom_smooth(method = "lm", col = "black", se = FALSE) +
labs(x = "WGI rule of law index", y = "WJP rule of law index", col = "Region") +
theme_classic()+
facet_wrap(region ~. )
plt_rol_index_comparison_regional
# Correlation between WGI and WJP rule-of-law measures, by year -----------
dta_rol_cor_by_year_and_region <- dta_rol_unified |>
filter(!is.na(wgi_rol), !is.na(wjp_rol)) |>
group_by(year, region) |>
summarise(
cor = cor(wgi_rol, wjp_rol))
#median correlation
median(dta_rol_cor_by_year_and_region$cor)
Agreement by country
Although agreement between the two measures appears less compelling at the country level, much of this likely stems from the rule of law being sticky and changing little from year to year; which results in measurement noise frequently dominating the underlying signal. This intuitive explanation appears to be largely supported by the scatter plot below, which suggests negative and weaker correlations are more likely for countries experiencing less within-country variation (aka where measurement noise is likely to dominate). The practical implication is that while caution is warranted at the country level, the two measures have a tendency to agree with one another when the observed changes are large enough not to be dominated by measurement noise.

#create list of countries with low number of observations
ref_low_n_obs<-dta_rol_unified |>
filter(!is.na(wgi_rol), !is.na(wjp_rol)) |>
group_by(country_name) |>
summarise(n_obs = n()) |>
filter(n_obs<5) |>
select(country_name) |>
unlist()
#calculate within-country assocation between WGI and WJI
sum_rol_cor_country <- dta_rol_unified |>
filter(!is.na(wgi_rol), !is.na(wjp_rol),
country_name %notin% ref_low_n_obs) |>
summarise(
n_obs = n(),
signal_sd = min(sd(wgi_rol), sd(wjp_rol)),
cor = cor(wgi_rol, wjp_rol),
.by = country_name) |>
arrange(cor)
#plot correlation coefficient against standard deviation of either measure
plt_cor_vs_signal <- ggplot(sum_rol_cor_country, aes(signal_sd, cor)) +
geom_hline(yintercept = 0, linewidth = 0.3, col = "grey70") +
geom_point(alpha = 0.6) +
geom_smooth(method = "loess", se = FALSE, col = "grey40", linewidth = 0.5) +
labs(x = "Within-country signal (min SD of the two indices)",
y = "WGI–WJP within-country correlation") +
theme_classic()
plt_cor_vs_signal
First Difference Agreement
As a final test the code below transforms each index into its first difference to explore whether year to year movements in the two measures agree with one another. Because taking the first difference removes country levels, this can be a helpful way to examine whether the two series reliably move together, but it also means measurement errors are more dominant, which can result in a noisier signal.
The good news is the first difference estimates provide solid support for the two measures being reliably linked, with a pooled correlation coefficient of 0.36 and observed positive associations across each region. Providing further support that the WGI’s RoL measure can act as an imperfect and/or imprecise general proxy for the WJP’s aggregate RoL measure, but not a perfect substitute.

# First-difference agreement between WGI and WJP rule-of-law measures ------
dta_rol_diff <- dta_rol_unified |>
filter(!is.na(wgi_rol), !is.na(wjp_rol)) |>
arrange(country_name, year) |>
mutate(
wgi_chg = wgi_rol - lag(wgi_rol, order_by = year),
wjp_chg = wjp_rol - lag(wjp_rol, order_by = year),
yr_gap = year - lag(year, order_by = year),
.by='country_name') |>
#drop differences calculated over more than one year
filter(yr_gap == 1)
#calculate pooled correlation across regions
sum_rol_diff_cor <- cor(dta_rol_diff$wgi_chg, dta_rol_diff$wjp_chg)
#produce plot
plt_rol_diff <- ggplot(dta_rol_diff, aes(wgi_chg, wjp_chg)) +
geom_hline(yintercept = 0, linewidth = 0.3, col = "grey80") +
geom_vline(xintercept = 0, linewidth = 0.3, col = "grey80") +
geom_point(alpha = 0.4, size = 0.9,aes(col = region)) +
geom_smooth(method = "lm", se = FALSE, col = "grey30", linewidth = 0.5) +
labs(x = "Δ WGI rule of law (year-on-year)",
y = "Δ WJP rule of law (year-on-year)",
subtitle = paste0("Pooled correlation of changes: r = ", round(sum_rol_diff_cor, 2))) +
theme_classic()+
facet_wrap(region ~. )
plt_rol_diff
Buried Lede
When I asked Claude to critique this post, it said that If the intended use is ranking/trend-tracking, the correlational case is fine and you can say so explicitly. If it’s cardinal substitution, a between-country prediction-error test is needed. I told Claude that this is a ridiculous idea and that I would cancel my subscription if it didn’t return to being sycophantic. And while Claude agreed that it was misguided in questioning my judgement, my reasoning for not including this analysis in the post is that nobody should be expecting this level of precision when using composite indices. Particularly not when they’re trying to pin down something as complex as the rule of law and governance.
This is because no index can perfectly capture and/or quantifiy something as amorphous as the rule of law. But composite indices don’t always need to. For the purpose of telling a broad story about how the rule of law varies across countries and shifts over time, the WGI and WJP measures point in the same general direction, which makes the WGI a serviceable stand-in where the WJP’s shorter record falls short.
How AI was used for this post: Aside from tilting at windmills, I also used Claude to suggest refinements to my code, the title of my post and prose. But, as I’m sure is attested by the errant grammatical and spelling errors, the majority of this post was written by me.
The post Close Enough? Using the WGI as a Proxy for the WJP Rule of Law Index appeared first on Giles.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.