Announcement

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

  • How can I convert individual dataset into county-level dataset?

    Hi, STATA users!

    I'm currently working on census population data.
    The original data was collected from individual responses.
    But I need is a dataset where observations are US counties, and the values filled with total count of a specific binary variable by each county.

    For example, if the original dataset looks like:
    obs. county var
    001 A 0
    002 A 0
    003 A 1
    004 A 1
    005 B 0
    006 B 0
    007 B 0
    008 B 0
    009 B 1

    The new dataset would be:
    obs newer (count of var in each county)
    A 2
    B 1
    The huge volume of data (obs of 68,124,190, and categories of county variable is more than 3000) makes it difficult to work manually.
    Is there any good way to do this in STATA?

  • #2
    see
    Code:
    help collapse
    help contract

    Comment

    Working...
    X