Abstract Confidence in elections and interpersonal trust are vital to democratic systems. In this project, we combined multiple datasets (nine) from the world bank to explore how parts of trust, GDP, and even temperature can affect people’s trust. First, we examine whether confidence in elections is associated with the Horizontal Accountability Index. Second, we analyze whether GDP per capita is related to confidence in elections across a set of economically dominant countries. Third, we used 2 climate data sets (CDD and heat index 35) to investigate whether long term heat exposure is associated with both interpersonal trust and confidence in elections. Although there is variation in all data results, there are strong correlations.
The following research questions: Research Q1: Is there a Correlation Between Percentage of Population with Confidence in Elections and Horizontal Accountability Index? Research Q1: Does a country’s GDP influence how much people trust elections? Research Q3: How does temperature affect confidence in elections and interpersonal trust?
Introduction - Question 1 With a rapidly changing global political climate, we were curious about the factors that could correlate to people’s confidence in elections. Especially with the rise of misinformation, troll farms, and social media exasperating election fears, democratic governments across the globe are riddled with distrust in their elections. We wanted to understand what other factors could impact this phenomenon other than the ones mentioned previously. ‘Percentage of Population with Confidence in Elections’ (PPCE) is a key indicator in understanding the performance of every facet of public life in democratic governments including judicial accountability, education, press, identity, and freedoms. Nations with higher levels of confidence in elections can indicate transparent, fair, and equal elections. While nations with lower levels of confidence in elections are associated with unstable governments, rigged elections, foreign collision, corruption, misinformation, etc. Was it a true indicator of election integrity, is it correlated to the nation’s GDP, or was it correlated to the Heat Index? ● Is Percentage of Population with Confidence in Elections correlated with the Horizontal Accountability Index? ●
Data Sources 1. Percentage of Population with Confidence in Elections (PoPwCiE) Source: World Bank Data Collected by: Afrobarometer (AF), Asian Barometer (ASB), Latinobarometro (LB), and World Values Survey (WVS). Usage Permissions: World Bank’s Open Data Description: The dataset contains the percentage of people who were confident that their election results were categorized by urbanization levels, gender, religion, ethnicity, etc. Relevance: It is essential for analyzing how nations believe in their government’s performance of conducting free and fair elections. Categories like urbanization, gender, religion, ethnicity, etc also indicate how these differences lead to varied levels of election trust. 2. Horizontal Accountability Index (HORACC) Source: World Bank Data Collected by: Varieties of Democracy (V-Dem) Usage Permissions: World Bank’s Open Data & V-Dem’s databases have free and open access. Description: Horizontal Accountability Index is a score assigned to nations from -2 to 2 .3 based on how well government institutions hold officials and other branches of government accountable for abuses of power. Originally had data from 175 countries from 1759-2024 (25,816 rows & 38 cols). Although the OBS value (Horizontal Accountability Index) was null for all nations until 1900 and all other columns except OBS value, TIME_PERIOD (year), and REF_AREA_NAME (nation name) were dispensable. Relevance: This is essential to assess whether people’s confidence in their elections is connected to governments being held accountable to abuses of power or is due to a different variable. Thus, this dataset does have a considerable blindspot of nations of countries with and without healthy democracies. The dataset doesn’t include most European, African or authoritarian countries like North Korea, Egypt, Saudi Arabia, Spain, etc. Data Trust in Elections Data (PoPwCiE) ● Rows: 2,030 ● Columns: 40 ● Each row represents: Each row represents the nation’s PoPwCiE in a specified year and specification. With each row including multiple breakdowns in urbanization, religion, ethnicity, etc. ● Relevant variables and how they’re coded: ○ REF_AREA_NAME: Stored as a character. ○ TIME_PERIOD: Stored as a dbl (double-precision floating-point number) ○ OBS_VALUE: the percentage of people with confidence in elections for that specified classification (based on breakdowns). ● Missing/Implausible values: There were no null values for the above-mentioned relevant variables. Horizontal Accountability Index Data ● Rows: 25,816 ● Columns: 38 ● Each row represents: A nation’s HORACC score for each year. ● Relevant variables and how they’re coded: ○ REF_AREA_LABEL: Stored as a character. ○ TIME_PERIOD: Stored as a dbl (double-precision floating-point number). ○ OBS_VALUE: the Horizontal Accountability Index score ● Missing/Implausible values: HORACC scores are null from 1789-1899. There were no implausible scores.
Methods Horizontal Accountability Index (HORACC) vs. PoPwCiE Firstly, we imported the PoPwCiE CSV dataset. Then, we selected REF_AREA_LABEL, TIME_PERIOD, OBS_VALUE, URBANISATION, AGE, SEX, COMP_BREAKDOWN_2, COMP_BREAKDOWN_1 columns from PoPwCiE. Later, we filtered to only include URBANISATION, AGE, SEX, COMP_BREAKDOWN_2, and COMP_BREAKDOWN_1 values that were describing the total population (ie: sex == “_T” meant the data wasn’t separated by sex). After doing, so we extracted just the necessary columns: REF_AREA_LABEL, TIME_PERIOD, and OBS_VALUE.
Secondly, we imported the HORACC CSV dataset. Since the dataset only included OBS values for the totality of demographic columns, we did not need to filter them out. For instance, while the HORACC dataset does contain a SEX_ID column- all the values are “_T”. Thus we only extracted the REF_AREA_NAME, TIME_PERIOD, OBS_VALUE columns. As mentioned previously, all OBS_VALUE before 1900 were null. So we then filtered null OBS_VALUES and limited the TIME_PERIOD to be between 2015 and 2022 (to match PoPwCiE). Then, we merged the PoPwCiE columns (REF_AREA_LABEL, TIME_PERIOD) combining with HORACC columns (REF_AREA_NAME, TIME_PERIOD) with an inner-join. An inner join means that only values that are common between both the datasets remain. The column names of the combined dataset were changed to be “Country”, “Year”, “Percentage of People with Confidence in Elections”, and “Horizontal Accountability Index”. In order to plot the values onto a graph using ggplot, we used a factor on the Year column. Next, we created a scatterplot of the combined dataset to have x-values of HORACC and y-values of PoPwCiE with colors being determined by which year the data describes. Since most automatic color palettes had many of the years be unreadable, we picked the color palette with a darker range in scale_color_brewer(palette = “Dark2”). This graph was created to have two different best fit lines. The black line represents the best-fit linear line (geom_smooth(method = “lm”)) and there is a dark green line that represents the best-fit curved line (geom_smooth(method = “loess”)). We created two distinct lines to demonstrate general trends and topical trends. Lastly, we edited the y’s label to include a percentage sign to indicate metrics and added a centered title.
Results
The graph indicates that there is a positive correlation between HORACC and PoPwCiE from 2015-2022. Specifically, countries with high HORACC scores generally have a higher PoPwCiE value. However, nations with moderate HORACC scores (-0.5 to 0.5) tend to have a higher PoPwCiE than nations with medium-high HORACC scores (0.5 to 1.5). Thus, there is a topical trend that indicates that nations with moderate HORACC scores are more likely to have higher PoPwCiE values than nations with medium-high scores. Discussion for Question 1: Is there a Correlation Between Percentage of Population with Confidence in Elections and Horizontal Accountability Index?
HORACC scores in comparison with PoPwCiE levels
Research Q2: Does a country’s GDP influence how much people trust elections?
Result / Visualization:
Scatter Plot: The scatter plot shows a clear positive relationship between GDP per capita and election trust over a 10 year average period(1970-2019)
Countries like Canada(CAN) and Germany(DEU) have significant faith in their election processes and do well economically.
The United States(USA), United Kingdom(GBR), Japan(JPN) and South Korea(KOR) all have high GDP but only moderate trust. This shows that just being economically successful doesn’t mean that people will trust elections
Summary: The general trend backs up the assumption that a stronger economy is often linked to more faith in elections. But there are several important exceptions that shows that political transparency, the media environment, the quality of governance, and the history of democracy also have a big impact on how much people trust the Government. GDP is an essential aspect, but it is not the only one that affects election trust.
Bar Chart: The bar chart shows the average election trust score for 12 major countries over the past 50 years.
The selected countries that have the most trust in elections are Canada and Germany.
South Korea, Japan and the United Kingdom are in the middle category, exhibiting modest trust even if their economies are strong.
India, Turkey, Brazil and South Africa are lower on the trust scale, which means that people don’t trust the electoral process as much as the other countries.
Summary: The bar chart supports the premise that many wealthier countries tend to trust elections more, but economic status alone does not fully explain the disparities. The political stability, social climate, transparency, and historical backdrop of each country also affect how much people trust their electoral systems.
Findings: The findings indicate that GDP per capita is an unreliable indicator of electoral trust. Political openness, corruption levels, democratic history, and societal stability probably have a considerably bigger effect on how much people trust elections. Economic growth may help, but robust democratic institutions are needed to build trust.
Limitations A small number of countries: Only 12 countries were chosen and they were mostly wealthy or politically important ones. This makes it harder for the results to show how confident people are in elections around the world. Observational data cannot establish causation: We can’t say that one directly influences the other, even if GDP and trust seen to be associated with each other.
A lot of political and cultural issues that can’t be measured affect public trust. GDP per capita may not accurately represent socioeconomic inequality: The GDP statistic does not show how unequal wealth is or how well democracy works in each country.
Overall, the dataset is good for finding patterns, but not good enough to make strong global claims or figure out cause and effect linkages.
Potential Improvements
Add more data to the dataset: 1.Add more countries from different areas and with varied income levels. 2. To illustrate how trust fluctuates over time, use full time-series data instead of long-term averages. Add more social and political indicators: 1.Add things like the corruption index, how open the government is, how free the media is, how fair the elections are, and how unequal things are. 2.Make models with more than one variable to better understand why trust is different in different countries Make Data More Consistent: 1.Use the same survey year for all countries 2. To avoid getting old information look at the most recent waves of the world Values Survey.
Improvements to the look: 1.Put countries into groups based on their politics or economy( for example, democracies vs. rising economies. 2.Add time trend graphs, including line graphs or animated changes throughout the years.
Research Q3: How does temperature affect confidence in elections and interpersonal trust? My section is whether such an unlikely factor like climate can affect this. This was measured through cooling degree days and heat index data. Using the world bank sustainability indicators, climate data, and V-Dem corruption scores, my project contains a combined dataset of over 72 counties over a multitude of years. The association is modest and heavily mediated by other factors. However a general trend I found is that cool and warm countries show a similar trend. Cooler countries have a relatively higher trust, while hot climates show a trust drop. Additional breakdowns were made, for example by urban vs rural area and the country case studies (Brazil, India, China, Nigeria, USA, etc.) highlight that temperature alone can’t explain global trust patterns. Although the other parts of the project do contribute, for example corruption and GDP shows a significant correlation. 1. Interpersonal Trust Dataset ○ Source: World Bank, Social Sustainability Global Database (indicator WB_SSGD_PCT_POP_TRUST). ○ Description: Percentage of population who think most people can be trusted, by country and year, with breakdowns by sex, age, urbanisation, religion, and ethnicity. ○ Usage permissions: Publicly accessible open data for non-commercial use. ○ Role in project: Main outcome variable (our proxy for social trust / confidence in society). 2. Heat Index 35 Dataset ○ Source: World Bank ESG climate data (WB_ESG_EN_CLC_HEAT_XD). ○ Description: Number of days per year when the daily heat index exceeds 35°C. ○ Role in project: Alternative extreme heat indicator; used mainly for descriptive context and robustness checks. 3. Cooling Degree Days (CDD) Dataset ○ Source: World Bank Climate Change Knowledge Portal (WB_CLEAR_EN_CLC_CDDY_XD). ○ Description: Annual cumulative degrees above 18°C, a standard measure of heat-related energy demand and long-term heat exposure. ○ Role in project: Our main climate variable, since it is smoother, easier to interpret, and more consistently recorded across countries. 4. Public Sector Corruption Dataset ○ Source: V-Dem Core dataset, World Bank Data360 (VDEM_CORE_V2X_PUBCORR). ○ Description: Public sector corruption index per country and year, where higher values indicate more corruption. ○ Role in project: Key governance variable; lets us compare whether corruption or climate is more strongly related to interpersonal trust. Before cleaning, the raw datasets had the following dimensions: ● Trust dataset: 1,639 rows × 40 columns ● Heat Index dataset: 9,843 rows × 37 columns ● Cooling Degree Days dataset: 9,894 rows × 37 columns ● Corruption dataset: 25,816 rows × 38 columns My Data Cleaning and Processing · Filter to a common recent window (2015–2020). · Restrict trust data to “totals.” only kept rows where: o Sex, age, urbanisation, ethnicity, and religion are set to “Total”. · Compute per-country averages for 2015–2020. o group_by(iso3, country) o summarise(average_value = mean(variable, na.rm = TRUE)) · Merge into a single “analysis” dataframe. o combined: § trust_avg § heat_avg § cdd_avg § corr_avg
· clean_gov = 1 - avg_pubcorr → a “cleaner government” index where higher is better. · Additional breakdowns: o Ubran vs rural where URBANISATION is RUR or URB and repeated the averaging + merge with cdd_avg o trust_age dataset for age categories “15 to 29 years old” and “30 to 59 years old” · technical decisions: o Chose cooling degree days as the primary climate measure because it’s smoother and better suited for cross-country comparisons rather than the extreme count like heat index 35 · averages over multiple years because single years had very unstable data. heat_band to understand cool/warm/hot countries
A scatter plot comparing Cooling Degree Days (CDD) and average trust (%) shows: ● Downward trend; hotter countries (high cdd) tend to report lower trust ● Regression line slopes downward (although not very strongly) ● Very hot, low trust countries ● Cooler, high trust countries ● Warm, mid trust countries; although not a very clean alignment (Greece, turkey, Argentina) · · Hot countries (avg CDD > 2500) Mean trust ≈ 15.3% · · Warm countries (500 < CDD < 2500) Mean trust ≈ 24.2% · · Cool countries (CDD < 500) Mean trust ≈ 25.1%
moderate evidence that higher temperatures correlate with lower interpersonal trust
Findings: Modest negative correlation between heat and trust: Countries with more extreme heat exposure tend to reort lower interpersonal trust. Corruption tends to correlate stronger with trust rather than temperature: Low corruption countries score higher trust regardless of climate.
Results: RQ1: Does temperature (CDD) correlate with interpersonal trust? The regression line slopes downwards Had results with countries with a very high CDD (Mali, Burkina Faso, Ghana, Nigeria, Cambodia) cluster in the bottom-right: very hot, low trust. Countries with very low CDD (Canada, New Zealand, Chile) usually have higher trust. Limitations: Often 1-2 surveys per country (not continuous) There were many small or low survey countries Heat index 35 measured extreme events. Cdd measured cumulative heat exposure. They didn’t always agree, so I had to refer to one temperature set (cdd) more than the other Obviously correlation does not mean causation. Cool climates: ○ Rural mean trust ≈ 23.7% ○ Urban mean trust ≈ 25.9% ● Warm climates: ○ Rural mean trust ≈ 23.4% ○ Urban mean trust ≈ 25.6% ● Hot climates: ○ Rural mean trust ≈ 16.0% ○ Urban mean trust ≈ 14.0% Discussion: Climate effect: ● Hot countries, especially those with extremely high Cooling Degree Days, tend to have lower trust. ● However, warm vs cool climates are not dramatically different, and there is significant overlap. Corruption effect: ● Cleaner governments (low corruption scores) consistently show higher trust. ● When climate and corruption “disagree,” corruption usually wins (e.g., Singapore and China show that strong governance can coexist with high heat). Urban/rural nuance: ● Hot climates depress trust for both urban and rural areas, but in cooler contexts urban trust is slightly higher. ● This suggests climate interacts with social structure rather than working alone
Improvements: Using multi-year rolling averages would stabilize noisy countries. Using more granular climate variables would have seasonal averages, humidity, and heat anomalies. Could in the future add KNN to classify trust levels.
Dataset dimensions: Dataset Rows Columns Notes Trust 1,639 40 Only ~72 usable after filtering 2015–2020 totals. Heat Index 9,843 37 Annual climate exposure data. CDD 9,894 37 Chosen as primary temp variable. Corruption 25,816 38 Annual V-Dem corruption scores.
Variables: REF_AREA — ISO3 country code REF_AREA_LABEL — country name TIME_PERIOD — year OBS_VALUE — numeric value for indicator SEX, AGE, URBANISATION, COMP_BREAKDOWN_* — filters for “total population” Trust variable: percentage of people who think most people can be trusted CDD variable: cumulative degrees above 18°C Corruption variable: V-Dem public sector corruption index
Summary By combining World Bank social trust data, Cooling Degree Days, Heat Index 35, and V-Dem corruption indices for 2015–2020, the project has a 72-country dataset that allowed our team to compare patterns at a global level. To summarise: Very hot climates are associated with lower average interpersonal trust, on the order of ~15% vs ~24–25% in cooler or warm climates. Public sector corruption shows an even clearer association: clean governments tend to have high trust, while highly corrupt ones almost always suffer from low trust. Urban vs rural trust patterns differ depending on climate, hinting that environmental and social structures interact. (not as mentioned during presentation) Individual country case studies (Brazil, India, China, Nigeria, United States, Greece) represent that climate provides context, however there is so much more nuance here.
Summary and conclusion
Countries with higher Horizontal Accountability scores generally report greater confidence in elections, while GDP shows only a weak and inconsistent relationship. Apparently, wealth alone doesn’t guarantee trust in democratic processes. Climate has a modest association: very hot countries tend to exhibit lower interpersonal trust.
Overall, strong accountability systems and low corruption appear far more important than economic status or climate
library(tidyverse)
library(lubridate)
library(tidyverse)
library(ggplot2)
pctConf <- read_delim("WB_Pct_of_Conf_Elections.csv")
pctConf
## # A tibble: 2,030 × 40
## STRUCTURE STRUCTURE_ID ACTION FREQ FREQ_LABEL REF_AREA REF_AREA_LABEL
## <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 2 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 3 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 4 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 5 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 6 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 7 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 8 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 9 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## 10 datastructure WB.DATA360:DS_… I _O Other AND Andorra
## # ℹ 2,020 more rows
## # ℹ 33 more variables: INDICATOR <chr>, INDICATOR_LABEL <chr>, SEX <chr>,
## # SEX_LABEL <chr>, AGE <chr>, AGE_LABEL <chr>, URBANISATION <chr>,
## # URBANISATION_LABEL <chr>, UNIT_MEASURE <chr>, UNIT_MEASURE_LABEL <chr>,
## # COMP_BREAKDOWN_1 <chr>, COMP_BREAKDOWN_1_LABEL <chr>,
## # COMP_BREAKDOWN_2 <chr>, COMP_BREAKDOWN_2_LABEL <chr>,
## # COMP_BREAKDOWN_3 <chr>, COMP_BREAKDOWN_3_LABEL <chr>, TIME_PERIOD <dbl>, …
pctConf <- pctConf %>%
select(c(REF_AREA_LABEL, TIME_PERIOD, OBS_VALUE, URBANISATION, AGE, SEX, COMP_BREAKDOWN_2, COMP_BREAKDOWN_1)) %>%
filter(URBANISATION == "_T" & AGE == "_T" & SEX == "_T" & COMP_BREAKDOWN_2 == "_T" & COMP_BREAKDOWN_1 == "_T")
pctConf
## # A tibble: 147 × 8
## REF_AREA_LABEL TIME_PERIOD OBS_VALUE URBANISATION AGE SEX
## <chr> <dbl> <dbl> <chr> <chr> <chr>
## 1 Andorra 2018 50.2 _T _T _T
## 2 Angola 2020 30.5 _T _T _T
## 3 Argentina 2020 16.1 _T _T _T
## 4 Argentina 2018 23.7 _T _T _T
## 5 Armenia 2021 28.8 _T _T _T
## 6 Australia 2019 65.5 _T _T _T
## 7 Bangladesh 2018 60.0 _T _T _T
## 8 Benin 2017 48.8 _T _T _T
## 9 Benin 2020 48.4 _T _T _T
## 10 Bolivia 2020 28.1 _T _T _T
## # ℹ 137 more rows
## # ℹ 2 more variables: COMP_BREAKDOWN_2 <chr>, COMP_BREAKDOWN_1 <chr>
range(pctConf$TIME_PERIOD)
## [1] 2015 2022
pctConf <- pctConf %>%
select(c(REF_AREA_LABEL, TIME_PERIOD, OBS_VALUE))
dim(pctConf)
## [1] 147 3
sample_n(pctConf, 3)
## # A tibble: 3 × 3
## REF_AREA_LABEL TIME_PERIOD OBS_VALUE
## <chr> <dbl> <dbl>
## 1 Guatemala 2020 18.4
## 2 Costa Rica 2020 45.8
## 3 Chile 2020 45.7
horacc <- read_delim("VDEM_CORE_V2X_HORACC.csv")
dim(horacc)
## [1] 25816 38
horacc
## # A tibble: 25,816 × 38
## STRUCTURE STRUCTURE_ID ACTION FREQ_ID FREQ_NAME REF_AREA_ID REF_AREA_NAME
## <chr> <chr> <chr> <chr> <chr> <chr> <chr>
## 1 datastructure WB.DATA360:… I A Annual MEX Mexico
## 2 datastructure WB.DATA360:… I A Annual MEX Mexico
## 3 datastructure WB.DATA360:… I A Annual MEX Mexico
## 4 datastructure WB.DATA360:… I A Annual MEX Mexico
## 5 datastructure WB.DATA360:… I A Annual MEX Mexico
## 6 datastructure WB.DATA360:… I A Annual MEX Mexico
## 7 datastructure WB.DATA360:… I A Annual MEX Mexico
## 8 datastructure WB.DATA360:… I A Annual MEX Mexico
## 9 datastructure WB.DATA360:… I A Annual MEX Mexico
## 10 datastructure WB.DATA360:… I A Annual MEX Mexico
## # ℹ 25,806 more rows
## # ℹ 31 more variables: INDICATOR_ID <chr>, INDICATOR_NAME <chr>, SEX_ID <chr>,
## # SEX_NAME <chr>, AGE_ID <chr>, AGE_NAME <chr>, URBANISATION_ID <chr>,
## # URBANISATION_NAME <chr>, UNIT_MEASURE_ID <chr>, UNIT_MEASURE_NAME <chr>,
## # COMP_BREAKDOWN_1_ID <chr>, COMP_BREAKDOWN_1_NAME <chr>,
## # COMP_BREAKDOWN_2_ID <chr>, COMP_BREAKDOWN_2_NAME <chr>,
## # COMP_BREAKDOWN_3_ID <chr>, COMP_BREAKDOWN_3_NAME <chr>, …
horacc <- horacc%>%
select(c(REF_AREA_NAME, TIME_PERIOD, OBS_VALUE)) %>%
filter(!is.na(OBS_VALUE) & TIME_PERIOD >= 2015 & TIME_PERIOD <= 2022)
horacc
## # A tibble: 1,400 × 3
## REF_AREA_NAME TIME_PERIOD OBS_VALUE
## <chr> <dbl> <dbl>
## 1 Mexico 2015 0.349
## 2 Mexico 2016 0.383
## 3 Mexico 2017 0.423
## 4 Mexico 2018 0.251
## 5 Mexico 2019 -0.066
## 6 Mexico 2020 -0.024
## 7 Mexico 2021 0.046
## 8 Mexico 2022 -0.136
## 9 Suriname 2015 0.992
## 10 Suriname 2016 0.868
## # ℹ 1,390 more rows
fin <- merge(pctConf, horacc, by.x = c("REF_AREA_LABEL", "TIME_PERIOD"), by.y = c("REF_AREA_NAME", "TIME_PERIOD"), all.x = TRUE)
fin <- fin %>%
mutate("Percentage of Confidence in elections" = OBS_VALUE.x, "HOR" = OBS_VALUE.y) %>%
select(!c(OBS_VALUE.x, OBS_VALUE.y)) %>%
filter(!is.na(HOR))
fin$TIME_PERIOD <- factor(fin$TIME_PERIOD)
fin %>%
ggplot(aes(HOR,`Percentage of Confidence in elections`, col = TIME_PERIOD)) +
geom_point() +
scale_color_brewer(palette = "Dark2") +
geom_smooth(method = "loess", se = FALSE, aes(color = NULL), formula = y ~ x, color = "darkgreen") +
geom_smooth(method = "lm", se = FALSE, aes(color = NULL), formula = y ~ x, color = "black") +
ggtitle(str_wrap("Horizontal Accountability Index vs Percentage of People with Confidence in elections from 2015-2022", 75))+
theme(plot.title = element_text(hjust=0.5))+
labs(x = "Horizontal Accountability Index", y = "Percentage of People with Confidence in Elections (%)", col = "Year")
knitr::opts_chunk$set(
echo = FALSE,
warning = FALSE,
message = FALSE,
results = 'hide',
paged.print = FALSE
)
library(tidyverse)
library(lubridate)
Cleaned trust dataset
Temperature section cleaned the climate datasets (heat index and cdd)
cleaning corruption dataset:
computing per country averages (2015-2020)
merged everything, created new variables and a new nice chart
This covers 72 countries.
base
view graph
graph
additional gathering- section 10s
hottest and coolest countries
Highest vs lowest trust
Highest vs lowest corruption
mid trust / mid heat
#more graphs sections
## Rows: 2030 Columns: 40
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (35): STRUCTURE, STRUCTURE_ID, ACTION, FREQ, FREQ_LABEL, REF_AREA, REF_A...
## dbl (4): TIME_PERIOD, OBS_VALUE, UNIT_MULT, TIME_FORMAT
## lgl (1): COMMENT_OBS
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_smooth()`).
## Warning: Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 3 rows containing non-finite outside the scale range (`stat_smooth()`).
## Removed 3 rows containing missing values or values outside the scale range
## (`geom_point()`).