It could be correct to combine lags and interaction terms, there is certainly no a priori reason why this would always be wrong.
My guess is that StataCorp did not implement the combination of factor variables and time series operators in the graphical user interface in order to make the interface easier to use. The logic being that combining the two would make the menu a lot more complicated and the combination of the two would be just too rare to be worth the possible confusion.
As you noticed, you can easily type the commands and that way combine the factor variable and time series operators.
Suppose you have two continuous regressors (weight and miles per gallon) and one binary regressor (foreign manufacturer). The outcome is car price and you are interested in the effect of weight on price. You can get a sense of the interactions like this:
sysuse auto
reg price c.mpg##c.weight##i.foreign
margins, dydx(weight) at(foreign = (0 1) mpg =(10(10)40) weight = (2000(1000)3000))
marginsplot, bydimension(foreign weight)
Note that you can calculate interactions on the fly using factor variable notation. This ensures that Stata understands how all the variables are related in calculating derivative.
The expected price is
$$E[p \vert w,m,f]=\beta_0 + \beta_1 w + \beta_2 m + \beta_3 f +\beta_4 w\cdot m+\beta_5 w \cdot f +\beta_6m\cdot f + \beta_7 w\cdot m \cdot f$$
The derivative with respect to weight (aka the conditional marginal effect of weight) is
$$\frac{\partial E[p \vert w,m,f]}{\partial w}= \beta_1 + \beta_4 m+\beta_5 \cdot f + \beta_7 m \cdot f,$$
which is a linear function of foreign and mpg.
The margins command calculates this derivative evaluated at various combinations of foreign and mpg that I have selected, and marginsplot produces a graph of the derivative of the expected price with respect to weight for light and heavy domestic and foreign cars at various values of mileage. You could also have other regressors in the model, in which case the marginal effect would average over their effects:
![enter image description here](https://i.stack.imgur.com/9jGal.jpg)
For instance, let's look at the first panel. For a very efficient light domestic car, an additional pound has negligible effect on the price. For an inefficient one, it adds $6.50 to the price tag.
If you are interested in formally testing that these derivatives are different at various values of mpg, you can calculate contrasts of margins like this:
margins r.foreign, dydx(weight) at(mpg = (10(10)40))
marginsplot
This tests the null that the derivative of expected price with respect to weight is the same for foreign and domestic casts at various values of mpg. It also gives you an overall test that all four differences are jointly zero. It probably makes sense to make some adjustment for multiple comparisons, though I have not done that here.
A really nice introduction to these commands is Michael N. Mitchell's
Interpreting and Visualizing Regression Models Using Stata. Chapter 13 deals with continuous by continuous by categorical interactions.
Best Answer
This is a question which appears sometimes in the Statalist. Let me write $x_{1}$ and $x_{2}$ instead of $x$ and $z$ (in the literature $z$ is usually reserved for instruments rather than endogenous variables) and let $x_3 = x_1 \cdot x_2$. Your model then becomes: $$y = ax_1 + bx_2 + cx_3 + e$$ which has three endogenous variables. Assuming that you have two variables $z_1$ and $z_2$ which are valid instruments for $x_1$ and $x_2$, then a valid instrument for $x_3$ is $z_3 = z_1 \cdot z_2$. In Stata it is straightforward to generate the corresponding interactions and to use them in the appropriate estimation command like
ivreg2
, for instance.Note though that models with more than one endogenous variable can be difficult to interpret and also you might be confronted with the question why you are tackling two causal questions at the same time. This issue is discussed on the Mostly Harmless Econometrics blog by Angrist and Pischke.
Your second problem is similar for the case where you interact an endogenous ($x$) and an exogenous variable ($w$) in a model of the type $$y = ax + bw + c(x\cdot w) + e$$ If $z$ is a valid instrument for $x$, then a valid instrument for $(x\cdot w)$ is $(z\cdot w)$. This procedure was suggested in the Statalist. I just provide one link but there are many more discussions about this (most of which will pop up on Google when searching for: interaction of "two endogenous variables").