Andrew Koerner, Gustavo Maida & Paula Davila Benitez
First Graphs.
Code
library(ggplot2)p <-ggplot(data = midwest, mapping =aes(x=percbelowpoverty, y=percollege))p +geom_point() +labs(x="Percent Below Poverty", y="Percent College-Educated", title="Percentage Below Poverty compared with Percentage of College Education",subtitle="Comparing the 5 Midwest States")
Code
p <-ggplot(data = midwest, mapping =aes(x=percbelowpoverty, y=percollege))p +geom_density_2d() +geom_point(aes(color = state)) +labs(x="Percent Below Poverty", y="Percent College-Educated", title="Percentage Below Poverty compared with Percentage of College Education",subtitle="Comparing the 5 Midwest States",caption="Source: dataset{midwest}")
Code
p <-ggplot(data = midwest, mapping =aes(x=percbelowpoverty, y=percollege))p +geom_density_2d(aes(color = state)) +geom_point(aes(color = state)) +labs(x="Percent Below Poverty", y="Percent College-Educated", title="Percentage Below Poverty compared with Percentage of College Education",subtitle="Comparing the 5 Midwest States",caption="Source: dataset{midwest}")
Interpretation
The second graphic provides a better visualization. We think adding color is beneficial to differentiate and compare every state. However, the geom density 2d function could be confusing and takes more room which does not allow the public to clearly difference between the dots. Even adding the differentiation between states in the contour lines does not improve the visualization of the data. We came to the conclusion it was better without this function but adding the colors its fundamental. Most observations are located between 15% of college-educated and 10% below poverty.
Code
library(ggplot2)p <-ggplot(data = midwest, mapping =aes(x=percbelowpoverty, y=percollege))p +geom_density_2d()+geom_point(aes(color = state)) +facet_wrap(~state, ncol=5) +labs(x="Percent Below Poverty", y="Percent College-Educated", title="Percentage Below Poverty compared with Percentage of College Education",subtitle="Comparing the 5 Midwest States",caption="Source: dataset{midwest}")
Code
p <-ggplot(data = midwest, mapping =aes(x=percbelowpoverty, y=percollege))p +geom_point(aes(color = state)) +facet_wrap(~state, ncol=5) +labs(x="Percent Below Poverty", y="Percent College-Educated", title="Percentage Below Poverty compared with Percentage of College Education",subtitle="Comparing the 5 Midwest States",caption="Source: dataset{midwest}")
Facet Interpretation
We agreed the first graph would be better if we only want to see all the states together, but if we would like to compare each state between each other the faceting would be very useful to clearly see these differences between the states.
Illinois has the highest observations of percentage of college-educated. All observations reasonable gather between 20% percent of college-educated and 20% below poverty. Indiana observation are gathered between 15% of college-educated and 15% below poverty. Michigan observations are between 20% college-educated and 30% below poverty. Ohio has more dispersion but because it does not have outliers all the observations are clustered between 30% of college-educated and 30% below poverty. Wisconsin has the highest observation of 50% below poverty, and the highest observation of 47% college-educated.