Announcement

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

  • DID model for non-panel data

    Hi everyone,

    I want to apply the DID model to non-panel data, given the following issue:
    What is the contribution of agricultural policy to achieving food security in the country?

    I have a dependent variable representing food security yt,
    and independent food variables xti,
    and other non-food variables zti that are not affected by agricultural policies.

    I encountered a problem in structuring the data, which does not include cross-section. On the other hand, I have the policy and a set of variables affected by the policy and a second set that is not affected by it.

    Please help, and thank you in advance.

  • #2
    pooled cross section?

    are some units receiving the policy treatment and others not?

    Comment


    • #3
      Thank you for response,

      No, there are no units,

      Yes, Yi and Xi is affected by politics, and Zi is not,

      The data structure below, is there a command in STATA for this structure? Or do you estimate the DID manually?
      YEARS POLICY Y X1 X2 X3 X4 X5 X6 Z1 Z2 Z3
      1990 0 216 2,6 1391 5334 9,02 116777 7700 34,944 26,76994 1,6
      1991 0 184 3,08 1096 4647 9,8 191500 7950 34,944 24,30406 1,464423
      1992 0 210 4,41 1128 5441 12,88 123000 8116 33,389 22,2882 1,337898
      1993 0 203,68 4,15 1193 5414 15,96 106335 8095,07 32,836 20,93612 1,229477
      1994 0 148,76 3,31 1023 4045 22,16 102381 8069,26 32,382 21,85831 1,148209
      1995 0 153,99 3,26 1084 4280 23,2 98995 8070 30,587 22,0412 1,103148
      1996 0 173,63 4,26 1154 4729 28 100902 8081 32,199 21,24599 1,103345
      1997 0 148,6 4,2 1180 4519 28,51 101897 8202,72 33,295 20,42303 1,157851
      1998 0 179,93 2,31 1200 5267 36,02 100886 8215 32,461 24,68631 1,275718
      1999 0 164,7 3,92 1250 5075 42,34 101472 8227 31,52 24,17799 1,465998
      2000 1 140,41 4 1288 4599 43,53 102550 8226 30,789 25,49091 1,737741
      2001 1 162,57 5,02 2591 5488 56,76 101578 8169,23 31,677 27,09684 2,1
      2002 1 167,78 4,3 2660 5209 75,45 105398 8205,05 32,087 29,40007 2,557947
      2003 1 208,51 3,64 2729 6589 94,21 108142 8160 32,827 30,84067 3,101237
      2004 1 248,58 3,22 1617 8032 85,11 106166 8196,82 35,219 33,52381 3,715646
      2005 1 242,25 3,13 1381 7866 90,05 112474 8389,64 36,01 36,17219 4,386951
      2006 1 261,31 3,04 1610 8812 112,92 114781 8414,67 37,051 38,66807 5,100928
      2007 1 290,37 2,97 2220 10105 201,04 116112 8414,67 36,179 42,57355 5,843352
      2008 1 321,75 3,27 2244 11197 308,56 117179 8414,67 36,975 47,76752 6,6
      2009 1 365,24 2,86 2358 12775 393,75 120306 8423,34 37,221 53,92953 6,84593
      2010 1 382,6 2,66 2420 13644 335,59 113993 8435,03 37,556 58,18996 6,858818
      2011 1 442,43 2,66 2443 16111 392,44 111498 8445,49 37,686 59,29557 6,6
      2012 1 488,97 3,02 2477 18334 301,26 113156 9032,7 37,393 64,69147 6,059339
      2013 1 537,24 4,76 2529 20573 129,61 115408 8461,87 38,958 70,31963 5,340795
      2014 1 556,12 5,26 2551 21967 203,52 118336 8465,04 36,58 76,29679 4,576853
      2015 1 493,41 6,33 4960 19718 315,96 120046 8488,03 37,033 80,26423 3,9
      2016 1 478,78 8,49 2545 19477 271,43 121133 8494,57 37,6 82,51162 3,41454
      2017 1 492,92 7,32 2609 20565 151,65 122343 8534,6 36,805 83,83181 3,112058
      2018 1 487,55 12,02 2649 20769 157,77 122089 5522,41 36,706 85,59228 2,955959
      2019 1 588,16 13,42 2694 25291 235,6 123069 5724,78 36,642 85,07873 2,909647
      2020 1 469,07 16,6 2650 20756,16 209,53 123864 7240,49 33,893 78,95306 2,936526
      2021 1 450,54 14,2 2650 19903,89 214,97 124659 8509,57 34,39 79,26887 3
      Last edited by Brahim KHOUILED; 27 Jul 2024, 18:21.

      Comment


      • #4
        Based on what you show, there is no DID estimation for this data, neither in Stata, nor manually. What you show here is nothing more than a single time series of data with onset of a policy in year 2000. The best you can do with this data is compare the pre- and post- distributions of the outcome variable, with adjustment for the X's and Z's. This is a very weak model for estimating causal effects, though I suppose it is better than nothing.

        In order to do a DID estimation you would need data that included multiple countries, some of which never adopted the policy in question. Or multiple countries, all of which adopted the policy in question but at different times. But without that, you are left with what you have: a single time series and a pre-post comparison. In the end, you will be unable to defend any findings you make from this data against the alternative that something other than the policy adoption happened in this country also happened in 2000 and accounts for any observed "effect" of the policy.

        Comment


        • #5
          Thank you Clyde!

          In fact, I have a good understanding of the DID model and have already applied it using Stata and other software. The data I presented can be used in a regression model with interactive variables to reveal the impact of policy on various types of variables.

          So, I raised the issue to see if there might be a way to apply DID to non-panel data. As an initial idea, I considered longitudinally aggregating the data and classifying it into two groups: affected and unaffected by the policy (treatement). Additionally, I thought about coding the variables as if they were units, provided they have the same units of measurement, such as percentages.

          What do you think of this method? Or do you have any similar suggestions? Always within the framework of DID models.

          Comment


          • #6
            No, there is no way to apply the DID framework to this data. DID is the initialism for Difference In Differences, which is the short form of Between Group Difference of Pre-Post Differences. That the last Differences is plural is not some syntactic oddity of English. It really means it: you have to have more than one Group, and then you calculate the pre-post difference in each group, and then calculate the difference between those differences. A simple time series has only one group--there are no differences to take the difference of.

            Comment


            • #7
              Understood!

              Meaning there is no hope with this data, a second group as a control group is necessary..

              Thanks Clyde.
              Last edited by Brahim KHOUILED; 28 Jul 2024, 17:27.

              Comment

              Working...
              X