Wilkinson-Rogers to mathematical formula

This web page converts Wilkinson-Rogers notation (used by e.g. MATLAB and R for linear models) to a mathematical formula that can be used to calculate the interpolation in other languages, such as julia, C++ and MATLAB (for verification).
In MATLAB and R one can use for example respectively fitlm and lm to create a linear regression model.
Plaese notice that the order of the coefficients given by MATLAB and R differs from the order here (sorted alphabetically).

The symbol support is listed in the following table.

symbol example meaning
+ +x1 include this variable
- -x1 delete this variable
: x : z include the interaction between these variables
* x * z include these variables and all interactions between them
^ x^3 include interactions up to three way
1 - 1 the intercept (by default it is added)
Nesting, conditioning, grouping, error and multiple responses are not supported.