p <-ggplot(categorical, aes(x=siblings_mean, y=childs_mean, color=religion))p +geom_point(size=5) +annotate(geom ="text", x =2, y=3.5, label ="", hjust=0) +labs(y="Average number children", x="Average # siblings.", title="Number of siblings and Number of Children by Region", subtitle ="Catholics have the most average siblings", caption <-"gss_sm dataset{socviz}")
p <-ggplot(categorical, aes(x=siblings_mean, y=childs_mean, color=religion.c))p +geom_point(size=5) +annotate(geom ="text", x =1.6, y=3.5, label ="", hjust=0) +labs(y="Average number of children", x="Average Number of siblings", color ="Religion") +theme(legend.title =element_text(color="gray50", size=14, face="bold"),legend.position =c(x=0.1, y=.7))
Part 6 - Data Labels
p <-ggplot(pip2, aes(x=siblings_mean, y=childs_mean, color=religion.c))p +geom_point(size=5) +geom_text(mapping =aes(label=religion), hjust=1.2, size=3) +annotate(geom ="text", x =1.8, y=3.5, label ="", hjust=0) +labs(y="Average number of children", x="Average Number of siblings", title="Number of siblings and Number of Children by Region", color ="Religion") +theme(legend.position ="none")
# A tibble: 6 × 7
marital N childs_mean siblings_mean freq pct marital.c
<fct> <int> <dbl> <dbl> <dbl> <dbl> <chr>
1 Divorced 495 2.23 3.86 0.173 17 Divorced
2 Married 1212 2.17 3.63 0.423 42 Married
3 Never Married 806 0.748 3.38 0.281 28 Never Married
4 Separated 102 2.46 4.79 0.0356 4 Separated
5 Widowed 251 2.84 4.49 0.0875 9 Widowed
6 <NA> 1 6 7 0.000349 0 <NA>
p <-ggplot(categorical2, aes(x=siblings_mean, y=childs_mean, color=marital.c))p +geom_point(size=5) +annotate(geom ="text", x =1.6, y=7, label ="", hjust=0) +labs(y="Average number of children", x="Average Number of siblings", title ="Number of children and siblings by marital status",subtitle ="Many people did not report thier marital status and they had an average of 7 siblings and 6 children",color ="marital") +theme(legend.title =element_text(color="gray50", size=14, face="bold"),legend.position =c(x=0.1, y=.7))
Catholics had the most siblings and Jewish had the least. Every relgion had at least one child on average with unknown religions slightly having more than 2. The unknown marital status had many siblings and many children. Every other status had around 4 siblings and 2 children.