Announcement

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

  • -qregplot- not working after -sqreg- command

    Respected STATA users,

    I'm carrying out simultaneous quantile regression for bank stress (dependent variable) against a set of bank-specific and macroeconomic variables (regressors). The code for my quantile regression is as follows.
    Code:
    . bs ,cluster(BankID) reps(50): sqreg  StrsScore Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA
    > GDPGr GsecYld CMR EPUInd CPInfl ExcUSD, q(.25 .5 .75 .9) reps(10)
    (running sqreg on estimation sample)
    
    Bootstrap replications (50)
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
    ..................................................    50
    
    Simultaneous quantile regression                    Number of obs =        678
      bootstrap(matrix) SEs                             .25 Pseudo R2 =     0.3923
                                                        .50 Pseudo R2 =     0.3922
                                                        .75 Pseudo R2 =     0.4043
                                                        .90 Pseudo R2 =     0.4711
    
                                     (Replications based on 39 clusters in BankID)
    ------------------------------------------------------------------------------
                 |   Observed   Bootstrap                         Normal-based
       StrsScore | coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
    q25          |
       Pub_Dummy |  -20.85779   170.5895    -0.12   0.903    -355.2071    313.4915
            CRAR |   3872.527   3674.086     1.05   0.292    -3328.549     11073.6
         RiskLev |  -126.6534   1779.982    -0.07   0.943    -3615.354    3362.048
            GNPA |   1962.972   2177.799     0.90   0.367    -2305.435    6231.379
             PCR |   -318.883   256.4405    -1.24   0.214    -821.4972    183.7312
             NIM |   8501.762   15272.87     0.56   0.578    -21432.51    38436.03
        CorpLoan |  -712.8953   839.1257    -0.85   0.396    -2357.551    931.7608
        ContLiab |   34.83963   59.26651     0.59   0.557    -81.32059    150.9999
           OpEff |   367.2685   15172.26     0.02   0.981    -29369.81    30104.35
            Size |   1077.843    307.201     3.51   0.000     475.7405    1679.946
             ROA |  -4738.515   6848.875    -0.69   0.489    -18162.06    8685.033
           GDPGr |   694.9678   863.9051     0.80   0.421    -998.2551    2388.191
         GsecYld |   13511.28   6737.399     2.01   0.045     306.2175    26716.34
             CMR |   2057.055   3480.896     0.59   0.555    -4765.376    8879.485
          EPUInd |    .986689   1.024109     0.96   0.335    -1.020527    2.993905
          CPInfl |   286.6625   1834.342     0.16   0.876    -3308.581    3881.906
          ExcUSD |    1.64282   6.780958     0.24   0.809    -11.64761    14.93325
           _cons |  -13157.21   3323.094    -3.96   0.000    -19670.36   -6644.067
    -------------+----------------------------------------------------------------
    q50          |
       Pub_Dummy |  -613.6502   478.9292    -1.28   0.200    -1552.334    325.0338
            CRAR |   1187.582   7522.683     0.16   0.875    -13556.61    15931.77
         RiskLev |   2857.945   6410.241     0.45   0.656    -9705.896    15421.79
            GNPA |   5798.067   5874.355     0.99   0.324    -5715.457    17311.59
             PCR |  -476.6581   519.1756    -0.92   0.359    -1494.223    540.9073
             NIM |   23343.17   32718.51     0.71   0.476    -40783.93    87470.27
        CorpLoan |  -1088.263    1440.96    -0.76   0.450    -3912.493    1735.966
        ContLiab |   2.510635   177.3275     0.01   0.989    -345.0448    350.0661
           OpEff |  -31671.34    32713.8    -0.97   0.333     -95789.2    32446.53
            Size |    1357.99    513.537     2.64   0.008     351.4759    2364.504
             ROA |   10821.25    18879.6     0.57   0.567    -26182.08    47824.58
           GDPGr |   891.5161   2263.199     0.39   0.694    -3544.272    5327.304
         GsecYld |   15795.91   15906.29     0.99   0.321    -15379.85    46971.66
             CMR |   4750.591   8297.716     0.57   0.567    -11512.63    21013.82
          EPUInd |   -.642661   2.097396    -0.31   0.759    -4.753481    3.468159
          CPInfl |   3216.868   3780.729     0.85   0.395    -4193.225    10626.96
          ExcUSD |  -6.430677   15.74565    -0.41   0.683    -37.29159    24.43024
           _cons |  -15049.56   4099.822    -3.67   0.000    -23085.06   -7014.057
    -------------+----------------------------------------------------------------
    q75          |
       Pub_Dummy |  -2405.138   1180.887    -2.04   0.042    -4719.633   -90.64252
            CRAR |  -5261.481   16669.42    -0.32   0.752    -37932.94    27409.98
         RiskLev |   15767.13   12272.97     1.28   0.199    -8287.446    39821.71
            GNPA |   11857.38   9338.862     1.27   0.204     -6446.45    30161.21
             PCR |  -1081.995   1133.426    -0.95   0.340     -3303.47    1139.479
             NIM |   84654.67   68679.59     1.23   0.218    -49954.85    219264.2
        CorpLoan |  -1674.921   4125.278    -0.41   0.685    -9760.318    6410.475
        ContLiab |    51.5477    315.326     0.16   0.870    -566.4799    669.5753
           OpEff |  -131572.4   65211.25    -2.02   0.044    -259384.1    -3760.68
            Size |   2385.437   972.8664     2.45   0.014     478.6535     4292.22
             ROA |   31350.95    27096.7     1.16   0.247    -21757.62    84459.51
           GDPGr |  -4051.422   6294.057    -0.64   0.520    -16387.55    8284.703
         GsecYld |  -16649.94   34526.47    -0.48   0.630    -84320.57     51020.7
             CMR |   172.0239   18270.48     0.01   0.992    -35637.46    35981.51
          EPUInd |    -2.7326    4.59608    -0.59   0.552    -11.74075    6.275552
          CPInfl |   2101.472   6473.141     0.32   0.745    -10585.65    14788.59
          ExcUSD |  -67.44847   44.29112    -1.52   0.128    -154.2575    19.36052
           _cons |  -18690.94   6137.265    -3.05   0.002    -30719.76   -6662.121
    -------------+----------------------------------------------------------------
    q90          |
       Pub_Dummy |  -4908.674   2730.773    -1.80   0.072    -10260.89    443.5425
            CRAR |  -13911.22   22203.88    -0.63   0.531    -57430.03     29607.6
         RiskLev |   30817.79   15769.35     1.95   0.051    -89.56352    61725.15
            GNPA |    2036.85   18657.22     0.11   0.913    -34530.63    38604.33
             PCR |  -2076.407   1701.709    -1.22   0.222    -5411.695    1258.882
             NIM |   131808.2   127650.5     1.03   0.302    -118382.3    381998.6
        CorpLoan |   3151.998     7982.4     0.39   0.693    -12493.22    18797.21
        ContLiab |  -260.1755   616.1355    -0.42   0.673    -1467.779    947.4278
           OpEff |  -166311.9   116407.7    -1.43   0.153    -394466.8    61842.96
            Size |   4176.501   2030.658     2.06   0.040     196.4851    8156.517
             ROA |   11561.72   73442.12     0.16   0.875    -132382.2    155505.6
           GDPGr |   -6103.03   12714.39    -0.48   0.631    -31022.77    18816.71
         GsecYld |   -62003.7   94827.04    -0.65   0.513    -247861.3    123853.9
             CMR |  -3367.681   35525.52    -0.09   0.924    -72996.43    66261.07
          EPUInd |  -13.12599   9.869798    -1.33   0.184    -32.47044    6.218454
          CPInfl |   7779.092   12248.71     0.64   0.525    -16227.95    31786.13
          ExcUSD |  -144.4712   105.0964    -1.37   0.169    -350.4565      61.514
           _cons |  -26707.58   9869.634    -2.71   0.007    -46051.71   -7363.452
    ------------------------------------------------------------------------------
    I intend to plot the coefficients of my quantile regreession, variable wise, using -qregplot- command. I've tried using various combination of quantiles, but to no avail. I also learnt that -sqreg- suppresses -qregplot, q()-. Accordingly, I have tried running -qregplot- without specifying quantiles as well. But, I amm getting the following error, in each instance.

    Code:
    . qregplot Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA GDPGr GsecYld CMR EPUInd CPInfl ExcUSD
    invalid 'q'
    If the above message is not useful, please contact me at [email protected]
    Code:
    . qregplot Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA GDPGr GsecYld CMR EPUInd CPInfl ExcUSD
    > , q(0.05 (0.05) 0.95)
    invalid 'q'
    If the above message is not useful, please contact me at [email protected]
    Code:
    . qregplot Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA GDPGr GsecYld CMR EPUInd CPInfl ExcUSD
    > , q(0.25 0.50 0.75 0.90)
    invalid 'q'
    If the above message is not useful, please contact me at [email protected]
    Kindly, advise where i'm going wrong. Does -qregplot- works after -sqreg- with bootsrapped and clustered options. Any suggestion would be highly appreciated

    Thanks
    pankaj
    Last edited by pankaj swain; 17 Sep 2023, 14:35.

  • #2
    Hi
    what happens is that if you use sqreg qregplot will get the quantiles from the regression itself.
    in other words you cannot specify “q()” after sqreg
    if you change sqreg with bsqreg it should work
    best wishes

    Comment


    • #3
      Thanks a lot. I would definitely give -bsqreg- a try.

      If I interpret your suggestion correctly, had I used -sqreg- without specifying quantiles, -qregplot- would have worked just fine. Kindly clarify, if I am right.

      In case my interpretation is right, kindly take a look at https://www.youtube.com/watch?v=tlv1uP_b0jU. In this video, estimation has been performed with -sqreg- and q(0.25 0.5 0.75) duly specified, followed by -qregplot-, which works nicely. I'm broadly following the same steps, with additional cluster and bootstrap options for my -sqreg- estimation, but -qregplot- is showing error. So, can I attribute the errors to the use of bootstrap and cluster options that I am using for my -sqreg- estimation?

      Many thanks
      pankaj
      Last edited by pankaj swain; 17 Sep 2023, 22:56.

      Comment


      • #4
        Oh my mistake
        i didn’t notice you were using “bs” as prefix.
        sqreg does use bootstrap standard errors automatically
        so you need to modify the clustering within the vce options.
        qregplot will not work in the previous command started with any prefix

        Comment


        • #5
          Just did a double check, and unfortunately, neither sqreg, bsqreg or qreg will allow for clustered standard errors.

          Comment


          • #6
            After going through relevant statlist discussions, I too came to a conclusion that, none of the original STATA commands, viz. -qreg-, -sqreg- and -bsqreg- would allow for clustered standrad erros, and one has to resort to community contributed commands like -qreg2-.

            I have another doubt. While referring to help -qreg-, I found different options for -bsqreg- estimation, viz. specifying desired quantiles as well as the number of repetitions. However, I encountered errors while carrying out estimation using -bsqreg-, with quantiles being specified. Without quantile, there is no such issue.Kindly take a look at my code. Please, advise whether I am using a wrong code.

            Code:
             bsqreg  StrsScore Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA GDPGr GsecYld CMR EPUInd CPIn
            > fl ExcUSD, q(.25 .5 .75 .9) reps(50)
            option q() not allowed
            Many thanks in advance
            pankaj

            Comment


            • #7
              Right, bsqreg doesnt estimate simulatenous quantiles (sqreg) it estimates quantiles with Bootstrap Standard errors)
              Best approach:

              Code:
              bsqreg StrsScore Pub_Dummy CRAR RiskLev GNPA PCR NIM CorpLoan ContLiab OpEff Size ROA GDPGr GsecYld CMR EPUInd CPInfl ExcUSD, reps(50)
              qregplot Pub_Dummy CRAR RiskLev, q(10 25 50 75 90)
              HTH F

              Comment


              • #8
                Many thanks for your helpful suggestions. The command suggested by you worked fine for me.

                Regrads
                pankaj

                Comment

                Working...
                X