Announcement

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

  • Issue with xtdidregress implementation

    BANK Year PRE=0/POST=1 ROE(%) Inflation Rate (%) Gross Domestic Product growth rate (%) Real Interest rate Total assets Bank Size (Natural log of Total Assets)
    1 2012 0 20.64 7.934386 5.456389 2.473522 4,47,321.47 13.01103278
    1 2013 0 15.07 6.186504 6.386106 3.865993 5,47,135.44 13.21245166
    1 2014 0 13.36 3.331757 7.410228 6.695176 6,59,504.53 13.39924413
    1 2015 0 8.96 2.279588 7.996254 7.556488 7,14,988.55 13.4800218
    1 2016 0 -13.48 3.237975 8.256305 6.232711 6,71,376.48 13.41708533
    1 2017 1 3.44 3.969258 6.795383 5.327609 6,94,875.42 13.45148786
    1 2018 1 -5.81 3.88424 6.453851 5.361666 7,19,999.77 13.48700617
    1 2019 1 0.97 2.405517 3.871437 6.894875 7,80,987.40 13.5683143
    1 2020 1 0.84 4.746549 -5.83105 4.20391 11,57,915.52 13.96213198
    1 2021 1 1.11 8.538525 9.050278 0.147236 11,55,364.77 13.95992667
    1 2022 1 8.93 8.225869 7.239693 0.315334 12,77,999.83 14.06080678
    2 2012 0 14.00 7.934386 5.456389 2.473522 3,84,535.47 12.85979132
    2 2013 0 12.25 6.186504 6.386106 3.865993 4,52,602.72 13.02277002
    2 2014 0 10.14 3.331757 7.410228 6.695176 5,73,190.20 13.25897288
    2 2015 0 5.57 2.279588 7.996254 7.556488 6,18,697.76 13.33537216
    2 2016 0 -19.50 3.237975 8.256305 6.232711 6,09,913.93 13.32107312
    2 2017 1 -5.04 3.969258 6.795383 5.327609 6,26,309.27 13.34759956
    2 2018 1 -18.23 3.88424 6.453851 5.361666 6,09,574.83 13.32051699
    2 2019 1 -14.37 2.405517 3.871437 6.894875 6,25,222.84 13.34586342
    2 2020 1 -6.92 4.746549 -5.83105 4.20391 6,56,995.48 13.39543242
    2 2021 1 4.83 8.538525 9.050278 0.147236 7,25,856.45 13.49510754
    2 2022 1 6.75 8.225869 7.239693 0.315334 7,34,614.01 13.50710049
    3 2012 0 9.91 7.934386 5.456389 2.473522 91,137.39 11.42012338
    3 2013 0 13.66 6.186504 6.386106 3.865993 1,16,952.81 11.66952576
    3 2014 0 5.61 3.331757 7.410228 6.695176 1,36,320.05 11.82276072
    3 2015 0 5.84 2.279588 7.996254 7.556488 1,46,018.79 11.89149061
    3 2016 0 1.19 3.237975 8.256305 6.232711 1,60,957.32 11.98889454
    This is my dataset similar to this there are total of 12 banks in the dataset.

    I want to perform DID to understand effect of implementation of a law on banks which is defined in binary column PRE=0/POST=1. ROE is dependent, rest are independent.

    * Set up the dataset with panel structure
    xtset BANK Year

    * Generate the treatment dummy variable
    gen treat_dummy_var = (PRE0POST1 == 1)

    * Generate the post-treatment dummy variable
    gen post_time_dummy = (Year >= 2017)

    * Generate the interaction term for DID
    gen did = treat_dummy_var * post_time_dummy

    * Run xtdidregress with fixed effects specified for the bank and time fixed effects
    xtdidregress (ROE InflationRate GrossDomesticProductgrowthrate RealInterestrate BankSizeNaturallogofTotalAssets) (did), group(BANK) time(Year)


    Performed these commands for the last command getting this, please help out.
    xtdidregress (ROE InflationRate GrossDomesticProductgrowthrate RealInterestrate BankSizeNaturallogofTotalAssets) (did), group(BANK) time(Year)
    invalid group specification
    None of the groups defined by BANK is a control.
    r(198);

    Would be really grateful for any answers. Thank You!

  • #2
    Are some banks treated and others not? Which variable marks the treated?

    Comment


    • #3
      Dear George Ford ,

      Have treated all the banks

      g treat = cond(pre0post1 == 1 & year >= 2017, 1, 0)

      xtset bank year

      xtdidregress ( banksizenaturallogoftotalassets ) (treat), group( bank) time (year)


      These are the commands which I have used

      Comment


      • #4
        Sharing the dataset so you can review it
        Click image for larger version

Name:	dataset screenshot stata.png
Views:	2
Size:	26.3 KB
ID:	1752254

        Comment


        • #5
          Dear Kiran,

          I think your issue might be that there is no bank for which all values of the variable -treat- is zero for every period in the estimation sample. This is what the error message is saying. It suggest that all banks eventually are subject to the law and none of them remain untreated, i.e. none of them are controls. There is an FAQ on the topic that might help you diagnose the issue.

          https://www.stata.com/support/faqs/s...specification/



          Comment


          • #6
            Thank You for the reply, got the issue I have marked treated to all the banks in my dataset. As per the case in the dataset, there was a law which applied to all the banks after 2017 and due to this, I have marked all the banks as treated after 2017. And as per the response, I got to know maybe DID cannot work for this case.

            Comment


            • #7
              No control group=no DID

              Comment

              Working...
              X