2016-11-12 94 views
2

我確定這個問題肯定有人問過,但我沒有在檔案中找到它。無論如何,我一直認爲添加互動條款時,「:」或「*」意思相同。例如:「*」vs「:」in R for model

氣體溫度〜*氣體類型 量的氣體溫度〜量:氣體類型

但是,現在,我已經使用GLMS開始......我得到不同的分數AIC,不同的估計等當我在兩者之間切換時。誰能向我解釋爲什麼會發生這種情況? R中的統計信息包有問題嗎?

謝謝!

+3

[這](http://conjugateprior.org/2013/01/formulae-in-r-anova/)解釋說不錯不錯,我發現谷歌搜索「星號vs R建模中的冒號「 –

+0

非常感謝! –

+0

既然您已經開始使用GLM,閱讀'?glm'會不會很自然?它在那裏。 – Henrik

回答

4

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’.