I am now trying to implement xtabond2 for my panel data set spanning from 1998 to 2020. The issue that I have regarding xtabond2 routine is whether I need to include all the independent variables (including time dummies) into either "iv" or "gmm" part. To be specific, let's say that I have one dependent variable and four independent (three endogenous and one exogeneous) and time dummies for 5 years. Then, the usual xtabond2 command should be as follows:

xtabond2 y L.y a b c d i.fyear, gmm(L.y a b c) iv(d i.fyear), robust twostep


But then my question is whether I can exclude some of the independent variables from "iv" or "gmm" part like:

xtabond2 y L.y a b c d i.fyear, gmm(L.y b c) iv(d), robust twostep


Thank you in advance and look forward to hearing from you soon.