Announcement

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

  • converting to panel data on the basis of county and year

    In the following data nails_ed indicates which industry sector. 14 and 15 indicate the same industry. Therefore for each county in a specific year ( ranging from 2006-2015) I want to sum up the value of these variables - est , emp and wage. So that it shows up as a single industry ( combined industry) with summed up value of variables - est , emp and wage. As a result, the whole data shows up as a panel data. Right now for each county and each septic year the data is showing up twice. This is restricting from making it panel data on just county and year basis.

    Can anyone help to make it panel data on the basis of county and year only ?

    dataex naics_ed county year est emp wage

    ----------------------- copy starting from the next line -----------------------
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input byte naics_ed float(county year) double(est emp wage)
    14 10001 2006 2436  31525  765616
    15 10001 2006  684   6614  141700
    14 10001 2007 2459  31603  822536
    15 10001 2007  696  11058  218329
    14 10001 2008 2366  31011  796655
    15 10001 2008  624   9899  216425
    14 10003 2006 8570 127724 3399478
    15 10003 2006 2300  37814  732659
    14 10003 2007 8397 128643 3381265
    15 10003 2007 2228  38334  749243
    14 10003 2008 8030 121408 3142924
    15 10003 2008 2160  36999  736681
    14 10003 2009 7844 109367 2841905
    15 10003 2009 2096  36263  714533
    14 10005 2013 4426  48624 1228617
    15 10005 2013 1124   5232  146028
    14 10005 2014 4349  49325 1258134
    15 10005 2014 1116   4927  148350
    14 10005 2015 4385  52227 1385841
    15 10005 2015 1180   9752  243406
    end

  • #2
    Code:
    collapse (sum) est emp wage, by(country year)
    xtset country year
    See

    Code:
    help collapse

    Comment


    • #3
      thanks so much ! it worked perfectly

      Comment

      Working...
      X