I am working with ACS PUMS data and am trying to estimate the number of foreign born individuals who entered the U.S. in 2002 and 2003 by state. My end goal is to export this into excel as one column of the weighted counts, structured as 50 rows for the 2001 data followed by 50 rows of the 2002 data. An example of a point estimate for a foreign-born person in California who entered the U.S. in 2001 is:
Here is where I am stuck. First, how can I store this weighted count, or even return it? Using the ereturn command, I see that there are some automatically stored values, but I cannot find the weighted counts here.
Second, how can I efficiently construct my desired variable (described above). I figured I would use a sequence of the state codes and create a loop using code similar to that above. I'm not sure if this is the right away to go about it, or if I am on the wrong track. I am out of my league at the moment.
P.S.
I combed through previous threads on the subject and found some relevant posts, but could not break through my own problem. I saw a similar problem concerning the differences between storing survey data and nonsurvey data, but not for the counts.
Code:
svyset[pw=pwgtp][ gen ca_yoe02=0 replace ca_yoe02=1 if nativity==2 & yoep==2002 & st==06 svy: tab ca_yoe02, count format(%15.2g)
Second, how can I efficiently construct my desired variable (described above). I figured I would use a sequence of the state codes and create a loop using code similar to that above. I'm not sure if this is the right away to go about it, or if I am on the wrong track. I am out of my league at the moment.
P.S.
I combed through previous threads on the subject and found some relevant posts, but could not break through my own problem. I saw a similar problem concerning the differences between storing survey data and nonsurvey data, but not for the counts.
Comment