# Re: st: OLS via -ml-

 From Richard Williams <[email protected]> To [email protected] Subject Re: st: OLS via -ml- Date Fri, 15 Jul 2005 08:15:00 -0500

```At 09:50 PM 7/15/2005 +0900, you wrote:
```
```Dear Statalisters,

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

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-).
```
Incorrect assumption, alas! I suggest looking at Stata's Maximum Likelihood book:

http://www.stata.com/bookstore/mle.html

The OLS model is trickier than you might think, because you also have to estimate sigma. Their programs are all online, so you can easily see what they did (see, for example, -mynormal0.ado and -mynormal_lf.ado). Using their programs,

. mynormal0 foreign mpg weight

Number of obs = 74
Wald chi2(2) = 43.88
Log likelihood = -29.838155 Prob > chi2 = 0.0000

------------------------------------------------------------------------------
foreign | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1 |
mpg | -.0194295 .0124106 -1.57 0.117 -.0437539 .0048949
weight | -.0004678 .0000924 -5.06 0.000 -.0006488 -.0002867
_cons | 2.123506 .5181488 4.10 0.000 1.107953 3.139059
-------------+----------------------------------------------------------------
eq2 |
_cons | -1.01572 .0821995 -12.36 0.000 -1.176828 -.8546122
------------------------------------------------------------------------------

That still isn't identical to what -reg- produces (which probably says something about use of ml and z stats instead of ols and t stats), but it is much closer than what you got.

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

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