SundownAnalytics

.

Sundown Analytics

Climate Change Analysis

The following data analysis was performed using Python’s Jupyter Notebook. It’s data is from www.kaggle.com.

Imports:

Data File:

Timeseries Trend Analysis:

CO2 and Temperature by Year:

As CO2 levels trend upward, so does average temperature..

Oil Production and CO2 Levels by Year:

CO2 levels trend upward with oil production.

Average Urban Population and CO2 Levels over Time:

CO2 levels trend upward with average urban population.

Temperature and Average Sea Ice Extent:

As average temperature rises, sea ice extent starts to fluctuate at the North and South poles.

Simple Linear Regression: The Relationship Between Oil Production and CO2:

Step 1: Check the normality of the Y variable’s distribution (CO2).

The y-variable CO2 is generally normally distributed. This means we can proceed, as no transformations of the Y-variable are required to make it fit a linear model.

Step 2: Plot a Scatterplot: Oil Production (Top 50 Countries) vs. CO2

The scatterplot shows a clear positive relationship between oil production and CO2 levels. As oil production rises (millions of barrels), so does CO2.

Step 3: Linear Regression Model

Linear Regression Interpretation:

Linear Equation:

The first step is to write the linear equation: Y = B0 + B1*X1. In this example, the equation of the line is CO2 = 257.4989 + 0.0015* Millions of Oil Barrels Produced per Year.

R-Squared:

Next, assess the R-squared: it establishes the fit of the model. This example has an R-squared of 0.99, indicating a strong fitting model. This means the model is sufficient for predictions and interpreting the Betas.

P-Values:

Next, assess the p-values for the X-variable of Oil Production: if the p-value is less than the alpha of 0.05 (at 95% confidence level) then the Beta of Oil Production is significant in relation to CO2. In this case, the p-value of 0.000 is less than alpha of 0.05 – indicating a significant Beta.

Beta Coefficients:

Finally, assess the Beta Coefficient of the X-variable Oil Production: Beta is the slope of the line in the equation Y = B0 + B1*X (or y = mx + b). For each unit increase in X, Y changes by B1. In this example, for every additional million barrels of oil produced per year, CO2 increases by 0.0015 units.

We can also perform calculations on the linear equation, to bring it to more understandable terms. For example, if we multiply the equation by 100, then for every additional one hundred million barrels of oil produced per year, CO2 increases by 0.15 units.

Note: B0 is the Y intercept: the value of Y when X is 0. It is not always relevant so interpret with caution. Also, remember that a relevant Beta establishes a relationship between X and Y, but it doesn’t mean causation.

Summary

Using Python, a data analysis of climate change was conducted. A timeseries analysis shows that rising temperatures trend with rising oil production and that CO2 levels rise with average urban population. Further, as temperatures rise, sea ice extent starts to fluctuate and become unstable.

Further, a simple linear regression of oil production’s relationship with CO2 levels was performed. It was found that a rise in oil production correlates with a rise in CO2 levels.

In terms of data visualization, we learned the use of combo charts to compare trends over time, scatterplots to visuzalize relationships and histograms to ensure our y-variable would fit a linear model. A future lesson will dive into what to do when the y-variable is not normally distributed, and needs transformation to fit a linear model.