I’m trying to calculate population totals for each age for each state and the US for 2002 using ACS data in STATA.
This is what I did (below). However, the US total population count (all ages combined) I’m getting from this (about 280.7 million) is much less than published population estimates for the US population in 2002 (about 287.6 million). What am I doing wrong? Should I be weighting this using perwt somehow? Is there a better way to get population estimates?
Sort by age, and add up individual person weights to get population count for each age
bysort age: egen tot_perwt=total(perwt)
Creates data set with only variables you want in it
collapse (sum) perwt, by(age year statefip)
I will note that doing the same thing with 2017 ACS data gives an estimate that matches published estimates of the US population for 2017, but it’s not happening for 2002.