{"id":19539006,"url":"https://github.com/lisabensoussan/basic-data-wrangling-and-plotting-distributions","last_synced_at":"2026-03-19T10:22:08.657Z","repository":{"id":165972656,"uuid":"641381888","full_name":"lisabensoussan/Basic-Data-Wrangling-and-Plotting-Distributions","owner":"lisabensoussan","description":"This project analyzes global democracy trends from 2006 to 2022 using data wrangling, statistical methods, and visualizations, incorporating GDP, population, and incarceration data for deeper insights.","archived":false,"fork":false,"pushed_at":"2024-09-11T10:15:51.000Z","size":3490,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T04:41:51.203Z","etag":null,"topics":["cdf","data-wrangling","plotting","regression-analysis"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lisabensoussan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-16T10:59:26.000Z","updated_at":"2024-09-11T10:15:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"9745a7a2-8f41-4fdd-b811-120a76d2e9dc","html_url":"https://github.com/lisabensoussan/Basic-Data-Wrangling-and-Plotting-Distributions","commit_stats":null,"previous_names":["lisabensoussan/basic-data-wrangling-and-plotting-distributions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lisabensoussan/Basic-Data-Wrangling-and-Plotting-Distributions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisabensoussan%2FBasic-Data-Wrangling-and-Plotting-Distributions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisabensoussan%2FBasic-Data-Wrangling-and-Plotting-Distributions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisabensoussan%2FBasic-Data-Wrangling-and-Plotting-Distributions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisabensoussan%2FBasic-Data-Wrangling-and-Plotting-Distributions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lisabensoussan","download_url":"https://codeload.github.com/lisabensoussan/Basic-Data-Wrangling-and-Plotting-Distributions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lisabensoussan%2FBasic-Data-Wrangling-and-Plotting-Distributions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdf","data-wrangling","plotting","regression-analysis"],"created_at":"2024-11-11T02:37:44.446Z","updated_at":"2026-03-02T08:01:32.976Z","avatar_url":"https://github.com/lisabensoussan.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Democracy Index Analysis - Lab 1: Basic Data Wrangling and Plotting, Distributions\n\n## Project Overview\n\nThis project provides an in-depth analysis of the World Democracy Index dataset. It utilizes data manipulation techniques and statistical visualization methods in R to explore global democracy trends over time, specifically focusing on the years 2006 to 2022.\n\n## Objectives\n\n- Load and process the Democracy Index data from various sources.\n- Conduct comparative analyses of countries based on their democracy scores.\n- Visualize global trends in democracy over time, including regional and country-specific patterns.\n- Assess the impact of democracy index changes on socio-economic variables such as GDP, population, and incarceration rates.\n- Estimate regime transition probabilities and display them via heatmaps.\n- Display global data on a world map for visual analysis.\n\n## Key Features\n\nData Sources\n- Democracy Index: Data scraped from Wikipedia's Democracy Index page and processed into meaningful insights.\n- Additional Data: GDP (PPP) per capita, population size, incarceration rates, and land area data were also incorporated for further analysis.\n\n## Analysis and Visualizations\n\n1. World Democracy Index Dataset:\n   - Analysis of the top and bottom countries based on democracy index scores in 2022.\n   - Comparative analysis of regional democracy index distributions.\n\n2. Plotting Distributions:\n   - Boxplots and density plots were created to explore the distribution of democracy scores by region.\n   - Outliers were identified, and statistical summaries such as mean, variance, skewness, and kurtosis were calculated.\n\n3. Country Comparisons \u0026 Trends:\n   - Developed a custom R function to compare democracy index changes across countries and regions over time.\n   - Grouped countries based on significant changes in democracy index between 2006 and 2022.\n\n4. Regime Transitions:\n   - Estimated the empirical probabilities of regime transitions (e.g., Full democracy to Authoritarian) between 2006 and 2022.\n   - Displayed results via a heatmap for easy interpretation.\n\n5. Additional Data Integration:\n   - Integrated data on GDP per capita, population size, incarceration rates, and land area to explore relationships with democracy.\n   - Performed regression analysis to assess the impact of democracy index on GDP and incarceration rates.\n\n6. Cumulative Distribution Functions (CDFs):\n   - Created CDFs to explore the distribution of GDP per capita, considering random country selection, population size, and land area.\n\n7. World Map Visualizations:\n   - Visualized the global democracy index on a world map, displaying both average scores and changes between 2006 and 2022.\n\n8. Democracy Index Components:\n   - Analyzed the five components of the Democracy Index (Electoral process, Functioning of government, Political participation, Political culture, Civil liberties).\n   - Displayed a heatmap of the correlation between these components and ran a multiple regression analysis to predict GDP per capita.\n\n\n## Prerequisites\n\nThe following libraries are required to run this analysis:\n```r\nlibrary(tidyverse)\nlibrary(data.table)\nlibrary(rworldmap)\nlibrary(ggthemes)\nlibrary(reshape2)\nlibrary(e1071)\nlibrary(rvest)\nlibrary(corrplot)\nlibrary(moments)\nlibrary(spatstat.geom)\n\n```\n\n## Instructions\n\n1. Run the RMarkdown (Rmd) File:\n   - This file contains all the analysis code, figures, and textual explanations.\n   - Ensure all the necessary libraries are installed before running the script.\n\n2. Output:\n   - The final output should be an HTML file, which can be generated by knitting the Rmd file.\n\n## Results\n\nThe top five countries with the highest democracy scores in 2022 are: Norway, New Zealand, Iceland, Sweden, Finland.\nThe bottom five countries in 2022 are: Afghanistan, Myanmar, North Korea, Central African Republic, Syria.\nDetailed country trends and regime change probabilities were calculated and displayed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisabensoussan%2Fbasic-data-wrangling-and-plotting-distributions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flisabensoussan%2Fbasic-data-wrangling-and-plotting-distributions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flisabensoussan%2Fbasic-data-wrangling-and-plotting-distributions/lists"}