Code:
qui reg y x1 x2 i.building_id if building_type==1 eststo m1 qui reg y x1 x2 i.building_id if building_type==2 eststo m2 suest m1 m2, vce(cluster building_id) test [m1]x1-[m2]x1==0
Code:
building_id: factor variable base category conflict
I understand that this error is reminding me to unify the base of the fixed effect and explicitly specify the base level.
However, the building_id uniquely identify each building, so this variable do not overlap for the Type 1 buildings and the Type 2 buildings. I suppose it is not possible to unify the base level for building_id in the two regressions.
I wonder if there is any alternative ways to compare the coefficients for x1 in the two regressions. Thank you.
in my case I had to remove the i.var to avoid the error and replace it with another FE
ReplyDeletecheck this link it may help
https://www.statalist.org/forums/forum/general-stata-discussion/general/1420040-factor-variable-base-category-conflict
Comparing Regression Coefficients Across Groups In Presence Of Fixed Effects With Suest >>>>> Download Now
ReplyDelete>>>>> Download Full
Comparing Regression Coefficients Across Groups In Presence Of Fixed Effects With Suest >>>>> Download LINK
>>>>> Download Now
Comparing Regression Coefficients Across Groups In Presence Of Fixed Effects With Suest >>>>> Download Full
>>>>> Download LINK