*! verson 1.0.1 03/16/93 STB-12 sbe2.1 program define bailey version 3.0 local options "Dead(string) MAXiter(string) REscale Autofix(string) RHOmax(string) LAMbda(string) Interva(string) FXAlpha(string) FXGamma(string) FXDelta(string) SVAlpha(string) SVGamma(string) SVDelta(string) *" local varlist "req ex" local if "opt" local in "opt" local weight "aweight fweight" parse "`*'" parse "`varlist'", parse(" ") gen float _wt = 1 `if' `in' if ("`exp'"!="") { replace _wt `exp' `if' `in'} if ("`maxiter'"!="") { local options "`options' maxiter=`maxiter'" } if ("`autofix'"!="") { local options "`options' autofix=`autofix'" } if ("`rhomax'"!="") { local options "`options' rhomax=`rhomax'" } if ("`lambda'"!="") { mac def options "`options' lambda=`lambda'" } if ("`dead'"=="") { gen byte _dead=1 local dead "_dead" } if ("`interva'"=="") { local interva = 1 } cap confirm var interva if (_rc) { gen _interva = `interva' local interva "_interva" } quietly save _bailey, replace capture { !echo options altquote weight=_wt `options' ; > _parmfil !echo stata #_bailey.dta#; >> _parmfil !echo depend `1' `dead' `interva' ; >> _parmfil mac shift * What if its too long? !echo logfile #_stata.log#; >> _parmfil !echo varlist `*'; >> _parmfil !echo output #_bailey.mta#; >> _parmfil !echo sv_alpha `svalpha' ; >> _parmfil !echo sv_gamma `svgamma' ; >> _parmfil !echo sv_delta `svdelta' ; >> _parmfil !echo fx_alpha `fxalpha' ; >> _parmfil !echo fx_gamma `fxgamma' ; >> _parmfil !echo fx_delta `fxdelta' ; >> _parmfil !bailey _parmfil } type _stata.log mac def _rc = _rc cap drop _wt cap drop _dead cap drop _interva exit `rc' end