Announcement

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

  • Condensing responses into single rows

    Hi all,
    Hoping that someone can help with a simple issue I'm having:

    I've cleaned a dataset that disaggregates absolute employment levels by age and gender, however, it is giving me output in a 'staggered' fashion.
    The output looks like:

    country year v1 v2 v3 ,

    with the year repeated for each variable response, with only one response per row year and the other variable responses missing.

    I cannot find anything online that deals with condensing the variables into a single row for each year, hence my asking here.

    Any help really appreciated! TIA






  • #2
    The collapse command seems like to be what you need. See the output of
    Code:
    help collapse

    Comment


    • #3
      Thanks, William. I had looked at collapsing earlier but managed to get it working now!
      Code used:
      collapse (firstnm) varlist, by(country year)

      Comment

      Working...
      X