{smcl} {com}{sf}{ul off}{txt}{.-} log: {res}C:\Documents and Settings\jli2\My Documents\Log\MLE_log\logit_158.smcl {txt}log type: {res}smcl {txt}opened on: {res}29 Sep 2004, 18:58:24 {txt} {com}. use http://fmwww.bc.edu/ec-p/data/wooldridge/BWGHT {txt} {com}. * generate dummy variable "smokes"=1 if smoking during pregnance . gen smokes = cigs>0 {txt} {com}. * run the canned routin "logit" . logit smokes motheduc white lfaminc {txt}Iteration 0: log likelihood = {res}-593.10529 {txt}Iteration 1: log likelihood = {res} -551.1645 {txt}Iteration 2: log likelihood = {res}-548.74295 {txt}Iteration 3: log likelihood = {res}-548.73367 {txt}Iteration 4: log likelihood = {res}-548.73367 {txt}Logit estimates Number of obs = {res} 1387 {txt}LR chi2({res}3{txt}) = {res} 88.74 {txt}Prob > chi2 = {res} 0.0000 {txt}Log likelihood = {res}-548.73367 {txt}Pseudo R2 = {res} 0.0748 {txt}{hline 13}{c TT}{hline 64} smokes {c |} Coef. Std. Err. z P>|z| [95% Conf. Interval] {hline 13}{c +}{hline 64} motheduc {c |} {res}-.2518731 .0372045 -6.77 0.000 -.3247925 -.1789536 {txt}white {c |} {res} .3438842 .2002178 1.72 0.086 -.0485355 .7363038 {txt}lfaminc {c |} {res}-.2962299 .0866347 -3.42 0.001 -.4660309 -.126429 {txt}_cons {c |} {res} 2.012535 .4474219 4.50 0.000 1.135604 2.889466 {txt}{hline 13}{c BT}{hline 64} {com}. * user-defined MLE procedure . program define logit_158 {err}logit_158 already defined {txt}{search r(110):r(110);} {com}. program drop _all {txt} {com}. program define logit_158 {txt} 1{com}. args lnf theta {txt} 2{com}. quietly replace `lnf' =ln(exp(`theta')/(1+exp(`theta'))) if $ML_y1==1 {txt} 3{com}. quietly replace `lnf' =ln(1-exp(`theta')/(1+exp(`theta'))) if $ML_y1==0 {txt} 4{com}. end {txt} {com}. ml model lf logit_158 ( smokes= motheduc white lfaminc) {txt} {com}. ml maximize {txt}initial: log likelihood = {res}-961.39514 {txt}alternative: log likelihood = {res}-763.54478 {txt}rescale: log likelihood = {res}-600.04915 {txt}Iteration 0: log likelihood = {res}-600.04915{txt} Iteration 1: log likelihood = {res} -556.4819{txt} Iteration 2: log likelihood = {res}-548.75296{txt} Iteration 3: log likelihood = {res}-548.73367{txt} Iteration 4: log likelihood = {res}-548.73367{txt} {col 51}Number of obs{col 67}= {res} 1387 {col 51}{txt}Wald chi2({res}3{txt}){col 67}= {res} 78.42 {txt}Log likelihood = {res}-548.73367{col 51}{txt}Prob > chi2{col 67}= {res} 0.0000 {txt}{hline 13}{c TT}{hline 64} smokes {c |} Coef. Std. Err. z P>|z| [95% Conf. Interval] {hline 13}{c +}{hline 64} motheduc {c |} {res}-.2518731 .0372045 -6.77 0.000 -.3247925 -.1789536 {txt}white {c |} {res} .3438842 .2002178 1.72 0.086 -.0485355 .7363038 {txt}lfaminc {c |} {res}-.2962299 .0866347 -3.42 0.001 -.4660309 -.126429 {txt}_cons {c |} {res} 2.012535 .4474219 4.50 0.000 1.135604 2.889466 {txt}{hline 13}{c BT}{hline 64} {com}. log close {txt}log: {res}C:\Documents and Settings\jli2\My Documents\Log\MLE_log\logit_158.smcl {txt}log type: {res}smcl {txt}closed on: {res}29 Sep 2004, 19:01:44 {txt}{.-} {smcl} {txt}{sf}{ul off}