Announcement

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

  • Expaning panel dataset to include previous and next years

    My data is in following format.
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long gvkey int fyear byte policy
     4201 2000 0
     9240 2000 1
    17198 2001 0
    31392 2001 1
    65922 2002 0
    66599 2002 1
    end
    I want to expand the data such that each firm(i.e. gvkey) should have 5 years of pre and post rows. Can someone help with this.

  • #2
    So, which years do you want and where are policy values to come from?

    Comment


    • #3
      For the firms in the year 2000, I want to expand the data from 1995 to 2005 and like wise. The policy variable is for indicating policy intervention for each firm. It comes from a separate dataset. I created matched counterparts for each firm that did not have policy intervention in that year.

      Comment


      • #4
        If I understand this correctly, you want to merge with another dataset. That is fine, but it's pointless to expand this one first as merge will automatically add the information automatically if it exists. Other way round, if there is defensible interpolation or imputation to be done it is better done after the merge.

        Comment

        Working...
        X