The dataset I will be using is from the United Nations accessed through the CORGIS datasets project. The dataset includes 21 quantitative variables, 2 qualitative variables, and 2,760 observations. The dataset has a bunch of metrics on the prevalence of aids from 1990 to 2020 across a ton of countries. The dataset can be accessed at: https://corgis-edu.github.io/corgis/csv/aids/ and is produced by UNAIDS.
Loading the Dataset + Setup
# Librarieslibrary(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.1 ✔ readr 2.2.0
✔ forcats 1.0.1 ✔ stringr 1.6.0
✔ ggplot2 4.0.3 ✔ tibble 3.3.1
✔ lubridate 1.9.5 ✔ tidyr 1.3.2
✔ purrr 1.2.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Above I load all the required libraries for this project.
# Load the datasetdf <-read_csv("aids.csv")
Rows: 2759 Columns: 23
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (1): Country
dbl (22): Year, Data.AIDS-Related Deaths.AIDS Orphans, Data.AIDS-Related Dea...
ℹ 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.
Above I load the dataset and view the first six rows and all the columns. The main columns I will focus on are the Data.New HIV Infections.All Ages, Data.HIV Prevalence.Adults, Country, and Year.
The graph above is a heatmap of HIV/AIDS statistics based on country. From the graph you can see that Zimbabwe has the highest prevalence however the most infections and deaths are in South Africa due to it’s high population relative to the other nations. South Africa also has a higher prevalence however, being the second highest.
Visualization 2: Treemap
treemap(df_summarised,index ="Country",vSize ="count",vColor ="avg_prev",type ="value",palette ="-RdYlBu",title ="HIV Prevalence by Nation (10 Nations with Highest Infections)",title.legend ="Average Prevalence")
This is a treemap showing the prevalence of HIV in ten nations with the most average HIV cases per year since 1990. The treemap itself shows that HIV is most prevalent in Zimbabwe, South Africa, Zambia, and Malawi.