Closed mcket747econ closed 11 months ago
I see you posted this to StackOverflow already (https://stackoverflow.com/q/76808363/4640346) and there is an answer on Stackoverflow already pointing to the warning message you receive in addition. I can second that this warning is to be addressed first to feed appropriate data into function plm()
and it is typically easier to create the `pdata.frame´ first.
The code you gave here diverges from the one on SO in at least two points:
++
) (this will not work)Closing this now due to assuming that treating the panel dimensions and formula correctly will show no error then. Feel free to re-open when a reproducible example can be supplied.
I am attempting to run the following IV regression on an unbalanced panel dataset. The variables TOTAL_E, TOURISM_5k_SUM and TOURISM_10K_SUM are endogenous, while HHSIZE2 and SEX are exogenous explanatory variables, and Z_b_100,tourism_5KM_ZSCORE and tourism_10KM_ZSCORE are instruments. I want to include household characteristics as controls in this regression. I do so and am also sure to include them in the formula with the IVS, but every time I still get the insufficient number of instruments error. I am using a random effects model since my instrument is time invariant so I don't believe that is the issue. Based on this question:https://stackoverflow.com/questions/56672684/error-insufficient-number-of-instruments-when-running-plm-iv-regression, I am supposed to have 2 instruments for every endogenous variable but that isn't possible in my case so I am a bit stuck. The regression runs fine in STATA. I will add the STATA output below. Any advice would be appreciated!