I am trying to build a linear regression model with interaction to predict Sepal.Length based on both Petal.Length and Species from iris. For some reason, the output of my model only shows two of the three Species.
Code:
mod1=lm(Sepal.Length~Petal.Length*Species,data=iris)
summary(mod1)$coef
Output:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.2131682 0.4074209 10.341071 4.331619e-19
Petal.Length 0.5422926 0.2767667 1.959385 5.199902e-02
Speciesversicolor -1.8056451 0.5984284 -3.017312 3.016413e-03
Speciesvirginica -3.1535091 0.6340741 -4.973408 1.846894e-06
Petal.Length:Speciesversicolor 0.2859884 0.2950624 0.969247 3.340471e-01
Petal.Length:Speciesvirginica 0.4534460 0.2901455 1.562823 1.202893e-01
I have no clue why the other Species isn't showing up.