Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Reversed coefficient sign for exponential MLE vs. ereg


From   Gordon Burtch <gburtch@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Reversed coefficient sign for exponential MLE vs. ereg
Date   Fri, 27 Jan 2012 20:41:50 -0500

Sorry, 

For those who are not familiar with ereg syntax: "ereg y" is equivalent to "streg, dist(exponential) nohr". My code output is included below, at the end of the e-mail.

The coefficient estimates should be the same I think, though obviously I've done something wrong since the sign is reversed.

Regards,

Gord

=======STATA OUTPUT

. ml model lf myexponential (y=)

. ml max

initial:       log likelihood = -791.33107
alternative:   log likelihood = -804.68437
rescale:       log likelihood = -766.08921
Iteration 0:   log likelihood = -766.08921  
Iteration 1:   log likelihood = -765.96116  
Iteration 2:   log likelihood = -765.96115  

                                                  Number of obs   =       1000
                                                  Wald chi2(0)    =          .
Log likelihood = -765.96115                       Prob > chi2     =          .

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |  -.2340388   .0316228    -7.40   0.000    -.2960184   -.1720593
------------------------------------------------------------------------------

. streg, dist(exponential) nohr

         failure _d:  1 (meaning all fail)
   analysis time _t:  y

Iteration 0:   log likelihood = -1607.5347  
Iteration 1:   log likelihood = -1607.5347  

Exponential regression -- log relative-hazard form 

No. of subjects =         1000                     Number of obs   =      1000
No. of failures =         1000
Time at risk    =  791.3310721
                                                   LR chi2(0)      =      0.00
Log likelihood  =   -1607.5347                     Prob > chi2     =         .

------------------------------------------------------------------------------
          _t |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |   .2340388   .0316228     7.40   0.000     .1720593    .2960184
------------------------------------------------------------------------------


On 2012-01-27, at 8:23 PM, Christopher Baum wrote:

> <>
> I am trying to implement the ereg (exponential regression) estimator using ML, and am encountering something odd. I have written a .do file as follows...
> 
> program define myexponential
> 	version 10.0
> 	args lnf x
> 	local lambda = exp(`x')
> 	quietly replace `lnf' = ln(`lambda') - `lambda'*$ML_y1
> end
> 
> 
> As ereg has been obsolete since Stata version 8, why not frame this question in terms of currently supported and documented commands? Unless someone
> has a Stata 7.0 manual, how would they know what the syntax for ereg is?
> 
> Kit
> 
> Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
>                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
>  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index