ggplot(iris, aes(x = Species, y = Sepal.Length, fill = Species)) + geom_boxplot()
Week 5 Workbook
Formative Exercise 5
#Graphic 1
This graphic can be associated to the MANOVA test. This is because “species” is a categorical predictor variable and “sepal length” is a quantitative outcome variable.
#Graphic 2
This graphic can be associated with the Simple Regression test. The quantitative, predictive variable “petal length”, produces the single quantitative variable outcome of “petal length”.
ggplot(iris, aes(x = Petal.Length, fill = Species)) + geom_density()
#Graphic 3
This graphic can be associated with the Multiple Regression test. It shows a correlation between two predictive, quantitative variables “Petal Length” and “Petal Width” and produces an outcome comparing the correlations across the category “Species”.
ggplot(iris, aes(x = Petal.Length, y = Petal.Width)) + geom_point(size = 1, aes(color = Species)) + geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
#Graphic 4
This graphic can be associated with the Chi-square test. Two categorical, predictor variables “size” and “species” produce the two outcome variables “size” and “species”.