How do regression models deal with the factor variables?
问题 Suppose I have a data with a factor and response variable. My questions: How linear regression and mixed effect models work with the factor variables? If I have a separate model for each level of the factor variable (m3 and m4) , how does that differ with models m1 and m2 ? Which one is the best model/approach? As an example I use Orthodont data in nlme package. library(nlme) data = Orthodont data2 <- subset(data, Sex=="Male") data3 <- subset(data, Sex=="Female") m1 <- lm (distance ~ age +