操作员+ *和:在GLS功能中执行
我的代码看起来像这样:
Endo.v.Mass_Extant_Stages<-gls(log.Endo~log.Mb+Stage, data = CrocOntogenyData)
我的结果根据我使用的是 +,*或:在log.mb(连续)和阶段(分类)之间更改。有人真的知道这些运营商在做什么吗?我似乎找不到任何东西。
My code looks like this:
Endo.v.Mass_Extant_Stages<-gls(log.Endo~log.Mb+Stage, data = CrocOntogenyData)
My results change based on whether I'm using a +,*, or : between log.Mb (continuous) and Stage (categorical). Does anyone actually know what these operators are doing? I can't seem to find anything on it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
R中的模型具有描述的特殊语法在这里/a>(您还可以在R中键入
help(公式)
)。它们不仅在GLS函数中使用(例如,lm
也使用它们)。z〜x + y
对于每个X和Y值的数学公式“ z = ax + by + c”,对于某些常数a,b,c。z〜x * y
对每个X和Y值的数学公式“ z = ax + by + cxy + d”,对于某些常数a,b,c,d。z〜x / y < / code>对于每个X和Y值的数学公式“ z = ax + bxy + c”,对于某些常数a,b,c。
z〜x:y
对每个常数a的数学公式“ z = axy”。请参阅此堆栈交换发布有关更多信息
Models in R have a special syntax described here (you can also type
help(formula)
into R). They aren't only used in the gls function (lm
also uses them, for instance).Z ~ x + y
corresponds to the mathematical formula "z = ax + by + c" for every x and y value, for some constants a, b, c.Z ~ x * y
corresponds to the mathematical formula "z = ax + by + cxy + d" for every x and y value, for some constants a, b, c, d.Z ~ x / y
corresponds to the mathematical formula "z = ax + bxy + c" for every x and y value, for some constants a, b, c.Z ~ x:y
corresponds to the mathematical formula "z = axy" for every x and y value, for some constant a.See this Stack Exchange post for more information