Full Stata plugin code included