1 The Worldwide Governance Indicators, 2023 Update

  • The Worldwide Governance Indicators (WGI) are designed to assess broad patterns in perceptions of governance across countries and over time.

  • The WGI aggregate data from more than 30 think tanks, international organizations, nongovernmental organizations, and private firms across the world.

  • The WGI feature six aggregate governance indicators for over 200 countries and territories over the period 1996–2022:

    1. Voice and Accountability
    2. Political Stability and Absence of Violence/Terrorism
    3. Government Effectiveness
    4. Regulatory Quality
    5. Rule of Law
    6. Control of Corruption
  • The WGI are based on a comprehensive review of over 30 data sources, including surveys of households, firms, and experts in the public, private, and nonprofit sectors.

  • The WGI are available at the World Bank’s website.

2 Load the data

library(rio)
WGI <- import("Data_raw/wgidataset-stata/wgidataset.dta")

3 Describe the data

library(gtsummary)
library(dplyr)
# Describe the data
WGI %>%
  select(-code) %>%
  select(-countryname) %>%
  tbl_summary()
Characteristic N = 5,1361
year 2,011 (2,005, 2,016)
Voice and Accountability, Estimate 0.05 (-0.82, 0.91)
    Unknown 161
Voice and Accountability, Standard Error 0.14 (0.13, 0.20)
    Unknown 161
Voice and Accountability, Number of Sources 10.0 (6.0, 13.0)
    Unknown 161
Voice and Accountability, Percentile Rank (0-100) 50 (25, 75)
    Unknown 161
Voice and Accountability, Percentile Rank of Lower Bound of 90% Confidence Inter 41 (17, 65)
    Unknown 161
Voice and Accountability, Percentile Rank of Upper Bound of 90% Confidence Inter 57 (31, 89)
    Unknown 161
Political Stability and Absence of Violence/Terrorism, Estimate 0.11 (-0.64, 0.85)
    Unknown 170
Political Stability and Absence of Violence/Terrorism, Standard Error 0.25 (0.23, 0.31)
    Unknown 170
Political Stability and Absence of Violence/Terrorism, Number of Sources 6.00 (4.00, 7.00)
    Unknown 170
Political Stability and Absence of Violence/Terrorism, Percentile Rank (0-100) 50 (25, 75)
    Unknown 170
Political Stability and Absence of Violence/Terrorism, Percentile Rank of Lower 34 (14, 58)
    Unknown 170
Political Stability and Absence of Violence/Terrorism, Percentile Rank of Upper 64 (38, 95)
    Unknown 170
Government Effectiveness, Estimate -0.14 (-0.75, 0.76)
    Unknown 230
Government Effectiveness, Standard Error 0.22 (0.20, 0.26)
    Unknown 230
Government Effectiveness, Number of Sources 7.0 (3.0, 8.0)
    Unknown 230
Government Effectiveness, Percentile Rank (0-100) 50 (25, 75)
    Unknown 230
Government Effectiveness, Percentile Rank of Lower Bound of 90% Confidence Inter 34 (12, 63)
    Unknown 230
Government Effectiveness, Percentile Rank of Upper Bound of 90% Confidence Inter 62 (40, 85)
    Unknown 230
Regulatory Quality, Estimate -0.11 (-0.72, 0.81)
    Unknown 228
Regulatory Quality, Standard Error 0.21 (0.19, 0.26)
    Unknown 228
Regulatory Quality, Number of Sources 7.00 (4.00, 9.00)
    Unknown 228
Regulatory Quality, Percentile Rank (0-100) 50 (25, 75)
    Unknown 228
Regulatory Quality, Percentile Rank of Lower Bound of 90% Confidence Interval (0 34 (13, 64)
    Unknown 228
Regulatory Quality, Percentile Rank of Upper Bound of 90% Confidence Interval (0 62 (40, 86)
    Unknown 228
Rule of Law, Estimate -0.13 (-0.78, 0.83)
    Unknown 116
Rule of Law, Standard Error 0.17 (0.15, 0.21)
    Unknown 116
Rule of Law, Number of Sources 10.0 (6.0, 13.0)
    Unknown 116
Rule of Law, Percentile Rank (0-100) 50 (25, 76)
    Unknown 116
Rule of Law, Percentile Rank of Lower Bound of 90% Confidence Interval (0-100) 38 (14, 62)
    Unknown 116
Rule of Law, Percentile Rank of Upper Bound of 90% Confidence Interval (0-100) 58 (36, 86)
    Unknown 116
Control of Corruption, Estimate -0.22 (-0.78, 0.74)
    Unknown 206
Control of Corruption, Standard Error 0.17 (0.15, 0.23)
    Unknown 206
Control of Corruption, Number of Sources 8.0 (4.0, 11.0)
    Unknown 206
Control of Corruption, Percentile Rank (0-100) 50 (25, 75)
    Unknown 206
Control of Corruption, Percentile Rank of Lower Bound of 90% Confidence Interval 35 (13, 64)
    Unknown 206
Control of Corruption, Percentile Rank of Upper Bound of 90% Confidence Interval 59 (38, 83)
    Unknown 206
1 Median (IQR)

4 Select the necessary columns

# Keep code year pvr ger rqr rlr ccr
WGI <- WGI[, c("code", "year", "pvr", "ger", "rqr", "rlr", "ccr")]

5 Write the data as CSV using rio package

export(WGI, "Data_output/WGI.csv")

6 Distribution of the observations

library(ggplot2)

# plot the distribution of the observations by year
WGI %>%
  group_by(year) %>%
  summarise(n = n()) %>%
  ggplot(aes(x = year, y = n)) +
  geom_bar(stat = "identity") +
  labs(title = "Distribution of the observations by year",
       x = "Year",
       y = "Number of observations")

7 Describe the data again

library(gtsummary)
WGI %>%
  select(-code) %>%
  tbl_summary()
Characteristic N = 5,1361
year 2,011 (2,005, 2,016)
Political Stability and Absence of Violence/Terrorism, Percentile Rank (0-100) 50 (25, 75)
    Unknown 170
Government Effectiveness, Percentile Rank (0-100) 50 (25, 75)
    Unknown 230
Regulatory Quality, Percentile Rank (0-100) 50 (25, 75)
    Unknown 228
Rule of Law, Percentile Rank (0-100) 50 (25, 76)
    Unknown 116
Control of Corruption, Percentile Rank (0-100) 50 (25, 75)
    Unknown 206
1 Median (IQR)