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

st: OLS via -ml-


From   "Katsuhide Isa" <[email protected]>
To   Statalist <[email protected]>
Subject   st: OLS via -ml-
Date   Fri, 15 Jul 2005 21:50:17 +0900

Dear Statalisters,

I wrote the following simple ado file (as a pure exercise of 
-ml-) to run an OLS model via -ml-:

/*----------olsviaml.ado----------*/
program olsviaml
        version 8.0
        args lnf theta1
        quietly replace `lnf' = ln(normden($ML_y1-`theta1'))
end
/*----------olsviaml.ado----------*/

Then I ran the following codes, 

. sysuse auto
. ml model lf olsviaml (foreign = mpg weight)
. ml maximize

and got the following results:
                                                  Number of obs   =         74
                                                  Wald chi2(2)    =       5.75
Log likelihood = -72.853871                       Prob > chi2     =     0.0563

------------------------------------------------------------------------------
     foreign |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |  -.0194295   .0342701    -0.57   0.571    -.0865977    .0477387
      weight |  -.0004678   .0002551    -1.83   0.067    -.0009678    .0000322
       _cons |   2.123506   1.430791     1.48   0.138    -.6807933    4.927805
------------------------------------------------------------------------------

On the other hand, when running OLS via -regress- as 

. reg foreign mpg weight

the results are as follows:

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  2,    71) =   21.05
       Model |  5.75462023     2  2.87731012           Prob >  F     =  0.0000
    Residual |  9.70483923    71  .136687876           R-squared     =  0.3722
-------------+------------------------------           Adj R-squared =  0.3546
       Total |  15.4594595    73  .211773417           Root MSE      =  .36971

------------------------------------------------------------------------------
     foreign |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         mpg |  -.0194295   .0126701    -1.53   0.130     -.044693     .005834
      weight |  -.0004678   .0000943    -4.96   0.000    -.0006558   -.0002797
       _cons |   2.123506   .5289824     4.01   0.000     1.068745    3.178267
------------------------------------------------------------------------------

The two results are virtually the same, but slightly different 
as well; I'm afraid estimation results by -ml- are less 
significant (ex.z-value vs.t-value, chi2 vs.F or R-squared), 
though they may not be directly comparable.

So my question is, (suppose the above ado file is correct)
how one should interpret these two results (esp.the one by 
-ml-).

Any suggestions welcome.
Thanks in advance.

K.I.
*
*   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