#delimit; clear; set more off; capture log close; log using Table4.log, replace; /*RE-EMPLOYMENT HAZARD, TABLE 4*/; use J:\public_html\Data\NetSearch\udur.dta; **** CREATE LOWER BOUND VARIABLE ****; gen lower=0; replace lower=0 if [dur2<1]; replace lower=1 if [dur2>=1&dur2<2]; replace lower=2 if [dur2>=2&dur2<3]; replace lower=3 if [dur2>=3&dur2<10]; replace lower=4 if [dur2>=10&dur2<11]; replace lower=5 if [dur2>=11&dur2<12]; replace lower=6 if [dur2>=12&dur2<13]; replace lower=7 if [dur2>=13]; ******** CREATE UPPER BOUND VARIABLE ********; gen upper=0; replace upper=1 if [dur3>0&dur3<=1]; replace upper=2 if [dur3>1&dur3<=2]; replace upper=3 if [dur3>2&dur3<=3]; replace upper=4 if [dur3>3&dur3<=10]; replace upper=5 if [dur3>10&dur3<=11]; replace upper=6 if [dur3>11&dur3<=12]; replace upper=7 if [dur3>12&dur3<=13]; replace upper=8 if [dur3>13]; ******** EVALUATOR FUNCTION *********; ***NOTE THIS FUNCTION ESTIMATES *MINUS* THE EFFECT OF X's ON THE HAZARD; ***COEFFICIENTS REPORTED IN THE PAPER ARE OPPOSITE IN SIGN TO THESE***; capture program drop unihaha; program define unihaha; args lnf theta1 theta2 theta3 theta4 theta5 theta6 theta7 theta8; tempvar Philow Phiupp; qui gen double `Philow' = 0; qui gen double `Phiupp' = 0; local i = 1; while `i' <= 7 {; qui replace `Philow' = exp(-exp(-(`theta`i''-`theta8'))) if [lower==`i']; qui replace `Phiupp' = exp(-exp(-(`theta`i''-`theta8'))) if [upper==`i']; local i = `i' + 1; }; qui replace `Philow' = 0 if [lower==0]; qui replace `Phiupp' = 1 if [upper==8]; qui replace `lnf' = log(`Phiupp' - `Philow'); end; *COLUMN ONE:; ml model lf unihaha (cut1:) (cut2:) (cut3:) (cut4:) (cut5:) (cut6:) (cut7:) (covriats:anylook dur1 sup00 onlayoff stateur occupur preuwork preuscul lostjob tempjob private public selfemp age1625 age2635 age3645 age4655 male married maridman spem primscul nohiscul hiscul nocolege asdegree black hispanic homeownr imigrant, noconstant); ml init cut1:_cons=0.7198 cut2:_cons=1.2004 cut3:_cons=1.5061 cut4:_cons=3.2060 cut5:_cons=3.5114 cut6:_cons=3.8179 cut7:_cons=4.0317; ml maximize; *COLUMN TWO:; ml model lf unihaha (cut1:) (cut2:) (cut3:) (cut4:) (cut5:) (cut6:) (cut7:) (covriats:anylook dur1 sup00 onlayoff stateur occupur preuwork preuscul lostjob tempjob private public selfemp age1625 age2635 age3645 age4655 male married maridman spem primscul nohiscul hiscul nocolege asdegree black hispanic homeownr imigrant iacc, noconstant); ml init cut1:_cons=0.7198 cut2:_cons=1.2004 cut3:_cons=1.5061 cut4:_cons=3.2060 cut5:_cons=3.5114 cut6:_cons=3.8179 cut7:_cons=4.0317; ml maximize; *COLUMN 3:; ml model lf unihaha (cut1:) (cut2:) (cut3:) (cut4:) (cut5:) (cut6:) (cut7:) (covriats:anylook dur1 sup00 onlayoff stateur occupur preuwork preuscul lostjob tempjob private public selfemp age1625 age2635 age3645 age4655 male married maridman spem primscul nohiscul hiscul nocolege asdegree black hispanic homeownr imigrant cofi copu copr cofr cosc sent chec uads otac, noconstant); ml init cut1:_cons=0.7198 cut2:_cons=1.2004 cut3:_cons=1.5061 cut4:_cons=3.2060 cut5:_cons=3.5114 cut6:_cons=3.8179 cut7:_cons=4.0317; ml maximize; *COLUMN 4:; ml model lf unihaha (cut1:) (cut2:) (cut3:) (cut4:) (cut5:) (cut6:) (cut7:) (covriats:anylook dur1 sup00 onlayoff stateur occupur preuwork preuscul lostjob tempjob private public selfemp age1625 age2635 age3645 age4655 male married maridman spem primscul nohiscul hiscul nocolege asdegree black hispanic homeownr imigrant cofi copu copr cofr cosc sent chec uads otac iacc, noconstant); ml init cut1:_cons=0.7198 cut2:_cons=1.2004 cut3:_cons=1.5061 cut4:_cons=3.2060 cut5:_cons=3.5114 cut6:_cons=3.8179 cut7:_cons=4.0317; ml maximize;