Hello,
I would like to estimate the following 2SLS panel regression:

First stage: Zit = α Wit*Fit + γ Fit + ki + mt + uit

Second stage: Yit = β Z(hat)it + δ Fit + ki + mt + eit

where Z(hat) is the predicted Zhat.


I am using Stata 15.1.
My first thought is to use xtivreg2, like that:

Code:
gen wf = w*f // create the interaction variable
xi: xtivreg2 y (z = wf f) f i.year, first fe ro
however, my concern is that by using the above command I am not take into account the predicted value of Z (Zhat) of the second stage.

Could you please give some advices...
Thanks a lot,
John.