TidyTuesday: Income Inequality & Health

SDG 10: Reduced Inequalities

Author

Nichodemus Amollo

Published

June 8, 2021

Income Inequality & Health

Analysis of income inequality & health data from TidyTuesday 2021 - Week of 2021-06-08

Overview

This project explores the Income Inequality & Health dataset from TidyTuesday, focusing on data visualization and analysis techniques.

SDG Alignment: SDG 10: Reduced Inequalities

Load Required Packages

Data Import

Rows: 100
Columns: 4
$ id       <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18…
$ value    <dbl> -0.5604756, -0.7906531, 0.7680552, 0.8385636, 0.9678513, 2.68…
$ category <chr> "B", "B", "A", "B", "C", "C", "A", "B", "A", "B", "C", "C", "…
$ date     <date> 2021-06-08, 2021-06-09, 2021-06-10, 2021-06-11, 2021-06-12, …
       id             value             category        date           
 Min.   :  1.00   Min.   :-2.667   Length   :100   Min.   :2021-06-08  
 1st Qu.: 25.75   1st Qu.: 1.465   N.unique :  3   1st Qu.:2021-07-02  
 Median : 50.50   Median : 2.192   N.blank  :  0   Median :2021-07-27  
 Mean   : 50.50   Mean   : 2.473   Min.nchar:  1   Mean   :2021-07-27  
 3rd Qu.: 75.25   3rd Qu.: 3.383   Max.nchar:  1   3rd Qu.:2021-08-21  
 Max.   :100.00   Max.   :10.303                   Max.   :2021-09-15  

Data Exploration

  id      value category       date
1  1 -0.5604756        B 2021-06-08
2  2 -0.7906531        B 2021-06-09
3  3  0.7680552        A 2021-06-10
4  4  0.8385636        B 2021-06-11
5  5  0.9678513        C 2021-06-12
6  6  2.6829163        C 2021-06-13
'data.frame':   100 obs. of  4 variables:
 $ id      : int  1 2 3 4 5 6 7 8 9 10 ...
 $ value   : num  -0.56 -0.791 0.768 0.839 0.968 ...
 $ category: chr  "B" "B" "A" "B" ...
 $ date    : Date, format: "2021-06-08" "2021-06-09" ...
      id    value category     date 
       0        0        0        0 
       id             value             category        date           
 Min.   :  1.00   Min.   :-2.667   Length   :100   Min.   :2021-06-08  
 1st Qu.: 25.75   1st Qu.: 1.465   N.unique :  3   1st Qu.:2021-07-02  
 Median : 50.50   Median : 2.192   N.blank  :  0   Median :2021-07-27  
 Mean   : 50.50   Mean   : 2.473   Min.nchar:  1   Mean   :2021-07-27  
 3rd Qu.: 75.25   3rd Qu.: 3.383   Max.nchar:  1   3rd Qu.:2021-08-21  
 Max.   :100.00   Max.   :10.303                   Max.   :2021-09-15  

Data Wrangling

Visualizations

Visualization 1: Main Analysis

Visualization 2: Distribution Analysis

Interactive Visualization

Analysis & Insights

Key Findings

  1. Finding 1: [Description of key insight]
  2. Finding 2: [Description of key insight]
  3. Finding 3: [Description of key insight]

Statistical Summary

# A tibble: 3 × 6
  category  mean median    sd   min   max
  <fct>    <dbl>  <dbl> <dbl> <dbl> <dbl>
1 A         2.54   2.07  2.62 -2.52 10.3 
2 B         2.20   1.90  2.20 -1.68 10.1 
3 C         2.74   2.66  2.19 -2.67  8.77

Policy Implications

[Provide policy-relevant insights and recommendations based on the analysis]

Next Steps

References

Session Info

Code
utils::sessionInfo()
R version 4.6.1 (2026-06-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] plotly_4.12.1   patchwork_1.3.2 ggtext_0.2.0    showtext_0.9-8 
 [5] showtextdb_3.0  sysfonts_0.8.9  here_1.0.2      lubridate_1.9.5
 [9] forcats_1.0.1   stringr_1.6.0   dplyr_1.2.1     purrr_1.2.2    
[13] readr_2.2.0     tidyr_1.3.2     tibble_3.3.1    ggplot2_4.0.3  
[17] tidyverse_2.0.0

loaded via a namespace (and not attached):
 [1] utf8_1.2.6          generics_0.1.4      xml2_1.6.0         
 [4] stringi_1.8.9       hms_1.1.4           digest_0.6.39      
 [7] magrittr_2.0.5      evaluate_1.0.5      grid_4.6.1         
[10] timechange_0.4.0    RColorBrewer_1.1-3  fastmap_1.2.0      
[13] rprojroot_2.1.1     jsonlite_2.0.0      httr_1.4.9         
[16] crosstalk_1.2.2     viridisLite_0.4.3   scales_1.4.0       
[19] cli_3.6.6           rlang_1.3.0         withr_3.0.3        
[22] yaml_2.3.12         otel_0.2.0          tools_4.6.1        
[25] tzdb_0.5.0          vctrs_0.7.3         R6_2.6.1           
[28] lifecycle_1.0.5     htmlwidgets_1.6.4   pkgconfig_2.0.3    
[31] pillar_1.11.1       gtable_0.3.6        data.table_1.18.6.1
[34] glue_1.8.1          Rcpp_1.1.2          xfun_0.60          
[37] tidyselect_1.2.1    knitr_1.51          farver_2.1.2       
[40] htmltools_0.5.9     labeling_0.4.3      rmarkdown_2.32     
[43] compiler_4.6.1      S7_0.2.2            gridtext_0.1.6     

⬅️ Back to TidyTuesday Index