Announcement

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

  • CSDID with unbalanced data

    Hi All,
    I am using CSDID command, I have unbalanced panel data on more than 3000 firms from 1988-2020, since some of the ids were treated in the first year itself i.e., 1988, i constructed the clone year of 1987 where no ids were treated. Now when I use the command some of the results for years omitted.
    if possible can you please help me with this.
    Below is the command i am using:
    set seed 1
    gen sample = runiform()<.9
    csdid lnirddintensity lnipd if sample==1, ivar(id) time(year) gvar(treat) method(reg)

    i have also used the default method but getting the issue.
    @FernandoRios

  • #2
    First things first
    can you provide the following
    tab year treat

    That will show me if the data is correctly setup and which years could be potentially dropped

    Comment


    • #3
      Thank you so much for your reply.
      Here you go
      year treat
      0 1988 1989 1991 1994 1995 1996 1997 1998 2005 2016 Total
      1987 12 545 34 416 233 37 9 67 54 190 16 1613
      1988 13 575 36 437 244 38 9 68 58 201 17 1696
      1989 14 606 36 459 256 40 11 68 61 214 17 1782
      1990 14 629 37 484 266 43 13 70 62 223 18 1859
      1991 14 659 39 509 278 45 15 76 64 241 18 1958
      1992 14 687 41 532 288 46 15 82 66 261 20 2052
      1993 14 709 45 552 294 54 17 84 70 277 22 2138
      1994 14 741 45 577 308 57 19 88 74 290 24 2237
      1995 18 772 50 599 325 61 22 89 79 304 24 2343
      1996 18 796 51 614 350 62 22 93 79 313 25 2423
      1997 18 813 52 630 370 64 22 93 85 324 26 2497
      1998 18 837 53 647 379 66 22 93 87 329 27 2558
      1999 19 855 54 654 390 67 22 94 91 337 29 2612
      2000 19 871 54 663 402 71 23 98 94 342 29 2666
      2001 19 879 54 671 406 71 23 100 96 352 30 2701
      2002 19 885 55 675 415 71 24 101 97 361 30 2733
      2003 19 894 55 685 421 72 24 102 97 369 30 2768
      2004 19 909 57 692 442 72 25 102 97 379 30 2824
      2005 19 929 58 705 448 72 25 103 98 393 30 2880
      2006 19 950 59 719 459 73 25 106 98 396 31 2935
      2007 19 977 60 729 473 74 25 109 99 401 31 2997
      2008 20 990 60 737 486 74 25 113 100 406 31 3042
      2009 20 1000 60 745 488 74 26 113 101 407 31 3065
      2010 20 1007 60 748 495 74 26 113 101 408 31 3083
      2011 20 1022 60 755 502 74 26 113 101 409 31 3113
      2012 20 1025 60 758 503 74 26 114 101 409 31 3121
      2013 20 1035 60 763 504 74 27 114 101 412 31 3141
      2014 20 1037 60 764 507 74 27 114 101 412 31 3147
      2015 20 1041 61 765 509 74 27 114 102 414 31 3158
      2016 20 1041 62 767 509 74 27 114 102 416 31 3163
      2017 20 1041 62 767 509 74 27 114 102 417 31 3164
      2018 20 1041 62 767 509 74 27 114 102 417 31 3164
      2019 20 1041 62 767 509 74 27 114 102 417 31 3164
      2020 20 1041 62 767 509 74 27 114 102 417 31 3164
      Total 612 29880 1816 22519 13986 2218 757 3364 3024 11858 927 90961

      Comment


      • #4
        @FernandoRios any update?

        Comment


        • #5
          There is nothing obvious about the problem
          my guess is the panel is not appropriate or some
          covRiates are missing

          Comment


          • #6
            When I am using the default method then drops (omissions) are more but with reg produces good results [ can I use reg method instead of default method?].
            Can you please guide me to plot the calendar ATT. I am not aware of the code for the same. @FernandoRios

            Comment


            • #7
              In that case other methods may be trying to force balance when there is none. This omitting cases.
              for calendar plot
              estat calendar
              csdid_plot

              Comment


              • #8
                Thanks @FernandoRios.
                I have one another doubt.
                Click image for larger version

Name:	Calendar Aggregation.png
Views:	1
Size:	138.0 KB
ID:	1743045

                When I am plotting graphs for different aggregation then what does the rectangular region indicates?
                For example, in the following image what is the interpretation of the blue region since the triangles shows the ATT of particular aggregation? can one also observe the significance of the coefficients based on the plot?
                Thanks once again.

                Comment


                • #9
                  @FernandoRios, sorry for disturbing you again, if possible reply.

                  Comment


                  • #10
                    The regions are the 95% CI

                    Comment

                    Working...
                    X