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


hi i'm learning statsmodel , can't figure out difference between : , * (interaction terms) formulas in statsmodels ols regression. please give me hint figure out?

thank you!

the documentation: http://statsmodels.sourceforge.net/devel/example_formulas.html

":" give regression without level itself. interaction have mentioned.

"*" give regression with level + interaction have mentioned.

for example a. glmmodel = glm("y ~ a: b" , data = df) you'll have 1 independent variable results of "a" multiply "b"

b. glmmodel = glm("y ~ * b" , data = df) you'll have 3 independent variables results of "a" multiply "b" + "a" + "b" itself


Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -