Quick Regression Demo

A Quick Demonstration of Regression With the iris Data”

stats
teaching
Author

Andy Grogan-Kaylor

Published

April 2, 2026

Data

These are the famous Iris data, collected by Edgar Anderson.

Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa

Irises

Iris Species

Iris Species

Petals and Sepals

Petals and Sepals

Regression

  Petal.Length
Predictors Estimates CI p
(Intercept) -2.52 -3.64 – -1.41 <0.001
Sepal Length 1.78 1.65 – 1.90 <0.001
Sepal Width -1.34 -1.58 – -1.10 <0.001
Observations 150
R2 / R2 adjusted 0.868 / 0.866

Visualization