I'm working on ACS dataset which doesn't provide number of population in 50 states across different years. But, for each person the income is given.

I need to create per capita income from here and my best guess is by using egen command. Is it like the following

bysort statefip year: egen tot_inc = total(income)
bysort statefip year: egen tot_pop =total(statefip==?) [ I'm confused here since I don't know how to figure out the total population in ACS dataset for a particular state in a given year ]

gen per_cap_inc = tot_inc/tot_pop

I know how to figure out the per capita income for 50 states in multiple years , the thing is I'm having trouble how to find the total number of population in my dataset for a particular state in a given year ?

Please put your valuable input if you have any experience with IPUMS ACS data or you have a hunch on how to find total respondents from a particular state in. a given year from any dataset ?