Hello dear stata friends!
I am having some confusion regarding the implementation of my Individual-Fixed Effects IV Design in Stata. This might be a bit long-winded, but I really want to make myself clear on what I am trying to achieve, and where I am having issues/confusions. Thanks for your understanding!
Essentially, I am trying to estimate the short- mid- and long-term effects of X(retiring) on Y, using Z(reaching pension eligibility age) as an instrument for X.

Explanation:

Short- and long-term effects:
Short-term effects: The impact of retiring (X) between wave 1 and 2 on the changes in Y between wave 1 and 2
Mid-term effects: The impact of retiring (X) between wave 1 and 2 on the changes in Y between wave 2 and 3
Long-term effects: The Impact of retiring (X) between wave 1 and 2 on the changes in Y between wave 2 and 4

This is what I have done so far:
My data contains 4 waves of surveys.
  1. I have kept only those who are present in all survey waves: 61 084 observations in total i.e. 15 271 individuals per wave.
  2. I have created a treatment group which consists of people who reach/cross their state pension eligibility age between wave 1 and 2. The control group thus = individuals who do not reach pension eligibility age between wave 1 and 2.
  3. To allow the impact of age to differ on both sides of the eligiblity threshold used as instrument, I have centered age and its polynimials by substeacting the state pension age from the individuals age.
The relevant variables are named:
Outcome variable = Y
Retirement = Causal variable of interest = X
Reaching pension eligibility age = Instrument = Z
Centered age = CA
Centered age squared = CA2
Person identifier (string) = mergeid
Person identifier (de-stringed) = id
wave variable = wave
Country = country
Month of interview = int_month
Year of interview = int_year

I would now want to run my FE-IV model in a 2SLS estimation:

Long-term effects:
The Impact of retiring (X) between wave 1 and 2 on the changes in Y between wave 2 and 4
First-stage:
X𝑖𝑑
−2 = 𝛼 + 𝛽1Z𝑖𝑑−2 + 𝛽2CA𝑖𝑑−2 + 𝛽3CA𝑖𝑑−22 + 𝛽4Z𝑖𝑑−2(CA𝑖𝑑−2) +𝛽5Z𝑖𝑑−2(CA𝑖𝑑−22) + 𝛾𝑐(CA𝑖𝑑−2) + 𝛾𝑐(CA𝑖𝑑−22) + 𝛾𝑐[ Z𝑖𝑑−2(CA𝑖𝑑−2) ] + 𝛾𝑐[ Z𝑖𝑑−2(CA𝑖𝑑−22) ] + 𝛿𝑖 + πœ‡π‘‘ + πœšπ‘‘ + πœ€π‘–π‘‘
Second-stage:
Y𝑖𝑑 = 𝛼 + 𝛽1X_hat𝑖𝑑
−2 + 𝛽2CA𝑖𝑑−2 + 𝛽3CA𝑖𝑑−22 + 𝛽4Z𝑖𝑑−2(CA𝑖𝑑−2) +𝛽5Z𝑖𝑑−2(CA𝑖𝑑−22) + 𝛾𝑐(CA𝑖𝑑−2) + 𝛾𝑐(CA𝑖𝑑−22) + 𝛾𝑐[ Z𝑖𝑑−2(CA𝑖𝑑−2) ] + 𝛾𝑐[ Z𝑖𝑑−2(CA𝑖𝑑−22) ] + 𝛿𝑖 + πœ‡π‘‘ + πœšπ‘‘ + πœ€π‘–π‘‘
Where X_hat𝑖𝑑−2 is the predicted values of X𝑖𝑑−2 from the first stage with Z𝑖𝑑−2 as the excluded instrument. CA𝑖𝑑−2and CA𝑖𝑑−22 denote centered age and its square respectively. 𝛾𝑐 denote country dummies.𝛿𝑖 represents individual-fixed effects. πœ‡π‘‘ and πœšπ‘‘ represent separate year- and month fixed effects respectively.

In the model analysing the mid-term effects of X, I estimate the equations above but with all variables measured at t-1 instead of t-2.
In the model analysing the short-term effects of X, I estimate the equations above but with all variables measured at t instead of t-2

FINALLY - THE MAIN DILEMMA:
Since I am fairly new to Stata, I am not sure on how I should approach this in Stata language. I have dealt with basic fixed-effects models and basic IV models separately, however I hade never before combined them.
I have tried using the ivregress command:
Code:
ivregress estimator depvar [varlist1] (varlist2 = varlist_iv)
by trying to add the fe option.
I have also tried using the xtivreg command with the fe option:
Code:
xtivreg depvar [varlist1] (varlist2 =varlistiv), fe
However, I have not managed to obtain what I am explaining above by using any of these command.

By doing some research, I have read that various people who use multiple fixed effects in their models use the ivreghdfe command I suspect that this might be the one I am looking for. After numerous attemps, however, I cannot seem to figure it out. Therefore, I would greately appreciate it if any of you kind people who have the relevant experience could help me with this. If I forgot to provide some important information above, please let me know!

Many thanks in advance!

Best regards, Guri Gray