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:
The new dataset would be:
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?
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 |
Is there any good way to do this in STATA?
Comment