Open cacostame opened 6 years ago
Yes. That assert happens if for whatever reason there was a problem loading the data from Stata to Mata. In this case, Mata expected certain number of variables but received a different. Two options
1) Use reghdfe
s pool(#)
option, so that variables get loaded one at a time:
ivreghdfe price weight, a(turn, pool(1))
2) Absorb the year and mun_hq variables. Using your example:
ivreghdfe y (x=z) if hq==1, absorb(idfirm year mun_hq ) robust first
Doing this will not only be much faster, but is also likely to fix the problem (which might be caused by a huge number of regressors, if your mun_hq
variable has many categories.
Best, Sergio
Thank you Sergio for the solution. It fixed the problem.
Hi Sergio, Thank you very much for creating ivreghdfe.
To give you some context: I have a dataset containing firms, their establishments and their location. I have more or less 5000 firms and 12000 establishments, during more than 10 years and more than 50 municipalities. Currently, I am trying to run a regression at the headquarter (hq) level; something like
ivreghdfe y (x=z) i.year i.mun_hq if hq==1, absorb(idfirm) robust first
where mun_hq is a fixed effect indicating the municipality in which the firm's headquarter is located.
After running it I am getting the following message
(dropped 553 singleton observations) assert_msg(): 3498 cols(var)!=cols(y) FixedEffects::_partial_out(): - function returned error FixedEffects::partial_out(): - function returned error