Hi,
I am a master student and I have a problem with my econometric model. I need to run a GMM model, but I can't understand when a variables is endogenous or exogenous.

My model is the following:

xtabond2 nim l.nim nsfr iir credit_risk size risk_avers oper_cost mng_qual bus_mod iip ocr lerner gdp inflation slope neg_ir_dum adj_nsfr_dum t_dum*, ///
gmm(nim, collapse) iv(nsfr iir credit_risk size risk_avers oper_cost mng_qual bus_mod iip ocr lerner gdp inflation slope neg_ir_dum adj_nsfr_dum t_dum*) nodiffsargan twostep robust orthogonal small

Could someone help me to decide if my variables are endogenous (to put in gmm()) or exogenous (to put in iv()), please?

If it is possible, I would to know if my model is well specified.

Thank you so much!