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

From |
rgutierrez@stata.com (Roberto G. Gutierrez, StataCorp) |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Linear regression using Mata optimize |

Date |
Tue, 10 Feb 2009 08:52:05 -0600 |

Nicola Orsini <Nicola.Orsini@ki.se> asks: > My question is why I'm not getting the correct variance-covariance matrix in > the example below (simple linear regression) when using > optimize_result_V(S). Any thoughts on this? I haven't looked at the Mata code closely, but I see that Nicola is comparing his program to -regress-. -regress- gives OLS standard errors, which are _not_ maximum likelihood (ML). They are REML. The difference is one of dividing by n instead of (n-p), but it is enough to throw off the standard errors. If Nicola wants to test his optimize() code, he should try comparing with -xtmixed, mle-, which fits ML linear regression as a degenerate case. --Bobby rgutierrez@stata.com * * 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/

**Follow-Ups**:**Re: st: Linear regression using Mata optimize***From:*Nicola Orsini <nicola.orsini@ki.se>

- Prev by Date:
**Re: st: Adding variables not in the coefficients for outreg2 or estout** - Next by Date:
**st: STATA Spatial autocorrelation LM tests** - Previous by thread:
**Re: st: Re: Linear regression using Mata optimize** - Next by thread:
**Re: st: Linear regression using Mata optimize** - Index(es):

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