Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Maximum Likelihood


From   "Renzo Comolli" <[email protected]>
To   <[email protected]>
Subject   Re: st: Maximum Likelihood
Date   Fri, 2 May 2003 10:21:38 -0400

Dear Deborah,

I have done very little maximum likelyhood, so I am not sure I can help you
fully. There is something I can tell you for sure, though.
You cannot write
args Li x1 x2

You must write
args lnf theta1 theta2

And you must keep on doing so throughout the script.

I found the book
Maximum Likelihood Estimation with Stata by William Gould, William Sribney
to be extremely useful (it is written for version 6.0 but ML has changed
very little, if at all, since then)

Suggestion to Stata: I found the description of ML in the manuals base
reference (for version 7.0) too short. Just one little example, I could not
find reference to the issue mentioned here.

Best,
Renzo Comolli



-----Original Message-----
[only bits of the original message]

I am trying to use the maximum likelihood procedures in Stata and am getting
some bizarre results that suggest that I do not fully understand how the lnf
feature works. I'd be very grateful for some illumination.

thanks,
deborah.

------------------------------------
lf version, no constant option:
         program define ml_move;
  1.     args Li x1 x2;
  2.     quietly replace `Li' = ln( (1 - normprob(`x1' + `x2'))*probmax + (1
- normprob(`x2')*(1
> -probmax)) ) if $ML_y1==1;
  3.     quietly replace `Li' = ln( normprob(`x1' + `x2')*probmax +
normprob(`x2')*(1-probmax) )
>  if $ML_y1==0;
  4.     end;

.         ml model lf ml_move (leavejob = alt_ret pv_ira, nocons )
>                 (pension esitaxprice
>         jobtenure
>            esi         spesi
>            age35_45     age45_55
>            hispanic    black       race_oth
>            school_1-school_3       firm_x      firm24
>            firm25_99   occ_2-occ_7 occ_x ind_1-ind_4 ind_6 ind_x urban
union
>            hlth_x      hlth_gd     hlth_fp
>            logann          logtxinc
>            secondearn
>            kid  kid2
>            married         female  ira_x jobten_x
>            year84 year90 year96)
>                 [pweight=irawgt] if age1 >= 25 & age1 <= 55 ;

.         ml maximize;

initial:       log likelihood = -30971.235
alternative:   log likelihood = -21880.591
rescale:       log likelihood = -20492.416
rescale eq:    log likelihood = -20304.363
Iteration 0:   log likelihood = -20304.363
Iteration 1:   log likelihood =  -17187.65
Iteration 2:   log likelihood = -17036.272
Iteration 3:   log likelihood = -17034.944
Iteration 4:   log likelihood = -17034.944  (not concave)

                                                  Number of obs   =
53011
                                                  Wald chi2(0)    =
.
Log likelihood = -17034.944                       Prob > chi2     =
.

----------------------------------------------------------------------------
--
             |               Robust
    leavejob |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
eq1          |
     alt_ret |   815.4468          .        .       .            .
.
      pv_ira |    .000559          .        .       .            .
.
-------------+--------------------------------------------------------------
--
eq2          |
     pension |   .7307576   .0258399    28.28   0.000     .6801123
.781403
 esitaxprice |  -.0503448   .1366193    -0.37   0.712    -.3181137
.2174242
[OTHER VARIABLES SUPPRESSED]
       _cons |  -.6282337   .0767639    -8.18   0.000    -.7786882
-.4777793
----------------------------------------------------------------------------


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index