Association Between Electric Consumption and Co2 Emission
Introduction In gapminder data, the association between electric consumption and Co2 Emission was trying to find out. Getting and Preparing Data Data Analysis The p-value is lower than 0.05 so we reject the null hypthothesis that there is definetly an association between electric consumption and Co2 Emission. R-squared value is %3, which is pretty low . The low value indicates that we might find other explanatory variables to make our model stronger. Basic Linear Regression Model The regression function with their coefficients are " Co2 Emission = 3.482e+6 relectrciperperson + 1.58e+06" Codes import numpy import pandas as pandas import statsmodels.api import statsmodels.formula.api as smf import matplotlib.pyplot as plt from sklearn.preprocessing import Normalizer import seaborn # bug fix for display formats to avoid run time errors pandas.set_option('display.float_format', lambda x:'%.2f'%x) #call in data set data = pandas.read_csv('data/gapminder.cs...