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
Related Posts with Using poi2hdfe to account for both country-year and regional fixed effects
How to calculate the weakest link from a matrix?Dear Statalisters: I hope you are doing well. I am trying to calculate the weakest link from a sampl…
Regressions with lagged structure using loop commandHi everyone, I have run the following regressions using the loop command which works just fine: C…
about margins for simple slopeI use STATA 14. When I use the margins to obtain simple slopes, it reports t values instead of z val…
Star option (for significance) for Pearson / Spearman correlation matrix (corsp)Dear Statalist members, I want to display the Pearson correlation coefficients and the Spearman ran…
Multilevel model error with covariance (unstructured) - Hessian is not negative semidefinite conformability errorI'm testing a multilevel model with random slopes and a covariance structure for the error and reml …
Subscribe to:
Post Comments (Atom)
0 Response to Using poi2hdfe to account for both country-year and regional fixed effects
Post a Comment