library( tidyverse) library(Sta486Project1mtf83)
\newpage
data( "mathData" ) ggplot( mathData, aes( x = G3, y=..density..))+ geom_histogram( bins = 10)+ facet_grid( . ~ Walc)+ geom_density()+ labs(title = "Final grade by increased weekend alcohol consumption")+ xlab("Final Grade")
Figure 1. I felt that this graph had interesting behavior when the 2( low alcohol consumption) group had a high density of low test scores. I feel that there may be under reporting, or some bias to the survey results where students are under estimating thier alcohol consumption and that may have a negative effect on their studies.
\newpage
ggplot( mathData, aes( x = G3))+ geom_histogram( bins = 10)+ facet_grid( . ~ nursery)+ aes(y=..density..)+ geom_density()+ ggtitle("Final Grade by Nursery school Attandance")+ xlab("Final Grade")
Figure 2. This graph is somewhat confirming my assumptions on that a child getting a headstart on thier education can benifit them in the long run. \newpage
data( "porData") ggplot( porData, aes( x = G3, y=..density..))+ geom_histogram( bins = 10)+ facet_grid( . ~ school)+ geom_density()+ ggtitle("Final grade by School")+ xlab("Final Grade")
Figure 3. Here I found the differences in the density plot interesting for the two schools. I would like to some further analysis on some of the school demographics to see what may be causing the differences seen. \newpage
ggplot( porData, aes( x = G3, y=..density.., color = school))+ geom_density()
Figure 4. By stacking the two density plots I felt that the differences were much more apparent. \newpage
ggplot( porData, aes( x = G3, y=..density..))+ geom_histogram( bins = 10)+ facet_grid( . ~ schoolsup)+ geom_density()+ ggtitle("Final grade by School Support for Students")+ xlab("Final Grade")
Figure 5. I think that this graph was interesting in that there were many more students performing poorly with school support, and I also find the large gap between peaks interesting. It could be that some students are able to really benefit from help while some may not be interested in school. \newpage
ggplot( porData, aes( x = G3))+ geom_histogram( )+ facet_grid( . ~ nursery)+ aes(y=..density..)+ geom_density()+ ggtitle("Final grade by Nursery school Attandance")+ xlab("Final Grade")
Figure 6. Another view of the results of attending nursery school.
ggplot( mathData, aes( x = school, y = G3 )) + geom_boxplot() m1 <- lm( G3 ~ Walc, mathData) anova(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.