Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
204 views
in Technique[技术] by (71.8m points)

How to write many interaction terms in linear regression model in R?

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?

question from:https://stackoverflow.com/questions/66067050/how-to-write-many-interaction-terms-in-linear-regression-model-in-r

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...