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

st: problems wih stata maximize


From   [email protected]
To   [email protected]
Subject   st: problems wih stata maximize
Date   Fri, 14 Feb 2003 13:44:44 +0100

Dear All

I have a question about maximize. If I type over the regression example in
the book about maximum likelihood of Stata (page 25) I will get a different
answer then using the inbuild function Reg in Stata. Below you can see the
outcome and programming of maximize and the outcome using reg. What do I do
wrong? I will program a complicated heckman model, but before I start I
want to know what I do wrong?

Regards,

Erik Brouwer


. program define myreg;
  1.         version 6;
  2.         args lnf theta1 theta2;
  3.         quietly replace `lnf'=ln(normd(($ML_y1-`theta1')/`theta2'))-ln
(`theta2');
  4. end;

. ml model lf myreg (employ96=patent96 partne96) ();

. **ml check;
. **ml init eq1:_cons=120 eq2:_cons=704;
. **ml init       66.48697        167.9247        119.9818   704.13,copy;
. ml maximize;

initial:       log likelihood =     -<inf>  (could not be evaluated)
feasible:      log likelihood = -34155.307
rescale:       log likelihood = -34155.307
rescale eq:    log likelihood = -31302.083
Iteration 0:   log likelihood = -31302.083
Iteration 1:   log likelihood = -30754.718
Iteration 2:   log likelihood = -30742.076
Iteration 3:   log likelihood =  -30741.23
Iteration 4:   log likelihood =  -30741.13  (backed up)
Iteration 5:   log likelihood = -30741.105  (backed up)
Iteration 6:   log likelihood = -30741.093  (backed up)
Iteration 7:   log likelihood = -30741.087  (backed up)
numerical derivatives are approximate
nearby values are missing
numerical derivatives are approximate
nearby values are missing
Iteration 8:   log likelihood = -30741.084  (backed up)

                                                  Number of obs   =
3853
                                                  Wald chi2(2)    =
35.58
Log likelihood = -30741.084                       Prob > chi2     =
0.0000

------------------------------------------------------------------------------
    employ96 |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
eq1          |
    patent96 |   54.18778   30.66349     1.77   0.077     -5.91155
114.2871
    partne96 |     136.86   26.63454     5.14   0.000     84.65728
189.0628
       _cons |   132.7101   14.99855     8.85   0.000     103.3135
162.1067
-------------+----------------------------------------------------------------
eq2          |
       _cons |   742.3306   9.178238    80.88   0.000     724.3416
760.3196
------------------------------------------------------------------------------

. reg employ96 patent96 partne96;

      Source |       SS       df       MS              Number of obs =
3853
-------------+------------------------------           F(  2,  3850) =
29.77
       Model |  29523053.7     2  14761526.9           Prob > F      =
0.0000
    Residual |  1.9088e+09  3850  495793.554           R-squared     =
0.0152
-------------+------------------------------           Adj R-squared =
0.0147
       Total |  1.9383e+09  3852  503200.477           Root MSE      =
704.13

------------------------------------------------------------------------------
    employ96 |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
    patent96 |   66.48697    29.0777     2.29   0.022     9.477817
123.4961
    partne96 |   167.9247   25.26359     6.65   0.000     118.3934
217.456
       _cons |   119.9818   14.22229     8.44   0.000     92.09783
147.8657
------------------------------------------------------------------------------

_________________________________________________________________
The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.   If you received
this in error, please contact the sender and delete the material from any
computer.


*
*   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