Project Part 1

Preparing number of alcohol use disorder data for plotting.

  1. I downloaded alcohol disorder rates data from Our World in Data. I selected this data because I’m interested in the alcohol use disorders by region from 1990 to 2019.

  2. This is the link to the data.

  3. The following code chunk loads the package I will use to read in and prepare the data for analysis.

  1. Read the data in
number_with_alcohol_disorders_by_region <-
read_csv(here::here("_posts/2022-05-10-project-part-1/number-with-alcohol-disorders-by-region.csv"))
  1. Use glimpse to see the names and types of columns.
glimpse(number_with_alcohol_disorders_by_region)
Rows: 6,840
Columns: 4
$ Entity                                                                    <chr> …
$ Code                                                                      <chr> …
$ Year                                                                      <dbl> …
$ `Prevalence - Alcohol use disorders - Sex: Both - Age: All Ages (Number)` <dbl> …
# View(number_with_alcohol_disorders_by_region)
  1. Use output from glimpse (and View) to prepare the data for analysis
regions  <- c( "European Region (WHO)",
               "Eastern Mediterranean Region (WHO)",
               "South-East Asia Region (WHO)",
               "African Region (WHO)",
               "Region of the Americas (WHO)",
               "Western Pacific Region (WHO)" )

regional_disorders <- number_with_alcohol_disorders_by_region  %>% 
  rename(Region = 1, NumberofPeople = 4)  %>% 
  filter(Year >= 1990, Region %in% regions)  %>% 
  select (Region, Year, NumberofPeople)

regional_disorders
# A tibble: 180 × 3
   Region                Year NumberofPeople
   <chr>                <dbl>          <dbl>
 1 African Region (WHO)  1990        4230659
 2 African Region (WHO)  1991        4350481
 3 African Region (WHO)  1992        4454542
 4 African Region (WHO)  1993        4557674
 5 African Region (WHO)  1994        4684458
 6 African Region (WHO)  1995        4828676
 7 African Region (WHO)  1996        4985429
 8 African Region (WHO)  1997        5138606
 9 African Region (WHO)  1998        5283007
10 African Region (WHO)  1999        5425882
# … with 170 more rows

Check that the total for 2019 equal the total in the graph

regional_disorders    %>%  filter(Year == 2019)    %>% 
  summarize(total_nmr = sum (NumberofPeople))
# A tibble: 1 × 1
  total_nmr
      <dbl>
1 107852244

Add a picture.

Regional Disorders

Write the data to file in the project directory

write_csv(regional_disorders, file= "number_with_alcohol_disorders_by_region.csv" )