Check whether variable exists in if-conditions

In some applications, e.g. if you want to save coefficient estimates from a regression with many dummies (e.g. fixed effects), you might want to store coefficients as estimates. In this example, we are interested in storing the estimates of the GROUPVAR dummies, but not the dummies of OTHERVAR. While this is usually straightforward by writing

Continue reading

Robust Hausman test for FE vs RE

For quite a while I was writing a program to perform a Hausman test to compare Fixed vs Random Effects in Stata when the estimates were calculated using cluster-robust standard errors, since in this case the usual Hausman test is not suitable. Just when I was about to finish with it, I found out that there is already a user-written program that does this and several other tests that fall into the “overidentifying restrictions” class for panel models. The command name is xtoverid and it can be very useful, especially if you are using panel IV methods or Hausman-Taylor models.


IMR based on Logit FE

This is a way to calculate a logistic Inverse Mills ratio.

The logistic IMR has some benefits when estimating a model (including correction for selection) on panel data. Because of the incidental parameter problem, it is not possible to estimate Probit FE. Hence, many researchers use a Probit RE model for the selection equation and then estimate the main FE model including the retrieved IMR. A problem which this approach is that the assumptions made are usually not plausible (differences in the correlation between regressors and the unobserved heterogeneity terms in the selection equation and the equation of interest). Continue reading

Table of descriptives

Posted by Didier

This illustrates ways to make a tables of descriptives (mean or something else) for many variables (say wage, tenure, education, …) and several groups (say males and female). Neither summarize or tabstat are useful if the variables are many. With summarize, you would need to cut, paste and edit the output in e.g. Excel. With tabstat, the tabel would be too wide. Continue reading