Dataset Overview and Source

This presentation analyzes alcohol consumption across countries and how it relates to GDP per capita, population, year and continent.

Data Source:Kaggle alcohol consumption by country dataset

The variables used:

  • Entity: country name
  • Year: year
  • alcohol: alcohol consumption per capita
  • gdp: GDP per capita
  • population: population
  • Continent: continent

R code for the data preparation

library(ggplot2)
library(plotly)
library(dplyr)

data <- read.csv("alcohol-consumption-vs-gdp-per-capita.csv")

colnames(data)[4] <- "alcohol"
colnames(data)[5] <- "gdp"
colnames(data)[6] <- "population"

data <- data %>%
  filter(!is.na(alcohol), !is.na(gdp), !is.na(population), !is.na(Continent))

data_2018 <- data %>%
  filter(Year == 2018)

3D Plotly Plot

#plty plt
plot_ly(data=data_2018,x=~gdp,y=~alcohol,z=~population,type="scatter3d",mode="markers",color=~Continent) %>%
  layout(title="GDP, alcohol consumption, and population in 2018",scene = list(xaxis = list(title = "GDP per Capita"),yaxis = list(title = "Alcohol Consumption"),
      
      
      
      zaxis = list(title = "Population")))

3D Plot Analysis

This plot shows three variables at the same time. It helps compare GDP per capita, alcohol consumption, and population across countries in 2018.

Plotly Scatter Plot

plot_ly(data=data_2018,x=~gdp,y=~alcohol,type="scatter",mode="markers",color=~Continent) %>%
  
  
  
  #scter plt
  layout(   title="GDP per capita vs alcohol consumption in 2018",xaxis =list(title="GDP per Capita"),yaxis=list(title="Alcohol consumption")
  )

plotly scatter analysis

This scatterplot shows the relationship between GDP per capita and their alcohol consumption, it seems to be some positive relationship but the points are still spread out.

ggplot bar chart

continent_summary<-data_2018 %>%
  group_by(Continent) %>%
  summarise(avg_alcohol = mean(alcohol))
#plottttttt
ggplot(continent_summary,aes(x=Continent,y= avg_alcohol,fill=Continent))+geom_bar(stat="identity")+labs(title= "Average Alcohol Consumption by Continent in 2018",x    = "Continent",y="Average Alcohol Consumption")

#"Continent",y="Avg Alc Consumption")

ggplot Bar Chart Analysis

This bar chart compares average alcohol consumption across continents in 2018

ggplot Boxplot

ggplot(data_2018, 
  aes(x=Continent,y=alcohol,    fill=Continent))+ geom_boxplot()+labs(title="alcohol consumption by continent in 2018",x ="continent",y="Alcohol Consumption")

ggplot Boxplot Analysis

This boxplot shows the spread of alcohol consumption values for each continent and it also helps compare variation between continents.

Statistical Analysis

data_2018 %>%group_by(Continent) %>%summarise(Count= n(),Mean_Alcohol=mean(alcohol),Median_Alcohol= median(alcohol),SD_Alcohol  =sd(alcohol)
  )
## # A tibble: 1 × 5
##   Continent Count Mean_Alcohol Median_Alcohol SD_Alcohol
##   <chr>     <int>        <dbl>          <dbl>      <dbl>
## 1 ""          182         6.11              6       4.13

Statistical Analysis Interpretation

The summary statistics show that alcohol consumption is different across continents. The regression suggests GDP per capita is related to alcohol consumption although it does not explain everything.

Linear Regression

model<-lm(alcohol~gdp,data=data_2018)
summary(model)
## 
## Call:
## lm(formula = alcohol ~ gdp, data = data_2018)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -10.1588  -2.6036   0.2127   2.5872  13.8430 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 4.523e+00  3.976e-01  11.376  < 2e-16 ***
## gdp         7.804e-05  1.375e-05   5.675 5.46e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.818 on 180 degrees of freedom
## Multiple R-squared:  0.1518, Adjusted R-squared:  0.1471 
## F-statistic: 32.21 on 1 and 180 DF,  p-value: 5.46e-08

Conclusion

Alcohol consumption is differnet across continents. GDP per capita also appears to be related to alcohol consumption although it is not the only factor. Overall both geography and economics help explain differences across countries.

Thank Youuuuuuuu!!!!!! :)

Dataset source: Kaggle alcohol consumption by country