I always thought that *
and :
meant the same thing when adding interaction terms in R formulas. For example:
amount_of_gas ~ temperature*gas_type
amount_of_gas ~ temperature:gas_type
However, now that I've started using Generalized Linear Models (glm()
in R) I see that these generate different scores, different estimates, etc. when I switch between the two. Can someone explain to me why this happens? Is it a problem with the stats
package in R?
From help(formula)
:
In addition to ‘+’ and ‘:’, a number of other operators are useful
in model formulae. The ‘*’ operator denotes factor crossing:
‘a*b’ interpreted as ‘a+b+a:b’.