I am planning to post some code, intended to speed up the fixed cost for people interested in bringing theory into data. For other nice places where to get useful code, do visit Judson Caskey's (UCLA) website and Ian Gow's (Harvard) website.
In the ZIP file below, you will find a flexible implementation of GMM, which computes estimates, standard-errors and J tests as a function of user-supplied moments conditions. It runs on Matlab and is an alternative to canned GMM implementations (which I find counter-intuitive). As compared to what you will find on Stata, this implementation allows the user to easily choose which parameter to estimate, bounds for those parameters, choose moments to use, or choose whether to estimate by firm or over a pooled sample. The zip file contains an example which is used to estimate the Dye-Jung-Kwon voluntary disclosure, but it can be tailored to any problem.
Portable GMM, in Matlab.
For those who are interested in getting started with Matlab, I strongly recommend the first six sessions entirely sufficient course on Youtube: here. This will get you started with everything you need to know with only one hour of your time.
Also, if you are interested in Management Forecasts and, more specifically, cleaning Management Forecast data and merging it to Compustat, please find the following code. Note that running the code will require you to obtain the relevant .csv file from WRDS (the required items are self-explanatory). The code includes permno to merge with CRSP if needed and has been updated to 6/25/2018 link file between IBES and CRSP, and CRSP and Compustat. Comments welcome!