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

From |
Christopher Baum <baum@bc.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: re: instrumental variables estimation problems |

Date |
Tue, 8 Dec 2009 08:52:01 -0500 |

<>

------ sysuse auto,clear loc qual !foreign ivregress 2sls price (mpg = weight length) if `qual' // these are the proper 2SLS resids: y - orig X * 2SLS beta predict double eps, res estat overid // Sargan stat by hand reg eps weight length if `qual' // compute the uncentered r^2 from this regression predict double yhat, xb gen double syhat2 = yhat^2 if `qual' su syhat2, mean loc syhat2 = `r(sum)' gen double seps2 = eps^2 if `qual' su seps2, mean scalar ur2 = `syhat2'/r(sum) // Sargan: N * uncentered r^2 di e(N)*ur2 -------

Kit Baum | Boston College Economics and 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/

- Prev by Date:
**RE: st: RE: Intraday volatility** - Next by Date:
**st: Interpreting Marginal Effects with Interaction Terms in Non-Linera Models** - Previous by thread:
**Re: st: Re: instrumental variables estimation problems** - Next by thread:
**st: Interpreting Marginal Effects with Interaction Terms in Non-Linera Models** - Index(es):

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