Discrepancy in Counts of Children by Age (2019 ACS)

I am working on a household-level analysis that requires me to break down households into those who have infants (age=0), toddlers (age=1 or 2), preschoolers (age=3 or 4), and school-aged children (age=5 up to and including 12) and the number of children in each age group in each household. I’m not interested in the relationship between the children and primary respondent (i.e. I don’t need to match children to their parents).

After the first pass of the analysis I noted that the counts of children by age seemed a little low, so I started poking around in the data to see if there was something wrong with my code.

In stata:
gen infant=(age==0)
table region [fw=perwt], stat(total infant) (and I get ~3.5 million total using 2019 ACS)

bysort year sample serial: egen infants=total(infant)
table region if pernum==1 [fw=hhwt], stat(total infants) (and I get ~3.2 million total using 2019 ACS)

*Similar code/issue for other age groups

These numbers should match, but they don’t. When I did an unweighted sample though, I get exactly the same estimates, which leads me to think that there is some issue with the weights. Has anyone done a similar type of analysis and had more success with getting estimates that look reasonable or does anyone have any thoughts about what might be the issue and how to address it?

Any help is much appreciated!

I am not able to replicate your exact code as I am getting errors in Stata when trying to use the stat(totals) option. However, I would not expect the numbers from these to match. Your first code snippet is weighted using PERWT, which treats persons as the unit of observation and will report the number of persons who are infants in each region. The latter is weighted using HHWT, which treats households as the unit of observation and will report the number of households that have an infant in them by region. I would expect the household number to be lower as there may be more than one infant in a household (especially given that you are not focused on the relationship between the infant and the householder).