Research Question:

Does the mean annual COâ‚‚ emissions per capita differ significantly across continents (e.g., North America, Europe, Asia, Africa, South America, Oceania)?

The Dataset:

The dataset used in this project is titled “CO₂ emissions per capita.” It measures carbon dioxide (CO₂) emissions from burning fossil fuels and industrial processes. This includes emissions from transport, electricity generation, and heating, but not land-use change. The dataset has 26,509 rows and 4 columns: entity, code, year, and emissions_total_per_capita. The entity column shows the name of each country or territory, and the emmissions_total_per_capita shows the CO2 emissions per person in that country for that year For this project, we will only use measurements from the most recent year available in the dataset, which is 2024. The dataset can be found on ourworldindata.org: https://ourworldindata.org/grapher/co-emissions-per-capita

  library(tidyverse)
  library(countrycode)

Cleaning and EDA:

We will be cleaning the dataset by removing aggregated rows and any rows that are not from 2024. We will also add a continent column to categorize our data for the ANOVA. Then, we will generate a box jitter plot to visualize the data and see the differences between means across the groups.

#Our World in Data, "CO2 emissions per capita", ourworldindata.org
df = read.csv("https://ourworldindata.org/grapher/co-emissions-per-capita.csv?v=1&csvType=full&useColumnShortNames=true")

#Get only non-aggregated row from 2024 to prep for the ANOVA, also add continent column to prep for ANOVA
emissions <- df |> 
  filter(year==2024) |> 
  filter(!str_detect(code, "OWID")) |> 
  filter(!code == "") |> 
  mutate(continent = countrycode(sourcevar = code, 
                               origin = "iso3c", 
                               destination = "continent"))
ggplot(emissions, aes(x = continent,
                      y = emissions_total_per_capita)) +
  geom_boxplot(outlier.shape = NA) +
  geom_jitter() +
  theme_minimal()

Null and Alternative Hypotheses

The following is the null hypothesis for our ANOVA test. It states that the means of all groups are equal.

H0: µ1 = µ2 = µ3 = µ4 = µ5

The following is the alternative hypothesis for our ANOVA test. It states that at least one group mean differs from the others.

H1: µi \(\neq\) µj

#analysis
model <- aov(emissions$emissions_total_per_capita ~ emissions$continent)
summary(model)
##                      Df Sum Sq Mean Sq F value   Pr(>F)    
## emissions$continent   4   1010  252.45   9.608 3.78e-07 ***
## Residuals           208   5465   26.27                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The ANOVA test has 4 degrees of freedom, meaning that 5 groups were tested. The F value is 9.608, which shows that the differences in mean emissions between groups are large relative to the in-group noise. The p-value is .000000378, which is much less than 0.05. As such, we can reject our null hypothesis and confirm our alternative hypothesis that at least one group mean is significantly different from the others.

We will use TukeyHSD to determine which continents’ mean C02 emissions vary from each other the most and by how much.

#see differences between groups and whether they are statistically significant
tukey <- TukeyHSD(model)

#visualize confidence intervals in a plot. Change margin size so that labels for each comparison are fully readable.
par(mar=c(5.1, 8, 4.1, 2.1))
plot(tukey, las=1,  col="brown")

The difference between two continents is statistically significant if the confidence interval (lwr to upr) does not cross zero (meaning it is within the confidence interval that the difference between group means is 0) or the comparison’s p adj value is less than 0.05.

Statistically Significant Differences

Statistically Insignificant Differences

The key findings of our analysis is that Africa stands out as having lower mean CO2 emissions than Asia, the Americas, and Europe. The Americas, Asia, Europe, and Oceania do not differ significantly from each other. They form a fairly similar cluster above Africa.

Possible avenues for further research include: What are the energy demands of different continents Is there a relationship between continental GDP per capita and C02 emissions? *How much energy does each continent generate using renewable sources such as solar and wind power?

Resources: Plotting TukeyHSD results: https://r-graph-gallery.com/84-tukey-test.html