问题
I'm sure this question must have been asked but I have no luck finding it in the archives. Anyways, I always thought that " : " or " * " meant the same thing when adding interaction terms. For example:
amount of gas ~ temperature * gas type amount of gas ~ temperature:gas type
However, now that I've started using GLMs I see that these generate different AIC scores, different estimates etc. when I switch between the two. Can anyone explain to me why this happens? Is it a problem with the stats package in R?
Thank you!
回答1:
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’.
来源:https://stackoverflow.com/questions/40567421/vs-in-r-for-modelling