Four Corners Stata Log File

log: C:\Documents and Settings\COSS User\MyFiles\Classes\5936 Population Data\_Fall 2010\four_corners_table3.log.txt
log type: text
opened on: 30 Sep 2010, 17:33:01

. quietly do "four_corners_usa_00036.do"

. * calculations for the third table in the "4 corners" exercise — fertility by age group by mother's place of birth by state
. * drop men
. drop if sex==1
(76931 observations deleted)

. * drop females under 10 or 55+
. drop if age < 10
(10451 observations deleted)

. drop if age > 54
(21881 observations deleted)

. * create dummies for place of birth in US, Mexico, other
. gen usborn = ( bpld <= 12092)

. gen mexborn = ( bpld == 20000)

. gen othborn = 1 - usborn - mexborn

. gen pob = 1*usborn + 2*mexborn + 3*othborn

. * create dummy for birth in last year
. gen birth = ( fertyr == 2)

. * create 5-year age groups
. gen agecat = 5 * floor(age/5)

. * change the unit of observation in the data set from individuals (>46,000 obs) to {state,agegroup,pob} groups (108 obs)
. collapse (mean) birth [fweight=perwt], by (pob statefip agecat)

. * export the data to a .csv file that Excel can read
. outsheet using "four_corners_table3.csv", comma replace

. log off
log: C:\Documents and Settings\COSS User\MyFiles\Classes\5936 Population Data\_Fall 2010\four_corners_table3.log.txt
log type: text
paused on: 30 Sep 2010, 17:40:30