Hi everyone, R user switching to STATA for replicaiton purposes here. Apologies in advance if my questions are rudimentary or the problem of Syntax.
Essentially, I am running a Poisson Pseudo Maximum Likelihood regression with three types of fixed effects (provincial, country, and year) while clustering my standard errors at the country level. The problem I have is that the poi2hdfe code only allows for 2 high dimensional fixed effects (HDFEs) but the paper I am replicating managed to do it but their codes were not posted by the journal. What I have worked but wanted to confirm with more experienced STATA users my approach is correct.
I have tried keep country year as the two HDFEs and including the regions as factor variables but it returned an error:
poi2hdfe Aid Explanator i.Regions, id1(Country) id2(Year) cluster(Country)
factor-variable and time-series operators not allowed
r(101);
Then I tried combining country (as a long variable) and Year (float) into 1 variable before running it as 1 fixed effect dimension:
gen Country*Year=Country*Year
poi2hdfe Aid Explanator, id1(Country_Year) id2(Regions) cluster(Country)
This worked, but when i viewed the Country*Year variable, only the year was visible (i.e. Cambodia*2007 was just "2007" in the new variable). I am worried if it just gave me the results for year in the end.
Any advice would be much appreciated.
Thank you!
Nathan
0 Response to Using poi2hdfe to account for both country-year and regional fixed effects
Post a Comment