Announcement

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

  • Transpose / reshape panel to wide form with repeated elements

    Hi,

    I am trying to transpose the following:
    ID Country TIME NACE OCC_ROU EMP
    1 UK 2008 A Routine 83
    1 UK 2008 A Abstract 47
    1 UK 2008 A Manual 96
    1 UK 2009 A Routine 12
    1 UK 2009 A Abstract 15
    1 UK 2009 A Manual 18
    into:
    ID Country TIME NACE ROUTINE ABSTRACT MANUAL
    1 UK 2008 A 83 47 96
    1 UK 2009 A 12 15 18
    I'm having issues with the standard reshape wide stub, i(var) j(var) due to the repeated values for each ID, NACE & TIME.

    The ID is unique to each country-NACE pairing (more countries, years and NACE in the rest of my data). I'm wondering if anyone can help?

    Thanks


  • #2
    SOLVED

    egen idtemp = group(Country NACE TIME)
    reshape wide EMP, i(idtemp) j(OCC_ROU)

    Comment

    Working...
    X