Hello Statalist! I'm doing the project about UIP(uncovered interest rate parity) and illiquidity risk and using fiscal shock as illiquidity's the instrument variable. Thus, I ran a TSLS regressions using STATA.

The data I process is the unbalanced data with id (countrypair group for exchange rate, 6 groups in total) and ym(year, month) where year from 2000-2015, but some from 2003-2015.
xtset id ym
panel variable: id (unbalanced)
time variable: ym, 480 to 690
delta: 1 unit

My regressions are shown as the following:
1st: xtreg illiquidity TFWDVP_SA l.abslibor bas i.ym, fe vce(robust)
2nd: xtivreg absy l.abslibor_1m bas i.ym (illiquidity=TFWDVP_SA i.ym), fe vce(robust)


whereTFWDVP_SA is the fiscal shock which is time series data, that is, for different countrypair at t they are invariant.
abslibor is a monthly libor rate; absy is the absolute value of return; bas is the bid-ask spread; i.ym is the time-fixed effect.

My question is:
If I put "i.ym" inside the parenthesis like: xtivreg absy l.abslibor_1m bas (illiquidity=TFWDVP_SA i.ym), fe vce(robust) , it will generate a different 1st stage result for the coefficient on illiquidity compared with putting "i.ym" outside of the parenthesis like: xtivreg absy l.abslibor_1m bas i.ym (illiquidity=TFWDVP_SA), fe vce(robust).

In addition, as shown in the attached pictures, xtivreg absy l.abslibor_1m bas (illiquidity=TFWDVP_SA i.ym), fe vce(robust) can get a significant coefficient for "illiquidity"; However, xtivreg absy l.abslibor_1m bas i.ym (illiquidity=TFWDVP_SA), fe vce(robust) get a "0" for "illiquidity" with omitted STD error.

I am confused about the results and why i.ym will lead to different results for inside and outside of the parenthesis. Is there a bug in Stata for causing this issue or other data issue?

Hope you can help me fix this problem. Thank you so much.