Statalist


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

RE: st: xtivreg2 Random Effects and Durbin Wu Hausman


From   "Ingham, Hilary" <[email protected]>
To   <[email protected]>
Subject   RE: st: xtivreg2 Random Effects and Durbin Wu Hausman
Date   Thu, 27 Aug 2009 10:52:40 +0100

Mark

Many thanks for your quick reply.

Hilary

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Schaffer, Mark E
Sent: 27 August 2009 10:47
To: [email protected]
Subject: RE: st: xtivreg2 Random Effects and Durbin Wu Hausman

Hilary,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Ingham, Hilary
> Sent: 27 August 2009 10:29
> To: [email protected]
> Subject: RE: st: xtivreg2 Random Effects and Durbin Wu Hausman
> 
> Hi Mark/Steve
> 
> I have been following this as I am also trying to generate 
> the DWH statistic. I have located xtoverid and found the 
> lines where the additions need to be made. However, how do I 
> get this modified file into Stata? My first attempt was to 
> download xtroverid from RPEC but when I saved this it was a 
> .mht file despite the .ado at the end and I could not edit it 
> anyway. Then I just typed xtoverid directly into Stata and 
> the whole programme just printed out.

First, you should never download and install from repec except as a last resort.  The right way to install is via ssc-archives using the ssc command.  From within Stata, type

ssc install xtoverid

You'll also need to install some other commands:

ssc install ivreg2
ssc install xtivreg2
ssc install ranktest

All these are put by the ssc command somewhere in your \ADO\PLUS folder, depending the first letter of the file name.

If you've installed any of the above by hand, you should delete them and let Stata manage the file installation as above.

You can then find xtoverid.ado in \ADO\PLUS\X.

When you make your own myxtoverid.ado, the best place to put it is in \ADO\PERSONAL.

Good luck (and welcome to Statalist)!

--Mark

> I am sorry if this sounds a very elementary problem but I am 
> new to Statalist and this is my first attempt at anything 
> 'non-standard'.
> 
> Thanks
> 
> Hilary Ingham 
> 
> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Schaffer, Mark E
> Sent: 26 August 2009 23:23
> To: [email protected]
> Subject: RE: st: xtivreg2 Random Effects and Durbin Wu Hausman
> 
> Steve,
> 
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of Steven 
> > Archambault
> > Sent: 26 August 2009 22:46
> > To: [email protected]
> > Subject: Re: st: xtivreg2 Random Effects and Durbin Wu Hausman
> > 
> > Okay, great. Its working. Thanks! I suppose there are other bits of 
> > code I could add to get additional test results from the 
> -xtoverid - 
> > -robust noisily- options.
> 
> Yes, not hard to do.
> 
> > I am thinking the
> > endogeneity test for the FE regression. Also, I'd like to 
> get the weak 
> > and underidentification instrument tests for the FE and RE robust. 
> > Those might take a bit more programming I suppose. 
> Actually, why isn't 
> > RE available for xtivreg2?
> 
> I started working on it, and then switched to a more general 
> estimator that would allow the user complete control over the 
> range of orthogonality conditions: Hausman-Taylor, RE, FE, 
> FD, EC2SLS, G2SLS, etc. etc. would all be special cases using 
> different combinations of regressors/instruments in 
> mean-deviations/group 
> means/GLS-transforms/levels/first-differences/etc. etc.  But 
> after I got it mostly working I got distracted by other 
> things.  Someday, I hope, I'll return to it and finish it off.
> 
> --Mark
> 
> > 
> > Ciao,
> > Steve
> > 
> > 
> > 
> > On Wed, Aug 26, 2009 at 2:18 PM, Schaffer, Mark 
> > E<[email protected]> wrote:
> > > Steve,
> > >
> > >> -----Original Message-----
> > >> From: [email protected]
> > >> [mailto:[email protected]] On Behalf 
> Of Steven 
> > >> Archambault
> > >> Sent: 26 August 2009 21:05
> > >> To: [email protected]
> > >> Subject: Re: st: xtivreg2 Random Effects and Durbin Wu Hausman
> > >>
> > >> Hey Mark,
> > >>
> > >> Maybe I am missing something. But, I don't see a 
> statistic that is 
> > >> equivalent to a Durbin-Wu-Hausman value when I call
> > xtoverid. I have
> > >> added your suggested changes to the code.  I want to compare the 
> > >> instrumentalized equation against the 
> non-instrumentalized version.
> > >> Back to my original post, I am asking if a simple F-test would 
> > >> suffice for this. Maybe I am not quite clear on something here.
> > >
> > > The -endog- option of -ivreg2- and -xtivreg2-, which you
> > added to the
> > > internal call to -ivreg2-, reports a GMM-type
> > Durbin-Wu-Hausman test.
> > > It's reported in the footer of the -ivreg2- output, under
> > the heading
> > >
> > > -endog- option:
> > > Endogeneity test of endogenous regressors:
> > >
> > > This test is what you want.  In the special case of
> > conditional homoskedasticity, it's numerically equivalent to a 
> > standard DWH test.  You're using -robust- so the test stat being 
> > reported is correspondingly robust (unlike the traditional 
> DWH test).
> > >
> > > See the help file of -ivreg2- or the SJ papers by Kit Baum,
> > Steve Stillman and myself for details.
> > >
> > > Cheers,
> > > Mark
> > >
> > >
> > >>
> > >> Thanks,
> > >>
> > >> Steve
> > >>
> > >> On Wed, Aug 26, 2009 at 7:16 AM, Schaffer, Mark 
> > >> E<[email protected]> wrote:
> > >> > Steve,
> > >> >
> > >> >> -----Original Message-----
> > >> >> From: Steven Archambault [mailto:[email protected]]
> > >> >> Sent: 26 August 2009 00:07
> > >> >> To: [email protected]
> > >> >> Subject: xtivreg2 Random Effects and Durbin Wu Hausman
> > >> >>
> > >> >> Hi all,
> > >> >>
> > >> >> I have been playing around with testing for endogeneity
> > in panel
> > >> >> regression models. Some of the methods discussed by Baum
> > >> (Intro. to
> > >> >> Econometrics Using Stata) to calculate DWH do not work
> > with panel
> > >> >> data, and more so with Random Effects models. So, would it
> > >> make sense
> > >> >> to use the following to calculate a DW F-statistic? 
> What other 
> > >> >> methods could be used?
> > >> >>
> > >> >>
> > >> >> xtreg policy instrument1 instrument2 gdp trade year, 
> re robust; 
> > >> >> predict policy_res, e; xtreg invest policy trade gdp  year 
> > >> >> policy_res, re robust; test policy_res;
> > >> >
> > >> > I'm pretty sure this doesn't work (or if it does, I
> > haven't seen it
> > >> > demonstrated).
> > >> >
> > >> > Am I right to think that your RE estimation is this?
> > >> >
> > >> > xtivreg invest gdp trade year (policy=instrument1
> > instrument2), re
> > >> >
> > >> > and that you want robust or cluster-robust test of the
> > >> exogeneity of
> > >> > policy?
> > >> >
> > >> > I think you can get -xtoverid- to do this for you, but
> > it requires
> > >> > hacking the code and using the -noisily- option.
> > >> >
> > >> > You might want to make a copy of xtoverid.ado and call it 
> > >> > myxtoverid.ado.  Then make the following changes:
> > >> >
> > >> > 1.  In the "program define" line at the top, change
> > "program define
> > >> > xtoverid" to "program define myxtoverid".
> > >> >
> > >> > 2.  Look for the line that has
> > >> >
> > >> > if "`model'"=="g2sls" {
> > >> >
> > >> > Below that are three calls to -ivreg2-.
> > >> >
> > >> > 3.  At the end of the first two calls to -ivreg2-, after
> > >> "noid", add
> > >> > the following (as a continuation of the same line):
> > >> >
> > >> > endog(`instd_g')
> > >> >
> > >> > 4.  At the end of the third call to -ivreg2-, after "noid" add
> > >> >
> > >> > endog(`inexog_g' `instd_g')
> > >> >
> > >> > 5.  After estimation, call -myxtoverid- with the
> > -noisily- option.
> > >> > The internal reestimation of the equation will be
> > displayed and an
> > >> > endogeneity test for all endogenous regressors will be 
> included.
> > >> >
> > >> > Note that if you estimate using EC2SLS, unless the panel is
> > >> balanced
> > >> > the degrees of freedom of the test will be more than you
> > expect and
> > >> > the test statistic will probably be misleadingly low.  The
> > >> explanation
> > >> > has to do with (what seems to me, at any rate) the rather
> > >> peculiar way
> > >> > exogenous regressors are treated by Stata's -xtivreg- in an
> > >> unbalanced
> > >> > panel using EC2SLS.  There are more details in the last
> > >> paragraph of
> > >> > the -xtoverid- help file.
> > >> >
> > >> > Cheers,
> > >> > Mark
> > >> >
> > >> >> Thanks,
> > >> >> Steve
> > >> >>
> > >> >
> > >> >
> > >> > --
> > >> > 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/
> > >> >
> > >>
> > >> *
> > >> *   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/
> > >
> > 
> > *
> > *   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/
> 
> *
> *   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/

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



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