In formulas, the term ^2
is used to create interactions of variables. For example, (x+y+z)^2
creates the main effects and all possible interactions with two variables, i.e., x + y + z + x:y + x:z + y:z
. Hence, x^2
inside a formula is the same as x
.
Furthermore, also *
is used to create interactions, For example, x*y
creates x + y + x:y
. Hence, x*x
inside a formula is the same as x
.
To create the squared value inside a formula, you have to use the function I
, i.e., I(x^2)
or I(x*x)
.
lme(asinh(gallons) ~ asinh(rprc) + asinh(rexp) +
I(asinh(rexp)^2) + I(asinh(rprc)^2) + asinh(rprc)*asinh(rexp),
random=~1|cuid, data = data)