Difference between the interaction : and * term for formulas in StatsModels OLS regression

落花浮王杯 提交于 2019-12-03 15:21:25
Yaron

":" will give a regression without the level itself. just the interaction you have mentioned.

"*" will give a regression with the level itself + the interaction you have mentioned.

for example

a. GLMmodel = glm("y ~ a: b" , data = df)

you'll have only one independent variable which is the results of "a" multiply by "b"

b. GLMmodel = glm("y ~ a * b" , data = df)

you'll have 3 independent variables which is the results of "a" multiply by "b" + "a" itself + "b" itself

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!