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

st: RE: outreg after ivreg2


From   "Steven Stillman (LMPG)" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: outreg after ivreg2
Date   Sat, 21 Dec 2002 19:28:18 +1300

Pedro.  outreg can add results from the 'extra' statistics produced by
ivreg2 (and other stata commands) using the addstat option.  See my code
below for an example using ivreg2, which also adds the results from a
orthoginality test and a heteroskadicity test to the outreg output.  If you
also want the regression coefficients from the 1st-stage regression, I
believe your best bet is to run that model separately using regress and then
outreg the results.   

Steve

***  my code *** 

qui ivreg2 `lhs' (= $instrum1) lnrpcetran2 lnrpcebar2 `dage' $rhsindv
$rhshse $dyear $dreg $prices, cl(psuyear) orthog(lnrpcetran2);

scalar cstat = e(cstat);
scalar cpval = e(cstatp);

di in white "C statistic (exogeneity of lnrpcetran2)" _col(60) %5.2f
e(cstat);
di in white "p-value of C-statistic"  _col(60) %5.2f e(cstatp);

qui ivreg2 `lhs' (lnrpcetran2 = $instrum1) lnrpcebar2 `dage' $rhsindv
$rhshse $dyear $dreg $prices, cl(psuyear);
qui ivhettest, ivlev;

scalar ph = r(ph);
scalar phpval = r(php);

di in white "Pagan-Hall general test statistic" _col(60) %5.2f r(ph);
di in white "p-value of Pagan-Hall-statistice"  _col(60) %5.2f r(php);

ivreg2 `lhs' (lnrpcetran2 = $instrum1) lnrpcebar2 `dage' $rhsindv $rhshse
$dyear $dreg $prices, cl(psuyear) first gmm;

mat f = e(first);
scalar pr2 = f[2,1];
scalar Fstat = f[3,1];
scalar Fpval = f[6,1];

outreg lnrpcebar2 lnrpcetran2 using iv1, nonotes nocons se 3aster coefastr
replace rdec(2) ctitle(`lhs') addstat(C statistic, cstat, p-value of
C-statistic, cpval, Pagan-Hall Het Test, ph, p-value of Pagan-Hall, phpval,
Partial R-squared, pr2, F-Test of ivs, Fstat, Prob > F, Fpval, Hansen J
statistic, e(j), Chi-sq(3) P-val, e(jp)) adec(2);

> -----Original Message-----
> From:	Pedro Martins [SMTP:[email protected]]
> Sent:	Saturday, December 21, 2002 5:12 AM
> To:	[email protected]
> Subject:	st: outreg after ivreg2
> 
> Dear all,
> 
> How does one capture both the main and the auxiliary regression results
> in -ivreg2- with -outreg-?
> 
> I'm using -outreg- from STB 59 but I can't get the auxiliary regression
> output, even with the "onecol" option.
> 
> Does one have to estimate the auxiliary regression separately? If so,
> how does one capture the quality of the instruments statistics, such as
> the adjusted partial R^2?
> 
> Thank you
> 
> Pedro Martins
> 
> 
> 
> ****************************************************
> Pedro Martins
> Department of Economics
> University of Warwick
> Coventry CV4 7AL
> United Kingdom
> 
> Tel: +44/0 24765 28418
> Fax: +44/0 24765 23032
> Email: [email protected]
> Web: www.warwick.ac.uk/staff/P.Martins
> *****************************************************
> *
> *   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/

The information contained in this document is intended only for the
 addressee and is not necessarily the views nor the official 
communication of the Department of Labour.  All final/official papers 
which are sent from the Department will be sent by non-electronic
means, on appropriate letterhead, signed by authorised personnel.
*
*   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