With the linear model function lm() polynomial formulas can contain a shortcut notation like this:
m <- lm(y ~ poly(x,3))
this is a shortcut that keeps the user from having to create x^2 and x^3 variables or typing them in the formula like I(x^2) + I(x^3)
. Is there comparable notation for the nonlinear function nls()
?