*! version 2.0 dgc/mh Sep 1997 STB-41 ssa10.1 *! this an st wrapper for dymh program define stmh version 5.0 st_is local varlist "req ex min(1)" local if "opt" local in "opt" local options "FCodes(string) *" parse "`*'" st_show if "`fcodes'"!="" { di di in gr " failure codes: " in ye "`fcodes'" } local f : char _dta[st_d] local t : char _dta[st_t] local t0 : char _dta[st_t0] local aw : char _dta[st_w] local ttype : type `t' local ftype : type `f' tempvar d y if "`fcodes'"=="" { gen byte `d' = (`f'!=0) } else { gen `ftype' `d' = `f' qui recode `d' `fcodes' = 1 * = 0 qui recast byte `d' } gen `ttype' `y' = `t' if "`t0'"!="" { qui replace `y' = `y' - `t0' } dymh `d' `varlist' `if' `in' `aw', e(`y') `options' end