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

Re: st: XTIVREG2


From   "Mark Schaffer" <[email protected]>
To   [email protected]
Subject   Re: st: XTIVREG2
Date   Mon, 19 Sep 2005 22:01:02 +0100 (BST)

Joana,

I have a working version of "xtivreg2", but it does only fixed effects
estimation.

However, I'm not sure that you actually have a problem.  When doing a
Hausman test for endogeneity in IV estimation, the differenced variance
matrix typically isn't of full rank.  -hausman- will print out a warning
that "(V_b-V_B is not positive definite)", but it doesn't indicate that
anything is actually wrong.

If you try doing the endogeneity test for simple IV estimation that is in
the manuals somewhere, you'll probably find that the same warning message
appears.

Hope this helps.

Cheers,
Mark

> Tinna,
>
> Thank you for your suggestion. Unfortunately, when I tried ivendog I
> got the error message:
>
> ivendog works only after ivreg, ivreg2; use dmexogxt after xtivreg
> last estimates not found
> r(301);
>
> I found a post by Steven Stillman
> (http://www.stata.com/statalist/archive/2003-02/msg00266.html) where
> he said:
>
> "Pedro,
> At this point, your best bet is to transform your data using xtdata, fe
> and
> use ivreg2 to estimate a fixed-effect iv model.   As the default for
> ivreg2
> is to produce large sample estimates, your test results and standard
> errors
> will not be affected by the transformation.  This will not work for
> estimating a random effects iv model.  Writing an xtivreg2 program which
> does this all automatically is on my to-do list but I am not sure how soon
> I
> will have time to do it.
> Steve"
>
> I was hoping Steven (or someone) else had written an xtivreg2 programme.
>
>
> On 19/09/05, Tinna <[email protected]> wrote:
>> I had a similar problem the other day.
>> I was using ivreg and ivreg7, but what worked for me was the
>> post-estimation command ivendog
>> You may want to try that.
>>
>> xtivreg loda_pc lgdp_pc_d lpop  trade_gdp  polityp  us_un_friend_p
>> japan_un_friend_p Pperiod* y_colony (corrupt=ethnic), re
>>
>> ivendog
>>
>> Hope this helps
>> Tinna
>>
>> On 9/18/05, Joana Quina <[email protected]> wrote:
>> > Dear all,
>> >
>> > I am using xtivreg to estimate a random effects panel data model.  I
>> > have one endogenous variable and one excluded instrument.  In order to
>> > test for endogeneity, I am using the Hausman test with the sigmamore
>> > option. When I do this, the Hausman test says that V_b-V_B is not
>> > positive definite.
>> >
>> > I would like to know your thoughts on the following:
>> > 1- What can be done to correct this?
>> > 2- Is there an "xtivreg2"?
>> >
>> > Thank you for your help,
>> >
>> > Joana
>> >
>> > I enclose the output:
>> >
>> > -------------output-----------------------
>> > . xtivreg loda_pc lgdp_pc_d lpop  trade_gdp  polityp  us_un_friend_p
>> > japan_un_friend_p Pperiod*
>> > >  y_colony (corrupt=ethnic), re
>> >
>> > G2SLS random-effects IV regression              Number of obs      =
>>     111
>> > Group variable: id                              Number of groups   =
>>      31
>> >
>> > R-sq:  within  = 0.5063                         Obs per group: min =
>>       1
>> >       between = 0.6333                                        avg =
>>    3.6
>> >       overall = 0.6213                                        max =
>>      4
>> >
>> >                                                Wald chi2(11)      =
>> 113.34
>> > corr(u_i, X)       = 0 (assumed)                Prob > chi2        =
>>  0.0000
>> >
>> > ------------------------------------------------------------------------------
>> >     loda_pc |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>> > -------------+----------------------------------------------------------------
>> >     corrupt |  -.0429657   .1066427    -0.40   0.687    -.2519815
>> .1660502
>> >   lgdp_pc_d |   .0428328   .1272094     0.34   0.736    -.2064931
>> .2921586
>> >        lpop |   -.510157    .104499    -4.88   0.000    -.7149711
>> -.3053428
>> >   trade_gdp |   .0053404   .0024281     2.20   0.028     .0005813
>> .0100994
>> >     polityp |   .0140851   .0081874     1.72   0.085    -.0019619
>> .0301322
>> > us_un_frie~p |  -.5324777   .4733456    -1.12   0.261    -1.460218
>> .3952627
>> > japan_un_f~p |   2.920518   .8081029     3.61   0.000     1.336666
>> 4.504371
>> >   Pperiod_1 |   .4201038   .2109389     1.99   0.046     .0066712
>> .8335365
>> >   Pperiod_2 |   .0078534   .1087593     0.07   0.942    -.2053109
>> .2210178
>> >   Pperiod_4 |  -.2225596   .2035832    -1.09   0.274    -.6215754
>> .1764562
>> >    y_colony |   .0006514   .0069568     0.09   0.925    -.0129837
>> .0142864
>> >       _cons |  -.8395967   1.498147    -0.56   0.575    -3.775911
>> 2.096718
>> > -------------+----------------------------------------------------------------
>> >     sigma_u |  .58004628
>> >     sigma_e |  .28688419
>> >         rho |  .80345955   (fraction of variance due to u_i)
>> > ------------------------------------------------------------------------------
>> > Instrumented:   corrupt
>> > Instruments:    lgdp_pc_d lpop trade_gdp polityp us_un_friend_p
>> > japan_un_friend_p Pperiod_1
>> >                Pperiod_2 Pperiod_4 y_colony ethnic
>> >
>> > . est store ivrandom
>> >
>> > . xtreg loda_pc lgdp_pc_d lpop  trade_gdp  polityp  us_un_friend_p
>> > japan_un_friend_p corrupt Pp
>> > > eriod* y_colony , re
>> >
>> > Random-effects GLS regression                   Number of obs      =
>>     111
>> > Group variable (i): id                          Number of groups   =
>>      31
>> >
>> > R-sq:  within  = 0.5303                         Obs per group: min =
>>       1
>> >       between = 0.6426                                        avg =
>>    3.6
>> >       overall = 0.6435                                        max =
>>      4
>> >
>> > Random effects u_i ~ Gaussian                   Wald chi2(11)      =
>>  128.55
>> > corr(u_i, X)       = 0 (assumed)                Prob > chi2        =
>>  0.0000
>> >
>> > ------------------------------------------------------------------------------
>> >     loda_pc |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
>> Interval]
>> > -------------+----------------------------------------------------------------
>> >   lgdp_pc_d |   .0181293   .1191414     0.15   0.879    -.2153837
>> .2516422
>> >        lpop |  -.5275332    .102472    -5.15   0.000    -.7283747
>> -.3266917
>> >   trade_gdp |   .0048886   .0022066     2.22   0.027     .0005637
>> .0092135
>> >     polityp |   .0143393   .0079024     1.81   0.070    -.0011491
>> .0298277
>> > us_un_frie~p |  -.4735392   .4488587    -1.05   0.291    -1.353286
>> .4062077
>> > japan_un_f~p |   3.167958   .6942995     4.56   0.000     1.807156
>> 4.52876
>> >     corrupt |  -.1162393    .033678    -3.45   0.001    -.1822469
>> -.0502316
>> >   Pperiod_1 |   .5098709   .1617323     3.15   0.002     .1928815
>> .8268603
>> >   Pperiod_2 |   .0336761   .0990239     0.34   0.734    -.1604072
>> .2277594
>> >   Pperiod_4 |  -.2379928   .1948569    -1.22   0.222    -.6199053
>> .1439197
>> >    y_colony |  -.0014819   .0065505    -0.23   0.821    -.0143206
>> .0113568
>> >       _cons |  -.5709694   1.406288    -0.41   0.685    -3.327243
>> 2.185304
>> > -------------+----------------------------------------------------------------
>> >     sigma_u |  .57088029
>> >     sigma_e |  .26203147
>> >         rho |  .82598424   (fraction of variance due to u_i)
>> > ------------------------------------------------------------------------------
>> >
>> > . est store random
>> >
>> > . hausman ivrandom random, sigmamore
>> >
>> >                 ---- Coefficients ----
>> >             |      (b)          (B)            (b-B)
>> sqrt(diag(V_b-V_B))
>> >             |    ivrandom      random       Difference          S.E.
>> > -------------+----------------------------------------------------------------
>> >     corrupt |   -.0429657    -.1162393        .0732736        .0281962
>> >   lgdp_pc_d |    .0428328     .0181293        .0247035               .
>> >        lpop |    -.510157    -.5275332        .0173762               .
>> >   trade_gdp |    .0053404     .0048886        .0004518               .
>> >     polityp |    .0140851     .0143393       -.0002542               .
>> > us_un_frie~p |   -.5324777    -.4735392       -.0589386
>> .
>> > japan_un_f~p |    2.920518     3.167958       -.2474397
>> .
>> >   Pperiod_1 |    .4201038     .5098709       -.0897671               .
>> >   Pperiod_2 |    .0078534     .0336761       -.0258227               .
>> >   Pperiod_4 |   -.2225596    -.2379928        .0154332               .
>> >    y_colony |    .0006514    -.0014819        .0021332               .
>> > ------------------------------------------------------------------------------
>> >                         b = consistent under Ho and Ha; obtained from
>> xtivreg
>> >            B = inconsistent under Ha, efficient under Ho; obtained
>> from xtreg
>> >
>> >    Test:  Ho:  difference in coefficients not systematic
>> >
>> >                 chi2(11) = (b-B)'[(V_b-V_B)^(-1)](b-B)
>> >                          =        6.74
>> >                Prob>chi2 =      0.8201
>> >                (V_b-V_B is not positive definite)
>> >
>> > -------
>> >
>> > *
>> > *   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/
>> >
>>
>> *
>> *   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/
>>
>
> *
> *   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/
>


Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3294
email: [email protected]
web: http://www.sml.hw.ac.uk/ecomes



__________________________________________________________________

DISCLAIMER:

This e-mail message is subject to http://www.hw.ac.uk/disclaim.htm
__________________________________________________________________

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