lm(y ~ x/z, data)
is just a shortcut for lm(y ~ x + x:z, data)
These two give the same results:
lm(mpg ~ disp/hp,data = mtcars)
Call:
lm(formula = mpg ~ disp/hp, data = df)
Coefficients:
(Intercept) disp disp:hp
2.932e+01 -3.751e-02 -1.433e-05
lm(mpg ~ disp + disp:hp, data = mtcars)
Call:
lm(formula = mpg ~ disp + disp:hp, data = mtcars)
Coefficients:
(Intercept) disp disp:hp
2.932e+01 -3.751e-02 -1.433e-05
So, what your doing is modelling mpg
based on disp
alone and on an interaction between disp
and hp
.