Stata: Reghdfe and factor interactions

If you don’t know about the reghdfe function in Stata, you are likely missing out, especially if you run ‘high dimensional fixed effects’ models — i.e., your model includes 3+ dimensions of FE, perhaps 2 in time and 1 in space-time.  I’ve been encountering a situation which raises this unhelpful error message:

(null assertion)
Empty sample, check for missing values or an always-false if statement
r(2000);

This is problematic because for the particular data I’m working with (less than 50K obs.), a ‘reg’ command even on 24GB of RAM would take an hour+ to run. Using reghdfe (when it worked), would give the same results in less than 1 minute.

Possible explanation? Check to see whether the variable you’re clustering your standard errors on is a string.  If so, then use an egen/group command or convert your string to numeric and then retry — there’s a good chance it’ll work.  I suppose ‘reg’ allows us to be lazy with ‘vce(cluster <stringvar>)’, but ‘reghdfe’ [Homey] “don’t play that.”

 

 

5 responses to “Stata: Reghdfe and factor interactions

  1. Please tell me from where you captured this beautiful pic (one people working in rice crop field).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s