File size: 3,763 Bytes
0dbfc34
58c6ffc
8f412e8
0dbfc34
 
 
 
58c6ffc
 
0dbfc34
 
b27fd42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
title: DescriptiveRepresentation CountryRanks
emoji: 🌎
colorFrom: blue
colorTo: yellow
sdk: docker
pinned: false
license: mit
short_description: Descriptive representation by country
---

# Overview

This Shiny dashboard visualizes country-level representation indices from the Global Leadership Project (GLP). It allows users to explore how closely a country's political leadership mirrors its demographic makeup across various dimensions, including ethnicity, gender, religion, and language. The app features an interactive world map and detailed data displays to facilitate understanding of global leadership representation.

## Features

- **Interactive Map:** A world map where countries are colored based on the selected representation index, using the Mollweide projection for accurate area representation.
- **Index Selection:** Choose from the following indices via a dropdown menu:
  - Overall
  - Representation Gap
  - Ethnicity
  - Gender
  - Religion
  - Language
- **Country Details:** Click on a country to view its specific representation indices in a side panel, with tooltips providing additional information on hover.
- **Data Source:** Combines data from the Global Leadership Project (GLP) and Natural Earth for map rendering.

## Usage

1. **Select an Index:** Use the dropdown menu in the sidebar to choose a representation index to visualize on the map.
2. **Explore the Map:** 
   - Hover over countries to see a tooltip with detailed index values.
   - Click a country to display its full representation data in the side panel.
3. **Interpret the Data:** 
   - Larger positive scores indicate a closer match between leaders and citizens.
   - More negative gaps suggest a greater shortfall in representation.

## Data and Methodology

The representation indices are derived from the Global Leadership Project (GLP) dataset, with map data provided by Natural Earth. Custom country code matches are applied for Kosovo (XKX) and Somaliland (SOM) to ensure accurate representation. For comprehensive methodological details, refer to the accompanying paper:

- John Gerring, Connor T. Jerzak, Erzen Öncel. "The Composition of Descriptive Representation." *American Political Science Review*, 118(2): 784-801, 2024.  
  [Download PDF][BibTeX]

**Technical Note:** Some data points did not meet a 75% completeness threshold and were imputed using an algorithm. Interpret individual country values with caution due to potential imputation effects.

The data is loaded from the file `CountryRepresentationRankings.csv`, which should be included in the app's directory or repository for proper functionality.

## Setup and Deployment

This application is built using R and Shiny. To run it locally, install the required R packages and execute the app as follows:

```R
# Install necessary packages
install.packages(c("shiny", "shinydashboard", "dplyr", "readr", "sf", "rnaturalearth", "rnaturalearthdata", "countrycode", "ggplot2", "ggiraph"))

# Run the app
shiny::runApp()
```

# References
John Gerring, Connor T. Jerzak, Erzen Öncel. "The Composition of Descriptive Representation."  *American Political Science Review*, 118(2): 784-801, 2024. [\[PDF\]](https://www.cambridge.org/core/services/aop-cambridge-core/content/view/7EAEA1CA4C553AB9D76054D1FA9C0840/S0003055423000680a.pdf/the-composition-of-descriptive-representation.pdf) [\[Dataverse\]](https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/BIQZNT)
```
@article{GJO-CompDR,
        title={The Composition of Descriptive Representation},
        author={Gerring, John and Connor T. Jerzak and Erzen Öncel},
        journal={American Political Science Review},
        year={2023},
        volume={118},
        number={2},
        pages={784-801}
}
```