{smcl} {com}{sf}{ul off}{txt}{.-} log: {res}C:\Documents and Settings\jli2\My Documents\Log\MLE_log\tobit_165.smcl {txt}log type: {res}smcl {txt}opened on: {res}29 Sep 2004, 20:09:46 {txt} {com}. * tobit model, see wooldridge page 546. exercise 16.5 . use http://fmwww.bc.edu/ec-p/data/wooldridge/FRINGE {txt} {com}. * run OLS regression . regress hrbens exper age educ tenure married male white nrtheast nrthcen south union {txt}Source {c |} SS df MS Number of obs ={res} 616 {txt}{hline 13}{char +}{hline 30} F( 11, 604) ={res} 32.50 {txt} Model {char |} {res} 101.132288 11 9.19384436 {txt}Prob > F = {res} 0.0000 {txt}Residual {char |} {res} 170.839786 604 .282847328 {txt}R-squared = {res} 0.3718 {txt}{hline 13}{char +}{hline 30} Adj R-squared = {res} 0.3604 {txt} Total {char |} {res} 271.972074 615 .442231015 {txt}Root MSE = {res} .53183 {txt}{hline 13}{c TT}{hline 64} hrbens {c |} Coef. Std. Err. t P>|t| [95% Conf. Interval] {hline 13}{char +}{hline 64} exper {c |} {res} .0029862 .0043435 0.69 0.492 -.005544 .0115164 {txt} age {c |} {res}-.0022495 .0041162 -0.55 0.585 -.0103333 .0058343 {txt} educ {c |} {res} .082204 .0083783 9.81 0.000 .0657498 .0986582 {txt} tenure {c |} {res} .0281931 .0035481 7.95 0.000 .021225 .0351612 {txt} married {c |} {res} .0899016 .0510187 1.76 0.079 -.010294 .1900971 {txt} male {c |} {res} .251898 .0523598 4.81 0.000 .1490686 .3547274 {txt} white {c |} {res} .098923 .0746602 1.32 0.186 -.0477021 .2455481 {txt} nrtheast {c |} {res}-.0834306 .0737578 -1.13 0.258 -.2282836 .0614223 {txt} nrthcen {c |} {res}-.0492621 .0678666 -0.73 0.468 -.1825451 .084021 {txt} south {c |} {res}-.0284978 .0673714 -0.42 0.672 -.1608084 .1038129 {txt} union {c |} {res} .3768401 .0499022 7.55 0.000 .2788372 .4748429 {txt} _cons {c |} {res}-.6999244 .1772515 -3.95 0.000 -1.048028 -.3518203 {txt}{hline 13}{c BT}{hline 64} {com}. * run canned "tobit" model . tobit hrbens exper age educ tenure married male white nrtheast nrthcen south union, ll {txt}Tobit estimates Number of obs = {res} 616 {txt}LR chi2({res}11{txt}) = {res} 283.86 {txt}Prob > chi2 = {res} 0.0000 {txt}Log likelihood = {res}-519.66616 {txt}Pseudo R2 = {res} 0.2145 {txt}{hline 13}{c TT}{hline 64} hrbens {c |} Coef. Std. Err. t P>|t| [95% Conf. Interval] {hline 13}{c +}{hline 64} exper {c |} {res} .0040631 .0046627 0.87 0.384 -.0050939 .0132201 {txt}age {c |} {res}-.0025859 .0044362 -0.58 0.560 -.0112981 .0061263 {txt}educ {c |} {res} .0869168 .0088168 9.86 0.000 .0696015 .1042321 {txt}tenure {c |} {res} .0287099 .0037237 7.71 0.000 .021397 .0360227 {txt}married {c |} {res} .1027574 .0538339 1.91 0.057 -.0029666 .2084814 {txt}male {c |} {res} .2556765 .0551672 4.63 0.000 .1473341 .364019 {txt}white {c |} {res} .0994408 .078604 1.27 0.206 -.054929 .2538105 {txt}nrtheast {c |} {res}-.0778461 .0775035 -1.00 0.316 -.2300547 .0743625 {txt}nrthcen {c |} {res}-.0489422 .0713965 -0.69 0.493 -.1891572 .0912729 {txt}south {c |} {res}-.0246854 .0709243 -0.35 0.728 -.1639731 .1146022 {txt}union {c |} {res} .4033519 .0522697 7.72 0.000 .3006999 .5060039 {txt}_cons {c |} {res}-.8137158 .1880725 -4.33 0.000 -1.18307 -.4443616 {txt}{hline 13}{c +}{hline 64} _se {c |} {res} .5551027 .0165773 {txt}(Ancillary parameter) {hline 13}{c BT}{hline 64} Obs. summary: {res} 41{txt} left-censored observations at hrbens<={res}0 575{txt} uncensored observations {com}. * the difference between tobit and OLS is small, why? . * user-defined MLE procedure . program drop _all {txt} {com}. program define tobit_165 {txt} 1{com}. args lnf theta1 theta2 {txt} 2{com}. quietly replace `lnf'=ln(norm(-`theta1'/sqrt(`theta2'))) if $ML_y1==0 {txt} 3{com}. quietly replace `lnf'=-0.5*ln(`theta2')-($ML_y1-`theta1')^2/(2*`theta2') if $ML_y1!=0 {txt} 4{com}. end {txt} {com}. ml model lf tobit_165 (hrbens = exper age educ tenure married male white nrtheast nrthcen south union) () {txt} {com}. ml maximize {txt}initial: log likelihood = {res} -{txt} (could not be evaluated) feasible: log likelihood = {res}-224.43978 {txt}rescale: log likelihood = {res}-193.47444 {txt}rescale eq: log likelihood = {res}-140.95815 {txt}Iteration 0: log likelihood = {res}-140.95815{txt} Iteration 1: log likelihood = {res}-40.265962{txt} Iteration 2: log likelihood = {res} 2.516603{txt} (not concave) Iteration 3: log likelihood = {res} 6.0557566{txt} (not concave) Iteration 4: log likelihood = {res} 7.9079098{txt} (not concave) Iteration 5: log likelihood = {res} 8.3157337{txt} Iteration 6: log likelihood = {res} 8.6986728{txt} Iteration 7: log likelihood = {res} 8.7234839{txt} Iteration 8: log likelihood = {res} 8.7234948{txt} Iteration 9: log likelihood = {res} 8.7234948{txt} {col 51}Number of obs{col 67}= {res} 616 {col 51}{txt}Wald chi2({res}11{txt}){col 67}= {res} 355.32 {txt}Log likelihood = {res} 8.7234948{col 51}{txt}Prob > chi2{col 67}= {res} 0.0000 {txt}{hline 13}{c TT}{hline 64} hrbens {c |} Coef. Std. Err. z P>|z| [95% Conf. Interval] {hline 13}{c +}{hline 64} {res}eq1 {txt}{c |} exper {c |} {res} .0040631 .0046628 0.87 0.384 -.0050758 .013202 {txt}age {c |} {res}-.0025859 .0044363 -0.58 0.560 -.0112809 .0061091 {txt}educ {c |} {res} .0869168 .008817 9.86 0.000 .0696357 .1041979 {txt}tenure {c |} {res} .0287099 .0037238 7.71 0.000 .0214114 .0360083 {txt}married {c |} {res} .1027574 .0538353 1.91 0.056 -.002758 .2082727 {txt}male {c |} {res} .2556765 .0551687 4.63 0.000 .1475479 .3638051 {txt}white {c |} {res} .0994408 .0786061 1.27 0.206 -.0546243 .2535058 {txt}nrtheast {c |} {res}-.0778461 .0775056 -1.00 0.315 -.2297543 .0740621 {txt}nrthcen {c |} {res}-.0489422 .0713984 -0.69 0.493 -.1888805 .0909961 {txt}south {c |} {res}-.0246854 .0709261 -0.35 0.728 -.1636981 .1143272 {txt}union {c |} {res} .4033519 .0522711 7.72 0.000 .3009025 .5058013 {txt}_cons {c |} {res}-.8137158 .1880775 -4.33 0.000 -1.182341 -.4450907 {txt}{hline 13}{c +}{hline 64} {res}eq2 {txt}{c |} _cons {c |} {res} .308139 .0184054 16.74 0.000 .2720651 .344213 {txt}{hline 13}{c BT}{hline 64} {com}. * we get the same result as that of canned command . log close {txt}log: {res}C:\Documents and Settings\jli2\My Documents\Log\MLE_log\tobit_165.smcl {txt}log type: {res}smcl {txt}closed on: {res}29 Sep 2004, 20:13:50 {txt}{.-} {smcl} {txt}{sf}{ul off}