The difference between ":" and "|" in linear linear modeling

When building a linear model in R, what is the difference between the following two statements:

lm(y ~ x | z)
lm(y ~ x : z)

Function documentation is documented by the operator as follows: lm:

First, the specification of the form: the second indicates a set of terms obtained during the first interaction of all members with all members in the second.

There is no mention of syntax |on this page. What is the difference?

+5
source share
1 answer

:used for interaction. In your example, the lm(y ~ x : z)formula means that "y depends on the effect of the interaction between xand z.

, , x z. x * z x + x:z + z.

AFAIK, | lm. , , demo("lm.glm", "stats"). nlme.

?intervals.lme:

model <- lme(distance ~ age, Orthodont, random = ~ age | Subject)
ranef(model)

| "group by". . ( ranef(model), , ().)

+8

All Articles