Error in contrasts when defining a linear model in R
If your independent variable (RHS variable) is a factor or a character taking only one value then that type of error occurs. Example: iris data in R (model1 <- lm(Sepal.Length ~ Sepal.Width + Species, data=iris)) # Call: # lm(formula = Sepal.Length ~ Sepal.Width + Species, data = iris) # Coefficients: # (Intercept) Sepal.Width Speciesversicolor Speciesvirginica … Read more