gpt4 book ai didi

r - 在两个字符之间使用 "colon"作为 lm() 中的回归量

转载 作者:行者123 更新时间:2023-12-04 08:03:53 24 4
gpt4 key购买 nike

冒号 : 是什么意思在两个字符之间?我确定这不是从角色 A 到角色 B 说的。

这是代码:

fit9=lm(Sales~.+Income:Advertising+Price:Age,data=Carseats)

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.5755654 1.0087470 6.519 2.22e-10 ***
CompPrice 0.0929371 0.0041183 22.567 < 2e-16 ***
Income 0.0108940 0.0026044 4.183 3.57e-05 ***
Advertising 0.0702462 0.0226091 3.107 0.002030 **
Population 0.0001592 0.0003679 0.433 0.665330
Price -0.1008064 0.0074399 -13.549 < 2e-16 ***
ShelveLocGood 4.8486762 0.1528378 31.724 < 2e-16 ***
ShelveLocMedium 1.9532620 0.1257682 15.531 < 2e-16 ***
Age -0.0579466 0.0159506 -3.633 0.000318 ***
Education -0.0208525 0.0196131 -1.063 0.288361
UrbanYes 0.1401597 0.1124019 1.247 0.213171
USYes -0.1575571 0.1489234 -1.058 0.290729
Income:Advertising 0.0007510 0.0002784 2.698 0.007290 **
Price:Age 0.0001068 0.0001333 0.801 0.423812

我不明白为什么会有两个额外的回归量 Income:AdvertisingPrice:Age意思?

最佳答案

如上述评论中所述,:表示回归量之间的交互项。如果您想单独考虑每个回归量及其相互作用,那么您可以使用 x1*x2x1 + x2 + x1:x2 相同.

关于r - 在两个字符之间使用 "colon"作为 lm() 中的回归量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42998130/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com