Data Visualization: Creating graphs for your data

Univariate Graph

Graphed data set H1SE4: Teens perceived intelligence compared to peers

The graph is not symmetrical with one modal, with the most responses to "average" (2502) . It skews left to slightly.

Respondents seem to be pretty confident in their relative intelligence. 

#LESSON 4

data['H1SE4']=data['H1SE4'].astype('category')

data['H1SE4']=data['H1SE4'].cat.rename_categories(["Mod. Below Avg", "Slightly Below Avg", "Avg", "Slightly Above Avg", "Mod Above Avg", "Extremely Above Avg"])

seaborn.countplot(x="H1SE4", data=data)
plt.xlabel('Self-Percieved Intelligence')
plt.title('Intelligence Perception Compared to Peers')

#Univairate historgram
seaborn.distplot(data["H1SE4"].dropna(), kde=False);
plt.xlabel('Self-Percieved Intelligence')
plt.title('Intelligence Perception Compared to Peers')

print("counts of self-percieved intelligence - missing nan")
desc1 = data['H1SE4'].describe()
print(desc1) 

#Bivariate graph
data["H1SE4"]=data["H1SE4"].convert_objects(convert_numeric=True)

seaborn.factorplot(x="H1SE4", y="H1CO1", data=data, kind="bar", ci=None)
plt.xlabel('Self-Percieved Intelligence')
plt.ylabel('No. Sexually Active Young Adults')
plt.title ('Sexual Activity v. Perceived Intelligence')

Bivariate Graph  

Graphed data set H1SE4: Teens perceived intelligence compared to peers vs. H1C01: Teens who are sexually active

 

H1SE4-v-H1C01 copy.png

This was a really exciting graph to see, because it supports my hypothesis that self-perception/confidence and sexual activity are related. While this isn't exactly what I thought it would look like, its pretty close. 

I believed that individuals with lower self-confidence would be more likely to be sexually active than others; this graph proves that because it skews right. 

However, I am slightly surprised to see the slight up tick in sexual activity amount the "Extremely Above Average" category. The curve swings back upwards, when I would have thought that it would have continued to decrease. 

I would be interested to compare this graph with gender as well to see the comparison.