I have a linear model with 15 independent variables. I want to run the model with all pairwise interaction terms. y~a+b+c+...15 independent variables+ab+bc+...1514 terms. I want to write this in the model matrix.Is there any way to run the model instead of manually writing 1514 terms in R?
2.1m questions
2.1m answers
60 comments
57.0k users