Announcement

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

  • Time trend in Random Effects panel data model

    I am trying to estimate the effect of a range of bank specific variables like Size, Risk leverage, Assets quality, Provision Coverage Ratio, NIM, non-Interest Income, Contingent Liabilities and Operating Efficiency on Stress level of banks. I have included GDP growth Rate, G-sec Yield, Call Money Rate, Stability, Inflation and USD-INR Exchange Rate as my macroeconomic control variables. My panel consists of 18 years from 2005-2022 and has got 39 banks. Hausman test indicates RE model to be appropriate.

    I want to investigate whether, my dependent variable, i.e. Stress score follows any linear or quadratic time trend, by including c.year and then c.year##c.year, respectively. With linear time trend, the coefficient of timevar turned out to be insignificant. However, with quadratic time trend, the variable c.year##c.year was omitted citing multicollinearity as reason.


    Code:
    . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
    > P_INFL USDINR_EXC c.Year##c.Year , re
    note: c.Year#c.Year omitted because of collinearity.
    
    Random-effects GLS regression                   Number of obs     =        681
    Group variable: BankID                          Number of groups  =         39
    
    R-squared:                                      Obs per group:
         Within  = 0.5699                                         min =         15
         Between = 0.6987                                         avg =       17.5
         Overall = 0.6530                                         max =         18
    
                                                    Wald chi2(15)     =     920.17
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
    
    -------------------------------------------------------------------------------
     STRESS_SCORE | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    --------------+----------------------------------------------------------------
        LN_ASSETS |   852.2561   170.0258     5.01   0.000     519.0116    1185.501
         RISK_LEV |    27.7547   19.36566     1.43   0.152    -10.20129    65.71068
             GNPA |   12.03832   18.77313     0.64   0.521    -24.75635    48.83298
              PCR |  -4.035505   4.591998    -0.88   0.380    -13.03566    4.964646
              NIM |  -906.5539   215.4158    -4.21   0.000    -1328.761   -484.3466
       NONINT_INC |  -748.1694   245.9966    -3.04   0.002    -1230.314   -266.0249
        CONT_LIAB |   .0054839   .0003396    16.15   0.000     .0048183    .0061496
           OP_EFF |   479.4029   237.4127     2.02   0.043     14.08257    944.7232
           GDP_GR |  -64.94529   24.15464    -2.69   0.007    -112.2875   -17.60307
         GSEC_YLD |   115.9559   260.1435     0.45   0.656    -393.9159    625.8278
        WTAVG_CMR |   6.902367   116.1757     0.06   0.953    -220.7978    234.6026
        STABILITY |   .5993533   3.522829     0.17   0.865    -6.305264    7.503971
          CP_INFL |  -2.546553   49.51693    -0.05   0.959    -99.59795    94.50484
       USDINR_EXC |   57.17443   26.12808     2.19   0.029     5.964339    108.3845
             Year |  -113.7963   62.55224    -1.82   0.069    -236.3965    8.803796
                  |
    c.Year#c.Year |          0  (omitted)
                  |
            _cons |   219487.2   123282.9     1.78   0.075    -22142.84    461117.2
    --------------+----------------------------------------------------------------
          sigma_u |  1586.1843
          sigma_e |  1520.6156
              rho |   .5210955   (fraction of variance due to u_i)
    -------------------------------------------------------------------------------
    i) My first question is, why is this happening and should the outcome be interpreted as being "no quadratic trend in the dependent variable?"

    Afterwards, I came across posts which mentioned, "if you don't expect a time trend so much as just haphazard shocks to outcome from year to year, then add i.time to the list of dependent variables". Further, in field like Finance, most of the time the shock is haphazard rather than following a time trend. Both these statements are attributed to Clyde Schechter. Assuming, my dependent variable, banking stress to be the outcome haphazard shocks to bank-specific and macroeconomic parameters, I re-ran my model by including i.year as one of the independent variable, as follows.

    Code:
    . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
    > P_INFL USDINR_EXC i.Year, re
    note: 2017.Year omitted because of collinearity.
    note: 2018.Year omitted because of collinearity.
    note: 2019.Year omitted because of collinearity.
    note: 2020.Year omitted because of collinearity.
    note: 2021.Year omitted because of collinearity.
    note: 2022.Year omitted because of collinearity.
    
    Random-effects GLS regression                   Number of obs     =        681
    Group variable: BankID                          Number of groups  =         39
    
    R-squared:                                      Obs per group:
         Within  = 0.5756                                         min =         15
         Between = 0.6998                                         avg =       17.5
         Overall = 0.6552                                         max =         18
    
                                                    Wald chi2(25)     =     925.79
    corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
    STRESS_SCORE | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
       LN_ASSETS |   824.5139   171.8609     4.80   0.000     487.6728    1161.355
        RISK_LEV |   34.37259    19.7128     1.74   0.081    -4.263789    73.00897
            GNPA |   2.299177   20.09347     0.11   0.909    -37.08329    41.68165
             PCR |  -1.816186   4.874106    -0.37   0.709    -11.36926    7.736886
             NIM |   -915.265   228.8066    -4.00   0.000    -1363.718   -466.8124
      NONINT_INC |  -696.9691   251.4479    -2.77   0.006    -1189.798   -204.1403
       CONT_LIAB |   .0055769   .0003431    16.25   0.000     .0049043    .0062494
          OP_EFF |   426.0327    246.092     1.73   0.083    -56.29879    908.3643
          GDP_GR |  -82.44671    31.5042    -2.62   0.009    -144.1938   -20.69962
        GSEC_YLD |   335.9414   884.0082     0.38   0.704    -1396.683    2068.566
       WTAVG_CMR |   204.2107   270.3801     0.76   0.450    -325.7246     734.146
       STABILITY |   15.96176   34.55709     0.46   0.644    -51.76889    83.69242
         CP_INFL |   265.7651   459.0772     0.58   0.563    -634.0097     1165.54
      USDINR_EXC |  -42.01288   48.95287    -0.86   0.391    -137.9587    53.93299
                 |
            Year |
           2006  |  -584.4236   930.4732    -0.63   0.530    -2408.118     1239.27
           2007  |  -2037.475   2191.599    -0.93   0.353    -6332.929     2257.98
           2008  |  -2400.557   2484.468    -0.97   0.334    -7270.025    2468.911
           2009  |  -4409.829    4150.43    -1.06   0.288    -12544.52    3724.864
           2010  |  -3285.549   4798.677    -0.68   0.494    -12690.78    6119.686
           2011  |  -3744.712   4577.124    -0.82   0.413    -12715.71    5226.287
           2012  |  -5108.068   5756.694    -0.89   0.375    -16390.98    6174.845
           2013  |  -4399.575   4948.135    -0.89   0.374    -14097.74    5298.591
           2014  |  -3247.508   3938.395    -0.82   0.410    -10966.62    4471.604
           2015  |  -1828.772   2342.686    -0.78   0.435    -6420.353    2762.809
           2016  |  -706.4356   979.0437    -0.72   0.471    -2625.326    1212.455
           2017  |          0  (omitted)
           2018  |          0  (omitted)
           2019  |          0  (omitted)
           2020  |          0  (omitted)
           2021  |          0  (omitted)
           2022  |          0  (omitted)
                 |
           _cons |   -7901.26   5665.685    -1.39   0.163     -19005.8    3203.279
    -------------+----------------------------------------------------------------
         sigma_u |  1586.0957
         sigma_e |  1522.2238
             rho |  .52054002   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    ii) For the years retained in the outcome, the corresponding p-values demonstrate insignificant coefficients. Further, certain omitted years have been omitted owing to collinearity. In this regard, what should I infer from this outcome?
    iii) Even though my time period begins from 2005, why it is not included in the result ?

    Any help/ insight would be sincerely appreciated.

    Warm regards
    pankaj

  • #2
    Pankay:
    - when adjusted for the other predictors, time does not seem to play a relevant role in explaining variations in the regressand, regardless of being treated as continuous or categorical;
    - as far as your second regression is concerned, -testparm- will probably confirm the joint lack of statistical significance of -year-;
    - 2005 is omitted to protect your regression from the so-called "dummy trap" (https://en.wikipedia.org/wiki/Dummy_...le_(statistics)).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Immense thanks, Carlo Lazzaro for your explanations. However, I have a few add-on questions.

      i) As per my understanding, -testparm- is used for testing the joint significance of an interaction term used in the regression model. So, going by your suggestion should I proceed by including i.year#i.year as an explanatory variable, followed by testparm i.year#i.year (If that is the case, then a Prob > chi2 = 0.4076,which I have got indicates joint lack of significance of my time variable)?

      ii) Out of my curiosity, I also tried including different interaction terms, viz. a) c.year#i.BankID, b) i.year#i.BankID [insufficient observations, r(2001)], c) c.year#c.BankID, followed by running -testparm- command for a) and b). But, I am not at all sure regarding the correct use as well as distinction between i.varname and c.varname. Kindly explain, in the extant case which notation is appropriate and why?

      iii) Further c.year#i.BankID and c.year##i.BankID yield drastically different estimates of coefficients and standard errors. The STATA help document describes "##" as "binary operator to specify full-factorial interactions". This is rather difficult to understand, for a beginner like me. Would really appreciate if you could please elaborate on this.

      I'm providing the code and results as follows:

      a1) c.year#i.BankID with RE option:

      Code:
      . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
      > P_INFL USDINR_EXC c.Year#i.BankID , re
      
      Random-effects GLS regression                   Number of obs     =        681
      Group variable: BankID                          Number of groups  =         39
      
      R-squared:                                      Obs per group:
           Within  = 0.5736                                         min =         15
           Between = 1.0000                                         avg =       17.5
           Overall = 0.8571                                         max =         18
      
                                                      Wald chi2(53)     =    3759.58
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
      
      -------------------------------------------------------------------------------
       STRESS_SCORE | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      --------------+----------------------------------------------------------------
          LN_ASSETS |   513.6603   232.3058     2.21   0.027     58.34928    968.9714
           RISK_LEV |   15.30901   20.03911     0.76   0.445    -23.96693    54.58495
               GNPA |   5.166664   19.57698     0.26   0.792    -33.20352    43.53685
                PCR |  -2.811279   4.594855    -0.61   0.541    -11.81703    6.194471
                NIM |   -1116.39   220.8561    -5.05   0.000     -1549.26     -683.52
         NONINT_INC |  -843.8796   254.3214    -3.32   0.001     -1342.34   -345.4188
          CONT_LIAB |   .0054251    .000351    15.46   0.000     .0047372     .006113
             OP_EFF |   701.8006   243.4851     2.88   0.004     224.5785    1179.023
             GDP_GR |  -61.35027   23.99123    -2.56   0.011    -108.3722   -14.32833
           GSEC_YLD |   127.4235   258.1967     0.49   0.622    -378.6326    633.4797
          WTAVG_CMR |    7.55136   115.2908     0.07   0.948    -218.4144    233.5171
          STABILITY |   .8980517   3.493564     0.26   0.797    -5.949207    7.745311
            CP_INFL |   -3.69363   49.13355    -0.08   0.940    -99.99361    92.60635
         USDINR_EXC |   59.55686   25.92307     2.30   0.022     8.748577    110.3651
                    |
      BankID#c.Year |
                 1  |  -65.07088   67.56488    -0.96   0.336    -197.4956    67.35385
                 2  |  -64.91777   67.54612    -0.96   0.337    -197.3057     67.4702
                 3  |  -65.36596    67.5939    -0.97   0.334    -197.8476    67.11566
                 4  |  -64.22562   67.62317    -0.95   0.342    -196.7646    68.31337
                 5  |  -64.55482   67.61677    -0.95   0.340    -197.0813     67.9716
                 6  |  -65.16789   67.53365    -0.96   0.335    -197.5314    67.19563
                 7  |  -64.00537   67.61363    -0.95   0.344    -196.5256    68.51491
                 8  |  -64.94089   67.59064    -0.96   0.337    -197.4161    67.53433
                 9  |  -64.98173   67.42794    -0.96   0.335    -197.1381    67.17461
                10  |  -65.10238   67.55812    -0.96   0.335    -197.5139     67.3091
                11  |  -65.24061   67.53119    -0.97   0.334    -197.5993    67.11808
                12  |  -65.03724   67.51056    -0.96   0.335    -197.3555    67.28102
                13  |  -63.74751   67.61047    -0.94   0.346    -196.2616    68.76658
                14  |   -66.3829   67.65098    -0.98   0.326    -198.9764    66.21058
                15  |  -64.80124   67.55976    -0.96   0.337    -197.2159    67.61347
                16  |   -64.7711   67.57759    -0.96   0.338    -197.2207    67.67854
                17  |  -65.27499   67.51688    -0.97   0.334    -197.6056    67.05567
                18  |  -65.16537   67.49861    -0.97   0.334    -197.4602    67.12947
                19  |  -65.25847    67.4753    -0.97   0.333    -197.5076    66.99068
                20  |  -64.88498   67.45864    -0.96   0.336    -197.1015    67.33153
                21  |  -64.22781     67.527    -0.95   0.342    -196.5783    68.12266
                22  |  -65.06459   67.43127    -0.96   0.335    -197.2274    67.09826
                23  |  -64.96501   67.56893    -0.96   0.336    -197.3977    67.46766
                24  |   -65.2369   67.51279    -0.97   0.334    -197.5595    67.08574
                25  |  -63.79015   67.62799    -0.94   0.346    -196.3386    68.75828
                26  |  -65.20367   67.47407    -0.97   0.334    -197.4504    67.04308
                27  |  -59.94824   67.70965    -0.89   0.376    -192.6567    72.76023
                28  |  -65.00752   67.57296    -0.96   0.336    -197.4481    67.43304
                29  |  -64.89806   67.43736    -0.96   0.336    -197.0729    67.27674
                30  |  -65.39626   67.57234    -0.97   0.333    -197.8356    67.04309
                31  |  -64.61021   67.59635    -0.96   0.339    -197.0966    67.87619
                32  |  -65.20523   67.54674    -0.97   0.334    -197.5944    67.18395
                33  |  -65.16794   67.53418    -0.96   0.335    -197.5325    67.19662
                34  |  -65.47612   67.50608    -0.97   0.332    -197.7856    66.83337
                35  |  -64.76764   67.39726    -0.96   0.337    -196.8638    67.32857
                36  |  -64.62981   67.42137    -0.96   0.338    -196.7733    67.51364
                37  |  -64.62616   67.42462    -0.96   0.338     -196.776    67.52367
                38  |  -64.69877   67.41396    -0.96   0.337    -196.8277    67.43016
                39  |  -65.57487   67.60723    -0.97   0.332    -198.0826    66.93287
                    |
              _cons |     124867   132822.7     0.94   0.347    -135460.7    385194.6
      --------------+----------------------------------------------------------------
            sigma_u |          0
            sigma_e |  660.37025
                rho |          0   (fraction of variance due to u_i)
      
      testparm c.Year#i.BankID
      
       ( 1)  1b.BankID#c.Year = 0
       ( 2)  2.BankID#c.Year = 0
       ( 3)  3.BankID#c.Year = 0
       ( 4)  4.BankID#c.Year = 0
       ( 5)  5.BankID#c.Year = 0
       ( 6)  6.BankID#c.Year = 0
       ( 7)  7.BankID#c.Year = 0
       ( 8)  8.BankID#c.Year = 0
       ( 9)  9.BankID#c.Year = 0
       (10)  10.BankID#c.Year = 0
       (11)  11.BankID#c.Year = 0
       (12)  12.BankID#c.Year = 0
       (13)  13.BankID#c.Year = 0
       (14)  14.BankID#c.Year = 0
       (15)  15.BankID#c.Year = 0
       (16)  16.BankID#c.Year = 0
       (17)  17.BankID#c.Year = 0
       (18)  18.BankID#c.Year = 0
       (19)  19.BankID#c.Year = 0
       (20)  20.BankID#c.Year = 0
       (21)  21.BankID#c.Year = 0
       (22)  22.BankID#c.Year = 0
       (23)  23.BankID#c.Year = 0
       (24)  24.BankID#c.Year = 0
       (25)  25.BankID#c.Year = 0
       (26)  26.BankID#c.Year = 0
       (27)  27.BankID#c.Year = 0
       (28)  28.BankID#c.Year = 0
       (29)  29.BankID#c.Year = 0
       (30)  30.BankID#c.Year = 0
       (31)  31.BankID#c.Year = 0
       (32)  32.BankID#c.Year = 0
       (33)  33.BankID#c.Year = 0
       (34)  34.BankID#c.Year = 0
       (35)  35.BankID#c.Year = 0
       (36)  36.BankID#c.Year = 0
       (37)  37.BankID#c.Year = 0
       (38)  38.BankID#c.Year = 0
       (39)  39.BankID#c.Year = 0
      
                 chi2( 39) =  755.16
               Prob > chi2 =    0.0000
      a2) c.year#i.BankID with RE vce (cluster, panelid) option:

      Code:
      . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
      > P_INFL USDINR_EXC c.Year#i.BankID , re vce(cluster BankID)
      
      Random-effects GLS regression                   Number of obs     =        681
      Group variable: BankID                          Number of groups  =         39
      
      R-squared:                                      Obs per group:
           Within  = 0.5736                                         min =         15
           Between = 1.0000                                         avg =       17.5
           Overall = 0.8571                                         max =         18
      
                                                      Wald chi2(15)     =          .
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =          .
      
                                       (Std. err. adjusted for 39 clusters in BankID)
      -------------------------------------------------------------------------------
                    |               Robust
       STRESS_SCORE | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      --------------+----------------------------------------------------------------
          LN_ASSETS |   513.6603   685.1298     0.75   0.453    -829.1693     1856.49
           RISK_LEV |   15.30901   38.40252     0.40   0.690    -59.95854    90.57656
               GNPA |   5.166664   33.67276     0.15   0.878    -60.83074    71.16406
                PCR |  -2.811279   8.821738    -0.32   0.750    -20.10157    14.47901
                NIM |   -1116.39   385.2923    -2.90   0.004    -1871.549   -361.2309
         NONINT_INC |  -843.8796   415.2121    -2.03   0.042     -1657.68   -30.07892
          CONT_LIAB |   .0054251   .0025924     2.09   0.036     .0003441     .010506
             OP_EFF |   701.8006   305.9192     2.29   0.022       102.21    1301.391
             GDP_GR |  -61.35027   23.59884    -2.60   0.009    -107.6031    -15.0974
           GSEC_YLD |   127.4235   138.9062     0.92   0.359    -144.8276    399.6747
          WTAVG_CMR |    7.55136   69.34665     0.11   0.913    -128.3656    143.4683
          STABILITY |   .8980517   1.609505     0.56   0.577     -2.25652    4.052624
            CP_INFL |   -3.69363   21.29964    -0.17   0.862    -45.44015    38.05289
         USDINR_EXC |   59.55686   11.25074     5.29   0.000     37.50582    81.60789
                    |
      BankID#c.Year |
                 1  |  -65.07088   102.2604    -0.64   0.525    -265.4977    135.3559
                 2  |  -64.91777   102.1885    -0.64   0.525    -265.2035    135.3679
                 3  |  -65.36596   102.0917    -0.64   0.522    -265.4619      134.73
                 4  |  -64.22562   102.5067    -0.63   0.531    -265.1351    136.6838
                 5  |  -64.55482   102.4251    -0.63   0.529    -265.3043    136.1947
                 6  |  -65.16789   102.1428    -0.64   0.523    -265.3641    135.0283
                 7  |  -64.00537   102.4322    -0.62   0.532    -264.7688    136.7581
                 8  |  -64.94089   102.3997    -0.63   0.526    -265.6406    135.7588
                 9  |  -64.98173   101.6403    -0.64   0.523    -264.1931    134.2296
                10  |  -65.10238   102.2404    -0.64   0.524    -265.4898     135.285
                11  |  -65.24061   102.0809    -0.64   0.523    -265.3155    134.8342
                12  |  -65.03724   102.0493    -0.64   0.524    -265.0503    134.9758
                13  |  -63.74751   102.1177    -0.62   0.532    -263.8945    136.3995
                14  |   -66.3829   101.8812    -0.65   0.515    -266.0664    133.3006
                15  |  -64.80124   102.2995    -0.63   0.526    -265.3046    135.7021
                16  |   -64.7711   102.3394    -0.63   0.527    -265.3527    135.8105
                17  |  -65.27499   101.8137    -0.64   0.521    -264.8261    134.2761
                18  |  -65.16537   102.0125    -0.64   0.523    -265.1062    134.7754
                19  |  -65.25847   101.8222    -0.64   0.522    -264.8263    134.3093
                20  |  -64.88498   101.7656    -0.64   0.524    -264.3419    134.5719
                21  |  -64.22781   102.0714    -0.63   0.529    -264.2841    135.8285
                22  |  -65.06459   101.5444    -0.64   0.522     -264.088    133.9588
                23  |  -64.96501   102.3138    -0.63   0.525    -265.4964    135.5663
                24  |   -65.2369   102.0344    -0.64   0.523    -265.2206    134.7468
                25  |  -63.79015   102.5316    -0.62   0.534    -264.7484    137.1681
                26  |  -65.20367   101.8465    -0.64   0.522    -264.8192    134.4118
                27  |  -59.94824   102.4591    -0.59   0.558    -260.7644    140.8679
                28  |  -65.00752   102.3043    -0.64   0.525    -265.5202    135.5052
                29  |  -64.89806   101.6852    -0.64   0.523    -264.1974    134.4013
                30  |  -65.39626   102.3264    -0.64   0.523    -265.9524    135.1599
                31  |  -64.61021   102.3541    -0.63   0.528    -265.2206    136.0002
                32  |  -65.20523   102.1549    -0.64   0.523    -265.4252    135.0147
                33  |  -65.16794   102.1311    -0.64   0.523    -265.3411    135.0052
                34  |  -65.47612   101.7715    -0.64   0.520    -264.9445    133.9923
                35  |  -64.76764   101.3333    -0.64   0.523    -263.3773     133.842
                36  |  -64.62981   101.4694    -0.64   0.524    -263.5061    134.2465
                37  |  -64.62616   101.5249    -0.64   0.524    -263.6114    134.3591
                38  |  -64.69877   101.4542    -0.64   0.524    -263.5453    134.1478
                39  |  -65.57487   102.3829    -0.64   0.522    -266.2417    135.0919
                    |
              _cons |     124867   197643.6     0.63   0.528    -262507.3    512241.2
      --------------+----------------------------------------------------------------
            sigma_u |          0
            sigma_e |  660.37025
                rho |          0   (fraction of variance due to u_i)
      -------------------------------------------------------------------------------
      
      
      . testparm c.Year#i.BankID
      
       ( 1)  1b.BankID#c.Year = 0
       ( 2)  2.BankID#c.Year = 0
       ( 3)  3.BankID#c.Year = 0
       ( 4)  4.BankID#c.Year = 0
       ( 5)  5.BankID#c.Year = 0
       ( 6)  6.BankID#c.Year = 0
       ( 7)  7.BankID#c.Year = 0
       ( 8)  8.BankID#c.Year = 0
       ( 9)  9.BankID#c.Year = 0
       (10)  10.BankID#c.Year = 0
       (11)  11.BankID#c.Year = 0
       (12)  12.BankID#c.Year = 0
       (13)  13.BankID#c.Year = 0
       (14)  14.BankID#c.Year = 0
       (15)  15.BankID#c.Year = 0
       (16)  16.BankID#c.Year = 0
       (17)  17.BankID#c.Year = 0
       (18)  18.BankID#c.Year = 0
       (19)  19.BankID#c.Year = 0
       (20)  20.BankID#c.Year = 0
       (21)  21.BankID#c.Year = 0
       (22)  22.BankID#c.Year = 0
       (23)  23.BankID#c.Year = 0
       (24)  24.BankID#c.Year = 0
       (25)  25.BankID#c.Year = 0
       (26)  26.BankID#c.Year = 0
       (27)  27.BankID#c.Year = 0
       (28)  28.BankID#c.Year = 0
       (29)  29.BankID#c.Year = 0
       (30)  30.BankID#c.Year = 0
       (31)  31.BankID#c.Year = 0
       (32)  32.BankID#c.Year = 0
       (33)  33.BankID#c.Year = 0
       (34)  34.BankID#c.Year = 0
       (35)  35.BankID#c.Year = 0
       (36)  36.BankID#c.Year = 0
       (37)  37.BankID#c.Year = 0
       (38)  38.BankID#c.Year = 0
       (39)  39.BankID#c.Year = 0
             Constraint 1 dropped
             Constraint 2 dropped
             Constraint 3 dropped
             Constraint 4 dropped
             Constraint 5 dropped
             Constraint 6 dropped
             Constraint 8 dropped
             Constraint 10 dropped
             Constraint 11 dropped
             Constraint 13 dropped
             Constraint 15 dropped
             Constraint 16 dropped
             Constraint 17 dropped
             Constraint 18 dropped
             Constraint 19 dropped
             Constraint 20 dropped
             Constraint 22 dropped
             Constraint 23 dropped
             Constraint 24 dropped
             Constraint 26 dropped
             Constraint 27 dropped
             Constraint 28 dropped
             Constraint 29 dropped
             Constraint 30 dropped
             Constraint 31 dropped
             Constraint 32 dropped
             Constraint 36 dropped
             Constraint 37 dropped
             Constraint 38 dropped
      
                 chi2( 10) = 7863.14
               Prob > chi2 =    0.0000
      b) i.year#i.BankID (both RE as well as RE vce(cluster panelid) options yield the following result)

      Code:
      . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
      > P_INFL USDINR_EXC i.Year#i.BankID , re
      note: 2017.Year#39.BankID omitted because of collinearity.
      note: 2018.Year#39.BankID omitted because of collinearity.
      note: 2019.Year#39.BankID omitted because of collinearity.
      note: 2020.Year#11.BankID identifies no observations in the sample.
      note: 2020.Year#33.BankID identifies no observations in the sample.
      note: 2020.Year#39.BankID omitted because of collinearity.
      note: 2021.Year#1.BankID identifies no observations in the sample.
      note: 2021.Year#2.BankID identifies no observations in the sample.
      note: 2021.Year#10.BankID identifies no observations in the sample.
      note: 2021.Year#11.BankID identifies no observations in the sample.
      note: 2021.Year#22.BankID identifies no observations in the sample.
      note: 2021.Year#23.BankID identifies no observations in the sample.
      note: 2021.Year#28.BankID identifies no observations in the sample.
      note: 2021.Year#32.BankID identifies no observations in the sample.
      note: 2021.Year#33.BankID identifies no observations in the sample.
      note: 2021.Year#39.BankID omitted because of collinearity.
      note: 2022.Year#1.BankID identifies no observations in the sample.
      note: 2022.Year#2.BankID identifies no observations in the sample.
      note: 2022.Year#10.BankID identifies no observations in the sample.
      note: 2022.Year#11.BankID identifies no observations in the sample.
      note: 2022.Year#22.BankID identifies no observations in the sample.
      note: 2022.Year#23.BankID identifies no observations in the sample.
      note: 2022.Year#27.BankID omitted because of collinearity.
      note: 2022.Year#28.BankID identifies no observations in the sample.
      note: 2022.Year#29.BankID omitted because of collinearity.
      note: 2022.Year#30.BankID omitted because of collinearity.
      note: 2022.Year#31.BankID omitted because of collinearity.
      note: 2022.Year#32.BankID identifies no observations in the sample.
      note: 2022.Year#33.BankID identifies no observations in the sample.
      note: 2022.Year#34.BankID omitted because of collinearity.
      note: 2022.Year#35.BankID identifies no observations in the sample.
      note: 2022.Year#36.BankID omitted because of collinearity.
      note: 2022.Year#37.BankID omitted because of collinearity.
      note: 2022.Year#38.BankID omitted because of collinearity.
      note: 2022.Year#39.BankID omitted because of collinearity.
      insufficient observations
      r(2001);
      c) c.year#c.BankID

      Code:
      . xtreg STRESS_SCORE LN_ASSETS RISK_LEV GNPA PCR NIM NONINT_INC CONT_LIAB OP_EFF GDP_GR GSEC_YLD WTAVG_CMR STABILITY C
      > P_INFL USDINR_EXC c.Year#c.BankID , re vce(cluster BankID)
      
      Random-effects GLS regression                   Number of obs     =        681
      Group variable: BankID                          Number of groups  =         39
      
      R-squared:                                      Obs per group:
           Within  = 0.5684                                         min =         15
           Between = 0.7062                                         avg =       17.5
           Overall = 0.6537                                         max =         18
      
                                                      Wald chi2(15)     =     209.70
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
      
                                         (Std. err. adjusted for 39 clusters in BankID)
      ---------------------------------------------------------------------------------
                      |               Robust
         STRESS_SCORE | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      ----------------+----------------------------------------------------------------
            LN_ASSETS |   760.8765   362.0233     2.10   0.036     51.32391    1470.429
             RISK_LEV |   21.76206   26.48328     0.82   0.411    -30.14423    73.66834
                 GNPA |     6.7235     24.927     0.27   0.787    -42.13252    55.57952
                  PCR |  -4.244251   7.785897    -0.55   0.586    -19.50433    11.01583
                  NIM |  -900.6334   305.1166    -2.95   0.003    -1498.651   -302.6158
           NONINT_INC |  -782.4733    404.093    -1.94   0.053    -1574.481    9.534466
            CONT_LIAB |   .0054764   .0025953     2.11   0.035     .0003896    .0105631
               OP_EFF |   499.1268   304.1311     1.64   0.101    -96.95926    1095.213
               GDP_GR |  -61.30431   20.84577    -2.94   0.003    -102.1613   -20.44735
             GSEC_YLD |  -109.2341   169.3849    -0.64   0.519    -441.2225    222.7543
            WTAVG_CMR |    115.051    74.3601     1.55   0.122    -30.69206    260.7942
            STABILITY |  -2.383387   2.344442    -1.02   0.309    -6.978409    2.211635
              CP_INFL |   19.90034   19.13796     1.04   0.298    -17.60937    57.41005
           USDINR_EXC |   13.83076   14.96113     0.92   0.355    -15.49251    43.15404
                      |
      c.Year#c.BankID |    .007454   .0142748     0.52   0.602     -.020524     .035432
                      |
                _cons |   -5218.18   3285.393    -1.59   0.112    -11657.43    1221.072
      ----------------+----------------------------------------------------------------
              sigma_u |  1562.0057
              sigma_e |  1518.5899
                  rho |  .51409053   (fraction of variance due to u_i)
      ---------------------------------------------------------------------------------
      
      . testparm c.Year#c.BankID
      
       ( 1)  c.Year#c.BankID = 0
      
                 chi2(  1) =    0.27
               Prob > chi2 =    0.6015
      Really sorry for the long post. I didn't start a new post, thinking my queries are somewhat related.

      Thanks and regards
      pankaj

      Comment


      • #4
        Pankaj:
        i) you can also use -testparm- to investigate the joint statistical significance of the levels of a given categorical variable:
        Code:
        . use "https://www.stata-press.com/data/r17/nlswork.dta"
        (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
        
        . xtreg ln_wage i.year, vce(cluster idcode) re
        
        Random-effects GLS regression                   Number of obs     =     28,534
        Group variable: idcode                          Number of groups  =      4,711
        
        R-squared:                                      Obs per group:
             Within  = 0.1058                                         min =          1
             Between = 0.0796                                         avg =        6.1
             Overall = 0.0724                                         max =         15
        
                                                        Wald chi2(14)     =    1222.47
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
                                     (Std. err. adjusted for 4,711 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                year |
                 69  |   .0854251    .010206     8.37   0.000     .0654218    .1054285
                 70  |    .069889   .0103377     6.76   0.000     .0496275    .0901506
                 71  |   .1196013   .0108554    11.02   0.000     .0983252    .1408774
                 72  |   .1327835   .0117577    11.29   0.000     .1097388    .1558281
                 73  |   .1476736   .0117571    12.56   0.000     .1246302     .170717
                 75  |   .1609048   .0117319    13.72   0.000     .1379108    .1838989
                 77  |   .2207951   .0121478    18.18   0.000     .1969859    .2446044
                 78  |   .2596833   .0125969    20.61   0.000     .2349938    .2843729
                 80  |    .267724   .0128564    20.82   0.000     .2425259     .292922
                 82  |   .2852433   .0128913    22.13   0.000     .2599768    .3105098
                 83  |   .3126372    .013413    23.31   0.000     .2863482    .3389262
                 85  |   .3653587   .0129821    28.14   0.000     .3399143     .390803
                 87  |   .3813851    .013398    28.47   0.000     .3551256    .4076447
                 88  |   .4370689    .014508    30.13   0.000     .4086338    .4655041
                     |
               _cons |   1.426677   .0102438   139.27   0.000     1.406599    1.446754
        -------------+----------------------------------------------------------------
             sigma_u |  .36928787
             sigma_e |  .30294584
                 rho |  .59773703   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . testparm i.year
        
         ( 1)  69.year = 0
         ( 2)  70.year = 0
         ( 3)  71.year = 0
         ( 4)  72.year = 0
         ( 5)  73.year = 0
         ( 6)  75.year = 0
         ( 7)  77.year = 0
         ( 8)  78.year = 0
         ( 9)  80.year = 0
         (10)  82.year = 0
         (11)  83.year = 0
         (12)  85.year = 0
         (13)  87.year = 0
         (14)  88.year = 0
        
                   chi2( 14) = 1222.47
                 Prob > chi2 =    0.0000
        
        .
        ii) the -i.- and the -c.- prefix available from -fvvarlist- tells Stata that the prefixed variable is categorical or continuous, respectively;
        iii) "The Stata help document describes "##" as "binary operator to specify full-factorial interactions". This is the proper way to perform interactions: conditional main effects of the term included in the interaction + the interaction itself.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Many thanks Carlo Lazzaro for your explanations. I sincerely appreciate it.

          Warm regards
          pankaj

          Comment

          Working...
          X