Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparison of coefficients in different regressions_clustering error

    Dear Madam/Sir,

    I run the following two regressions and compart the coefficient 'roa_ln_change_sale using 'suest' statement, but I have an error related to clustering? Any idea to fix this problem will be highly appreciated.

    regress ln_change_sga ln_change_sale variability gdprate roa_ln_change_sale roa asset_int EMP_int var_change_sale gdpg_change_sale asset_int_sale emp_int_sale i.sic2 i.fyear if qar1rho==1, robust cluster(gvkey)
    est store r1

    regress ln_change_sga ln_change_sale variability gdprate roa_ln_change_sale roa asset_int EMP_int var_change_sale gdpg_change_sale asset_int_sale emp_int_sale i.sic2 i.fyear if qar1rho==2, robust cluster(gvkey)
    est store r2
    suest r1 r2, robust cluster(gvkey)
    r1 was estimated with cluster(gvkey).
    re-estimate without the cluster() option, and
    specify the cluster() option with suest.
    r(322);


    test [r1_mean]roa_ln_change_sale-[r2_mean]roa_ln_change_sale=0
    equation [r1_mean] not found
    r(303);


    Sincerely,
    Joon

  • #2
    -suest- does not allow you to use robust or clustered standard errors in the regressions you feed it. However, if you want your comparison test to use robust or clustered standard errors, you can do that by specifying that in the -suest- command itself. So
    Code:
    regress ........... //N.B.  -robust- or -cluster()- not allowed
    estimates store one
    regress ........... // N.B. -robust- or -cluster()- not allowed
    estimates store two
    
    suest one two, robust cluster(gvkey)
    test whatever
    In other words, -suest- will not accept robust or clustered standard errors in its input, but it has no problem applying robustness or clustering itself.

    Comment


    • #3
      Thank you so much, Clyde. Greatly appreciated.

      Sincerely,
      Joon

      Comment


      • #4
        Joon:
        the following toy-example might be in line to Clyde's excellent suggestion and what you're after:
        Code:
        . use "C:\Program Files\Stata17\ado\base\a\auto.dta"
        (1978 automobile data)
        
        . regress price mpg i.rep78 if rep78>=4 & foreign==0
        
              Source |       SS           df       MS      Number of obs   =        11
        -------------+----------------------------------   F(2, 8)         =      1.43
               Model |  6568715.53         2  3284357.77   Prob > F        =    0.2950
            Residual |    18407027         8  2300878.38   R-squared       =    0.2630
        -------------+----------------------------------   Adj R-squared   =    0.0788
               Total |  24975742.5        10  2497574.25   Root MSE        =    1516.9
        
        ------------------------------------------------------------------------------
               price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 mpg |  -105.6349   114.2659    -0.92   0.382    -369.1325    157.8626
             5.rep78 |  -245.1154   1950.718    -0.13   0.903    -4743.478    4253.247
               _cons |   7829.933   2167.373     3.61   0.007     2831.962     12827.9
        ------------------------------------------------------------------------------
        
        . estimates store domestic
        
        . regress price mpg i.rep78 if rep78>=4 & foreign==1
        
              Source |       SS           df       MS      Number of obs   =        18
        -------------+----------------------------------   F(2, 15)        =      4.68
               Model |  34584062.5         2  17292031.2   Prob > F        =    0.0263
            Residual |  55371270.4        15  3691418.03   R-squared       =    0.3845
        -------------+----------------------------------   Adj R-squared   =    0.3024
               Total |  89955332.9        17  5291490.17   Root MSE        =    1921.3
        
        ------------------------------------------------------------------------------
               price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 mpg |  -213.1817   69.65239    -3.06   0.008    -361.6422   -64.72111
             5.rep78 |   339.1513   911.2833     0.37   0.715    -1603.203    2281.506
               _cons |    11567.3   1848.087     6.26   0.000     7628.196     15506.4
        ------------------------------------------------------------------------------
        
        . estimates store abroad
        
        . suest domestic abroad, vce(cluster rep78)
        
        Simultaneous results for domestic, abroad                   Number of obs = 29
        
                                            (Std. err. adjusted for 2 clusters in rep78)
        --------------------------------------------------------------------------------
                       |               Robust
                       | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        ---------------+----------------------------------------------------------------
        domestic_mean  |
                   mpg |  -105.6349   19.60115    -5.39   0.000    -144.0525   -67.21738
               5.rep78 |  -245.1154   265.7045    -0.92   0.356    -765.8867    275.6559
                 _cons |   7829.933   361.5324    21.66   0.000     7121.343    8538.524
        ---------------+----------------------------------------------------------------
        domestic_lnvar |
                 _cons |    14.6488   .2795635    52.40   0.000     14.10087    15.19674
        ---------------+----------------------------------------------------------------
        abroad_mean    |
                   mpg |  -213.1817   31.66172    -6.73   0.000    -275.2375   -151.1258
               5.rep78 |   339.1513   45.73359     7.42   0.000     249.5151    428.7875
                 _cons |    11567.3    788.025    14.68   0.000      10022.8     13111.8
        ---------------+----------------------------------------------------------------
        abroad_lnvar   |
                 _cons |   15.12152   .2624712    57.61   0.000     14.60709    15.63596
        --------------------------------------------------------------------------------
        
        
        . test[domestic_mean]_b[_cons] =[abroad_mean]_b[_cons]
        
         ( 1)  [domestic_mean]_cons - [abroad_mean]_cons = 0
        
                   chi2(  1) =   76.79
                 Prob > chi2 =    0.0000
        
        .
        In previous experience with the same procedure I had some issues with the clustering variable, that dropped the -test- constraint because it was not uniformly present in both the regression compared vis -suest-.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X