In the following data
2000 -2022 County-level: Expanded Races (White, Black, American Indian/Alaska Native, Asian/Pacific Islander) by Origin (Hispanic, Non-Hispanic);
County-level population files with 19 age groups (<1, 1-4, ..., 80-84, 85+)
I want to create a panel dataset and calculate the total population for different races, sexes, and age groups (20-64 years) separately for each county and year level (2000-2022). How can i code that on stata ?
This is the description of my data
This is the sample of my data
2000 -2022 County-level: Expanded Races (White, Black, American Indian/Alaska Native, Asian/Pacific Islander) by Origin (Hispanic, Non-Hispanic);
County-level population files with 19 age groups (<1, 1-4, ..., 80-84, 85+)
I want to create a panel dataset and calculate the total population for different races, sexes, and age groups (20-64 years) separately for each county and year level (2000-2022). How can i code that on stata ?
This is the description of my data
Code:
1 White 2 Black 3 Other (1969+)/American Indian/Alaska Native (1990+) 4 Asian or Pacific Islander (1990+) hispanic: 0 Non-Hispanic 1 Hispanic 9 Not applicable in 1969-2004 W sex: 1 Male 2 Female age: 0 0 years 1 1-4 years 2 5-9 years 3 10-14 years 4 15-19 years 5 20-24 years 6 25-29 years 7 30-34 years 8 35-39 years 9 40-44 years 10 45-49 years 11 50-54 years 12 55-59 years 13 60-64 years 14 65-69 years 15 70-74 years 16 75-79 years 17 80-84 years 18 85+ years
This is the sample of my data
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(year county) byte(race hispanic sex) float(age population) 2000 1001 1 0 1 0 217 2000 1001 1 0 1 1 963 2000 1001 1 0 1 2 1487 2000 1001 1 0 1 3 1551 2000 1001 1 0 1 4 1284 2000 1001 1 0 1 5 889 2000 1001 1 0 1 6 1010 2000 1001 1 0 1 7 1239 2000 1001 1 0 1 8 1638 2000 1001 1 0 1 9 1479 2000 1001 1 0 1 10 1249 2000 1001 1 0 1 11 1079 2000 1001 1 0 1 12 949 2000 1001 1 0 1 13 808 2000 1001 1 0 1 14 623 2000 1001 1 0 1 15 428 2000 1001 1 0 1 16 273 2000 1001 1 0 1 17 144 2000 1001 1 0 1 18 87 2000 1001 1 1 1 1 18 2000 1001 1 1 1 2 19 2000 1001 1 1 1 3 27 2000 1001 1 1 1 4 30 2000 1001 1 1 1 5 45 2000 1001 1 1 1 6 34 2000 1001 1 1 1 7 24 2000 1001 1 1 1 8 27 2000 1001 1 1 1 9 23 2000 1001 1 1 1 10 16 2000 1001 1 1 1 11 4 2000 1001 2 0 1 1 248 2000 1001 2 0 1 2 350 2000 1001 2 0 1 3 376 2000 1001 2 0 1 4 363 2000 1001 2 0 1 5 242 2000 1001 2 0 1 6 215 2000 1001 2 0 1 7 203 2001 1003 1 0 1 0 773 2001 1003 1 0 1 1 2873 2001 1003 1 0 1 2 4015 2001 1003 1 0 1 3 4468 2001 1003 1 0 1 4 4093 2001 1003 1 0 1 5 2950 2001 1003 1 0 1 6 3189 2001 1003 1 0 1 7 3796 2001 1003 1 0 1 8 4510 2001 1003 1 0 1 9 4888 2001 1003 1 0 1 10 4639 2001 1003 1 1 1 0 32 2001 1003 1 1 1 1 93 2001 1003 1 1 1 2 121 2001 1003 1 1 1 3 91 2001 1003 1 1 1 4 138 2001 1003 1 1 1 5 188 2001 1003 1 1 1 6 180 2001 1003 1 1 1 7 128 2001 1003 1 1 1 8 120 2001 1003 1 1 1 9 98 2001 1003 2 0 1 1 474 2001 1003 2 0 1 2 651 2001 1003 2 0 1 3 752 2001 1003 2 0 1 4 716 2001 1003 2 0 1 5 609 2001 1003 2 0 1 6 490 2001 1003 2 0 1 7 459 2001 1003 2 0 1 8 519 2001 1003 2 0 1 9 555 2001 1003 2 0 1 10 480 2001 1003 2 0 1 11 366 2001 1003 2 0 1 12 272 2001 1003 2 0 1 13 224 end
Comment