* user = your-id * password = your-password * package = stata * project = lis global hhvars "hid hwgt nhhmem svyunit nhhmem17 dhi" ************ ***SETUPS*** ************ program define setups * select only records if dhi filled drop if dhi==. | dhi==0 * select only if there is a weight drop if hwgt==. | hwgt==0 * set equivalence scale as square root of household member generate ey=(dhi/(nhhmem^0.5)) * create person weight as hwgt times number of household member generate wt=hwgt*nhhmem * create child weight as hwgt times number of household members 17 or younger generate ct=hwgt*nhhmem17 end *************************** ***Bottom and Top Coding*** *************************** program define bottop setups quietly sum ey [w=wt] generate botlin=0.01*_result(3) replace ey=botlin if eytoplin end ******************************************************* ***Poverty Lines Equal to 50%, 75%, 150% of Median ey*** ******************************************************* program define povl quietly sum ey [w=wt], de quietly generate povl1=_result(10)*.5 quietly generate povl2=_result(10)*.75 quietly generate povl3=_result(10)*1.5 end ********************************************** ***Distribution of Children by Income Group*** ********************************************** program define distrib povdeco ey [w=ct], varpl(povl1) generate u50m = \$S_FGT0 povdeco ey [w=ct], varpl(povl2) generate u75m = \$S_FGT0 povdeco ey [w=ct], varpl(povl3) generate u150m = \$S_FGT0 generate d50 = u50m generate d5075 = u75m - u50m generate d75150 = u150m - u75m generate d150 = 1 - u150m display "DISTRIBUTION OF CHILDREN IN DIFFERENT INCOME HOUSEHOLDS - CCYY" sum d50 d5075 d75150 d150 end use \$hhvars using \$ccyyh, clear bottop povl distrib