Hi guys!

I'm using 2SLS on Panel Data, however when I calculate 2SLS manually, I mean, by doing:

First Stage:
reg x1 x2 z1 z2, robust
predict x1_hat

Second Stage:
reg y x1_hat x2

I am not sure if these are the right commands, do I need to use xtreg on the same steps instead of using just reg? Because when I use the command:

ivreg2 y x2 (x1=z1 z2), robust

I am not getting the same coefficients as the manual method, so that's why I am not sure of what method I should use. I was thinking of using xtivreg2, but I am not sure.

What do you think?

PS: I am not using fixed effects