Level With Me: Can the WGI Predict the WJP’s Rule of Law Scores?

Wait 5 sec.

[This article was first published on Data Analytics and AI Archives - Giles, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.TLDR: The first post established that the WGI and WJP rule of law measures agree on how they rank countries. This follow-up tests the stricter question of whether the WGI can predict the WJP’s levels, rather than just the relative ranking / relative position of countries. It can: forecasting errors appear to be minimal and don’t vary significantly over time.This is second post in a series examining relationships between the rule of law and economic and social outcomes.In the previous post in the series I tested whether the World Governance Indicator’s (WGI) rule of law index (RoL) was a worthy substitute for the index produced by the World Justice Project when needing to take advantage of the WGI’s wider and longer coverage.When I asked Claude for feedback it rudely provided it, arguing that my analysis was fine for confirming general agreement as to how the two measures ranked countries, but additional analysis was needed to test whether the WGI could reliably be used to predict RoL levels.My first response was to tell Claude that nobody should be using composite indices in this way in the first place as it implied a level of precision they don’t have, but I decided it would be a useful addendum to the first post that I could post during my holiday in the Northern Territory.Project Setup and DataOnce again, data used in this post can be downloaded here for the WGI and here for the WJP’s RoL index. These were current as of July 2025.#load the packages we'll probably needlibrary(tidyverse)library(readxl)library(janitor)library(countrycode)#import WGI datadta_wgi_2025 clean_names()#import World Justice Project RoL datadta_wjp_rol clean_names()Data CleaningData cleaning is identical to the last post and revolves around making sure that countries names and regions are consistently applied across the two indices.#standardize column namesdta_wgi_2025 rename(country=economy_name, iso3c=economy_code, wgi_rol=governance_estimate_approx_2_5_to_2_5)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 mutate(year = as.numeric(str_sub(year, 1, 4)))#cold-heartedly drop columns I'm not interested in dta_wgi_2025 select(iso3c, income_classification, year,wgi_rol)#drop country and region name labels so these can be standardized dta_wjp_rol select(-country_year,-country,-region) |> rename(wjp_rol=wjp_rule_of_law_index_overall_score)#merge dataframesdta_rol_unified