Don't wanna be here? Send us removal request.
Text
Gapminder Graphical Representation of the relationship between co2emissions and alcohol consumption to lifeexpectancy
below is the program for the univariate graph of the lifeexpectancy,co2emissions and alcohol consumption variable.
import pandas import numpy import matplotlib.pyplot as plt import seaborn
data = pandas.read_csv('gapminder.csv', low_memory = False) data = data.replace(r'^\s*$', numpy.NaN, regex=True) data['lifeexpectancy'] = pandas.to_numeric(data['lifeexpectancy']) data['co2emissions'] = pandas.to_numeric(data['co2emissions']) data['alcconsumption'] = pandas.to_numeric(data['alcconsumption']) x = data['alcconsumption'] b = data['co2emissions'] c = data['lifeexpectancy'] seaborn.distplot(x, kde=False) plt.xlabel('alcconsumption') plt.title('alcconsumption') seaborn.distplot(b, kde=False) plt.xlabel('co2emissins') plt.title('co2emission distribution') seaborn.distplot(c, kde=False) plt.xlabel('lifeexpectancy') plt.title('distribution of lifeexpectancy')
below is the histogram (univariate) graph showing the distribution of the variables
as we can see the distribution for co2emission and lifeexpectancy is thesame but that of alcohol consumption is different
below is the program for the measure of central tendencies, mean, mode, STD etc
desc1 = data['co2emissions'].describe() print(desc1) desc2 = data['lifeexpectancy'].describe() print(desc2) desc3 = data['alcconsumption'].describe() print(desc3)
below is the output
count 2.000000e+02 mean 5.030226e+09 std 2.571667e+10 min 1.320000e+05 25% 3.484617e+07 50% 1.859018e+08 75% 1.846084e+09 max 3.340000e+11 Name: co2emissions, dtype: float64 count 191.000000 mean 69.753524 std 9.708621 min 47.794000 25% 64.447000 50% 73.131000 75% 76.593000 max 83.394000 Name: lifeexpectancy, dtype: float64 count 187.000000 mean 6.689412 std 4.899617 min 0.030000 25% 2.625000 50% 5.920000 75% 9.925000 max 23.010000 Name: alcconsumption, dtype: float64
below is the program that describe the relationship between co2emission and lifeexpectancy and alcohol consumption and lifeexpectancy
#basic scatterplot: Q->Q scat1 = seaborn.regplot(x="co2emissions", y="lifeexpectancy", fit_reg=False, data=data) plt.xlabel('co2emissions') plt.ylabel('lifeexpectancy') plt.title('Scatterplot for the Association Between co2emissions and lifeexpectancy') scat2 = seaborn.regplot(x="co2emissions", y="lifeexpectancy", data=data) plt.xlabel('co2emissions') plt.ylabel('lifeexpectancy') plt.title('Scatterplot for the Association Between co2emissions and lifeexpectancy') scat3 = seaborn.regplot(x="alcconsumption", y="lifeexpectancy", data=data) plt.xlabel('alcconsumption') plt.ylabel('lifeexpectancy') plt.title('Scatterplot for the Association Between alcconsumption and lifeexpectancy')
below is the output of the various graphs
as you can see from the graph the graph the relationship between alcohol consumption and lifeexpectancy are linear also that of co2emission with lifeexpectancy, meaning countries where there is high co2emission will have high lifeexpectancy and same with alcohol consumption.
0 notes
Text
datamanagementdecision i made a decision to code out missing data and set new variable, below is the code
OUTPUT
as can be seen from the output there is no missing data, and the frequency distribution for the various ethnic group is well represented with the hispanic/latino having the largest percentage
0 notes
Text
myfirstprogram
1. attached below is my program, to obtain the frequency distributions of my variables(count and percentages) the variables are lifeexpectancy,co2emissions and alcoholconsumption
2. attached below is the output of my program; the Frequency Distributions of my variables
0 notes
Text
Data Analysis
1. After looking through the codebook for gapminder, I have decided that I am particularly interested in LIFE EXPECTANCY. The variables i will use include; co2 emissions, alcohol consumption and life expectancy.
2. It strikes me to understand the effect/association of CO2 EMISSIONS to LIFE EXPECTANCY of people in different countries, how does co2 emission affect the life of people in country Y as compared to X vice versa.
3. I will also like to explore the association of ALCOHOL CONSUMPTION to LIFE EXPECTANCY of the different country.
LITERATURE REVIEW
Drinking pattern and mortality, the Italian risk factor and life expectancy pooling project.
8,647 men and 6521 women, age 30 - 59 and free of cardiovascular disease were followed for mortality from all causes cardiovascular and non cardiovascular during an average follow up of 7yrs
Drinkers of wine outside meals exhibited higher death rate /lower life expectancy as compared to those that drink with meals and it seems to be stronger in women than men.
Hypothesis
Life expectancy decreases as individuals keep taking wine without meals, drinking pattern have important effect in determining the life expectancy of individuals in a society as shown in the research.
VARIABLES
1. MEN AND WOMEN OF AGE 30-59, 2. RATE OF ALCOHOL CONSUMPTION
3. DURATIONS OF FOLLOW UPS. LIFE EXPECTANCY
Unique Identifier: MEN AND WOMEN
REFERENCE
Maurizio Treunson MD, MS Enrique schusterman PHD.
The risk factor and life expectancy research group.
1 note
·
View note