Hi - I am using a panel dataset of US companies for the years 2000-19 (US Industrials - Worldscope). My analysis is focused on determining the relationship between lagged value of geographic segment diversification (l1.Ln_GSD) and firm performance (ROA.) I have used fixed effect analysis and arrived at the conclusion that GSD and ROA have an inverted-U relationship. The command I used was (my dependent variable and explanatory variable are highlighted in RED):

Code:
. xtreg Ln_EBIT_ROA Ln_Revenue Ln_LTD_to_Sales Ln_Intangible_Assets  CoAge wGDPpc wCPI wDCF wExpg
> r wGDPgr wCons Ln_PS_RD c.l1.Ln_GSD##c.l1.Ln_GSD if  CoAge>=0 & NATION=="UNITED STATES" & NATIO
> NCODE==840 & FSTS>=10 & GENERALINDUSTRYCLASSIFICATION ==1 & Year_<2020 & Year_<YearInactive & D
> iscr_GS_Rev!=1, fe cluster(n_CUSIP)
I would like to use an instrumental variable to check for endogeneity. I am considering using firm attractiveness to GSD as the instrument. The following xtivreg command seems to work. However, I am not sure how to integrate my squared term (c.l1.Ln_GSD##c.l1.Ln_GSD) and the cluster error into xtivreg.

Code:
. xtivreg Ln_EBIT_ROA Ln_Revenue Ln_LTD_to_Sales Ln_Intangible_Assets  CoAge wGDPpc wCPI wDCF wEx
> pgr wGDPgr wCons Ln_PS_RD (l1.Ln_GSD=l1.Ln_Indgrp_GSD_by_Year) if  CoAge>=0 & NATION=="UNITED S
> TATES" & NATIONCODE==840 & FSTS>=10 & GENERALINDUSTRYCLASSIFICATION ==1 & Year_<2020 & Year_<Ye
> arInactive & Discr_GS_Rev!=1, fe
Any guidance on this would be very helpful. (I am new to using instrumental variables and hence I do realize that my question may be very basic.) Thank you.