# st: RE: Problem using -ivhettest-

 From "Schaffer, Mark E" To Subject st: RE: Problem using -ivhettest- Date Wed, 3 Feb 2010 21:23:24 -0000

```Joao Ricardo,

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of
> Joao Ricardo F. Lima
> Sent: 03 February 2010 21:11
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Problem using -ivhettest-
>
> Hi Mark and Statalisters,
>
> I'm using Stata 10.1 and having problems with -ivhettest-
> after -ivregress-.

This one's easy to answer, but the answer is not entirely satisfactory:
ivhettest supports ivreg, ivreg2 and regress but not ivregress (see the
help file).

Something for my (unfeasibly long) to-do list.

In the meantime, you can use ivreg or ivreg2 to do the estimation.

FYI, official ivreg is still available in Stata 10 and Stata 11: -help
ivreg- brings up the message that it is an out-of-date command, but the
command does still work.

Cheers,
Mark

> Example:
>
> *******
> webuse hsng2, clear
>
> ivregress 2sls rent pcturban (hsngval = faminc reg2-reg4) ivhettest
> *******
>
> . ivregress 2sls rent pcturban (hsngval = faminc reg2-reg4)
>
> Instrumental variables (2SLS) regression               Number
> of obs =      50
>                                                        Wald
> chi2(2)  =   90.76
>                                                        Prob >
> chi2   =  0.0000
>
> R-squared     =  0.5989
>                                                        Root
> MSE      =  22.166
>
> --------------------------------------------------------------
> ----------------
>         rent |      Coef.   Std. Err.      z    P>|z|
> [95% Conf. Interval]
> -------------+------------------------------------------------
> ----------
> -------------+------
>      hsngval |   .0022398   .0003284     6.82   0.000
> .0015961    .0028836
>     pcturban |    .081516   .2987652     0.27   0.785
> -.504053     .667085
>        _cons |   120.7065   15.22839     7.93   0.000
> 90.85942    150.5536
> --------------------------------------------------------------
> ----------------
> Instrumented:  hsngval
> Instruments:   pcturban faminc reg2 reg3 reg4
>
> . ivhettest
>
>
> The -ivhettest- is updated as you can see
>
> . which ivhettest
> *! ivhettest 1.1.8  4Jan2010
> *! author mes
>
> Am I doing something wrong?
>
> Thanks a lot
>
> Joao Ricardo
>
>
> . ssc des ivhettest
>
> --------------------------------------------------------------
> ------------------------------------------------------------------
> package ivhettest from http://fmwww.bc.edu/repec/bocode/i
> --------------------------------------------------------------
> ------------------------------------------------------------------
>
> TITLE
>       'IVHETTEST': module to perform Pagan-Hall and related
> heteroskedasticity tests after IV
>
> DESCRIPTION/AUTHOR(S)
>
>       ivhettest performs various flavors of Pagan and Hall's (1983)
>       tests of heteroskedasticity for instrumental variables (IV)
>       estimation.  It will also perform the related standard
>       heteroskedasticity tests of  Breusch-Pagan, Godfrey,
>       Cook-Weisberg, White and Koenker  after estimation by OLS or IV.
>       These are tests of whether there is heteroskedasticity  in the
>       estimated regression that  is related to one or more indicator
>       variables.  The test flavors vary  according to the choice of
>       indicator variables and the choice of test statistics.  Under
>       the null of no heteroskedasticity,  the test statistic is
>       distributed as chi-sq with degrees of freedom =  number of
>       indicator variables. This is version 1.1.7 of ivhettest,
>       updated from that published in Stata Journal, 3(1).
>
>       KW: instrumental variables
>       KW: heteroskedasticity
>
>       Requires: Stata version 7.0
>
>
>       Author: Mark E Schaffer, Heriot-Watt University
>       Support: email  m.e.schaffer@hw.ac.uk
>
>
>
>
> --
> ----------------------------------------
> Joao Ricardo Lima, D.Sc.
> Professor
> UFPB-CCA-DCFS
> Fone: +5538387264913
> Skype: joao_ricardo_lima
> ----------------------------------------
> *
> *   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/
>

--
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

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