- The following data is listed about 150 different irises:
- Sepal Length
- Sepal Width
- Petal Length
- Petal Width
- Species
2023-02-10
library(ggplot2) library(dplyr) data(iris)
setosa = filter(.data=iris, Species == “setosa”) versicolor = filter(.data=iris, Species == “versicolor”) virginica = filter(.data=iris, Species == “virginica”)
df = data.frame(species = c(“setosa”, “versicolor”, “virginica”), avg_petal_length = c(mean(setosa\(Petal.Length), mean(versicolor\)Petal.Length), mean(virginica$Petal.Length)))
ggplot(df, aes(x=species, y=avg_petal_length, fill = species)) + geom_bar(stat=“identity”, width=.7)
\(\mu\)x = 4.26, \(\mu\)y = 1.199, \(\sigma\)x = 1.765, \(\sigma\)y = 0.762
Slope of Regression Line = \(\sigma\)y / \(\sigma\)x = 0.421
\(\mu\)x = 5.552, \(\mu\)y = 6.588, \(\sigma\)x = 0.551, \(\sigma\)y = 0.636
Slope of Regression Line = \(\sigma\)y / \(\sigma\)x = 1.154