Dear Statalists,

for my thesis, I want to perform a Poisson IV with fixed effects on a panel data set (See dataex code in the next comment for excerpt. Whole dataset comprises 4,410 obs., N=105 counties, T=42, dependent variable =count, endogenous variable= continuous). As the command ivpoisson is invalid with fixed effect dummies, I wanted to apply a control function approach. Hereby, I include a prediction of the first stage residual into the second stage and add fixed effects dummies manually.
My code for the first stage is:
Code:
reg licenses_per1000 instrument percent_unemp income_1000 divorcerate percent_male percent_white percent_age1 percent_age2 urban_rural i.countycode i.year i.countycode##c.year [pweight= population], vce(cluster countycode )
Code:
predict uhat, residuals
And the second stage:
Code:
poisson suicides licenses_per1000 uhat percent_unemp income_1000 divorcerate percent_male percent_white percent_age1 percent_age2 urban_rural i.countycode i.year i.countycode##c.year [pweight= population ], vce(cluster population )
I'm worried now that the codes for the control function approach are incorrect. Just for comparison, I perfomed the control function without FE dummies with the command "ivpoisson cfunction" and also performed the two stages described above without FE dummies. Both commands produced different results, especially concerning the significance of the variables.
Does this imply that my contol function approach is wrong? I can't see any failure in the construction.
I am grateful for any advice.
Kind regards
Joana