Click the Original, Code and Reconstruction tabs to read about the issues and how they were fixed.
Objective
The objective of the original data visualization is to present information on the impact of mental health problems globally, with a particular emphasis on the extent of disability caused by mental and behavioural disorders. The graph aims at illustrating the age groups most affected by mental health issues and the level of disability associated with these conditions. The data visualization shows that mental health issues cause the most disability in ages 15 through 39, with mental and behavioral disorders (such as depression, anxiety, schizophrenia, and drug and alcohol use disorders) accounting for 23% of total years lost due to disability at the global level in 2010.
The targeted audience for this information is likely health professionals, policymakers, and researchers who are interested in understanding the burden of mental illness on the global population and in identifying potential areas for intervention and prevention efforts.
The visualisation chosen had the following three main issues:
Reference
Humanosphere. (2013, June 11). Visualizing Mental Illness Worldwide. Retrieved from https://www.humanosphere.org/global-health/2013/06/visualize-mental-illness/#prettyPhoto
The following code was used to fix the issues identified in the original.
#Setup
library("ggplot2")
library("dplyr")
library("here")
library("readr")
#Read/Import Data
setwd("/Users/swetakarmacharya/Documents/Projects/Mental-Health")
global_data <- read.csv("data.csv")
str(global_data)
## 'data.frame': 160 obs. of 16 variables:
## $ measure_id : int 3 3 3 3 3 3 3 3 3 3 ...
## $ measure_name : chr "YLDs (Years Lived with Disability)" "YLDs (Years Lived with Disability)" "YLDs (Years Lived with Disability)" "YLDs (Years Lived with Disability)" ...
## $ location_id : int 1 1 1 1 1 1 1 1 1 1 ...
## $ location_name: chr "Global" "Global" "Global" "Global" ...
## $ sex_id : int 3 3 3 3 3 3 3 3 3 3 ...
## $ sex_name : chr "Both" "Both" "Both" "Both" ...
## $ age_id : int 2 3 4 5 6 7 8 9 10 11 ...
## $ age : chr "0-6 days" "7-27 days" "28-364 days" "1-4 years" ...
## $ cause_id : int 571 571 571 571 571 571 571 571 571 571 ...
## $ cause : chr "Anxiety disorders" "Anxiety disorders" "Anxiety disorders" "Anxiety disorders" ...
## $ metric_id : int 1 1 1 1 1 1 1 1 1 1 ...
## $ metric_name : chr "Number" "Number" "Number" "Number" ...
## $ year : int 2019 2019 2019 2019 2019 2019 2019 2019 2019 2019 ...
## $ val : int 0 0 0 60816 867657 2144287 2658071 2695512 2732436 2730189 ...
## $ upper : num 0 0 0 95814 1375333 ...
## $ lower : num 0 0 0 35566 507816 ...
#Preprocessing of data
#Sort Age (desc) as a factor variable for Data Cleaning
unique_age = unique(global_data$age)
unique_age
## [1] "0-6 days" "7-27 days" "28-364 days" "1-4 years" "5-9 years"
## [6] "10-14 years" "15-19 years" "20-24 years" "25-29 years" "30-34 years"
## [11] "35-39 years" "40-44 years" "45-49 years" "50-54 years" "55-59 years"
## [16] "60-64 years" "65-69 years" "70-74 years" "75-79 years" "80+ years"
global_data$age = factor(global_data$age, levels = unique_age)
#Plot graph using ggplot
Graph <- ggplot(global_data, aes(y = (val), fill = global_data$cause,
x = `age`)) + ylab("Years Lived with Disability(YLD)") + xlab("Age range")+
labs(title = "YLD by Age Range") + facet_wrap(.~global_data$cause, ncol = 2)
Graph2 <- Graph + theme(legend.position = "none") +
geom_bar(stat = "identity") +
scale_y_continuous(labels = scales::comma) +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
Data Reference
Institute for Health Metrics and Evaluation. (n.d.). Global Burden of Disease Study 2019 (GBD 2019) results. Retrieved from https://vizhub.healthdata.org/gbd-results/
The following plot fixes the main issues in the original.