2023-02-10

What is this dataset about?

  • The following data is listed about 150 different irises:
  • Sepal Length
  • Sepal Width
  • Petal Length
  • Petal Width
  • Species

Plot of Petal Lengths and Widths for each Iris

Average Petal Length of Each Species

R code from last plot

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)

Sepal Length and Petal Length for each Iris

Slope of Regression line for Versicolor Species Petal Length vs Width

\(\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

Slope of Regression line for Virginica Species Petal Length vs Sepal Length

\(\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