Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Wald test cannot be done after reg


From   [email protected]
To   [email protected]
Subject   st: Wald test cannot be done after reg
Date   Mon, 25 Jun 2007 15:08:06 -0500

Hello. I am running a regression using the reg command. I am using an "if" sentence to select a subsample to be used in a regression. The "if" refers to an element of an array (see below for details). When I use the reference to the element of the array, I cannot use the "test" command after the estimation ("requested action not valid after most recent estimation command"). However, if I use the value itself (1996), the test will work. It is important for me to make a reference to the array since I am doing a loop. How can I make it work? Thanks in advance for your help. The output is below:

. reg lIngrel  PF PL PK LO OI lactivo if year==1996, cluster(cod)

Linear regression                                      Number of obs =     425
                                                       F(  6,    40) =  121.73
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.8625
Number of clusters (cod) = 41                          Root MSE      =  .26858

------------------------------------------------------------------------------
             |               Robust
     lIngrel |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          PF |   .2226589     .06889     3.23   0.002      .083427    .3618909
          PL |   .3352107   .1201605     2.79   0.008     .0923572    .5780641
          PK |   .1807546    .066307     2.73   0.009      .046743    .3147661
          LO |   .8865541   .0704191    12.59   0.000     .7442318    1.028876
          OI |  -.3294173   .1494617    -2.20   0.033    -.6314907   -.0273438
     lactivo |   .0072397   .0280807     0.26   0.798    -.0495135    .0639929
       _cons |   .9065358   .7041835     1.29   0.205    -.5166721    2.329744
------------------------------------------------------------------------------

. test PF+PL+PK=0

 ( 1)  PF + PL + PK = 0

       F(  1,    40) =   17.07
            Prob > F =    0.0002

. display string(el(annos,1,1))
1996

. reg lIngrel  PF PL PK LO OI lactivo if year==el(annos,1,1), cluster(cod)

Linear regression                                      Number of obs =     425
                                                       F(  6,    40) =  121.73
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.8625
Number of clusters (cod) = 41                          Root MSE      =  .26858

------------------------------------------------------------------------------
             |               Robust
     lIngrel |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          PF |   .2226589     .06889     3.23   0.002      .083427    .3618909
          PL |   .3352107   .1201605     2.79   0.008     .0923572    .5780641
          PK |   .1807546    .066307     2.73   0.009      .046743    .3147661
          LO |   .8865541   .0704191    12.59   0.000     .7442318    1.028876
          OI |  -.3294173   .1494617    -2.20   0.033    -.6314907   -.0273438
     lactivo |   .0072397   .0280807     0.26   0.798    -.0495135    .0639929
       _cons |   .9065358   .7041835     1.29   0.205    -.5166721    2.329744
------------------------------------------------------------------------------

. test PF+PL+PK=0
requested action not valid after most recent estimation command


Thanks for your help.



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