/***************************** * Intrahousehold Transfers * * Author(s): Comfort Sumida * *****************************/ /********************************************************************************************************************* * Product: Age profiles of intrahousehold transfers * * Data requirements: * * - estimates of consumption components (education, health, other, housing) adjusted to match aggregate controls * * - estimates of labor income adjusted to match aggregate controls * * - estimates of public cash transfers and interhousehold transfers adjusted to match aggregate controls * * Methodology: Refer to private transfers write-up on methodology webpage * *********************************************************************************************************************/ /*********************************************************************************** * note(s): - do-files are for all years (loops) * * - need to obtain above listed estimates (data requirements) beforehand * ***********************************************************************************/ set more off # delimit ; /********************************************************************************************************** * merge files so all above data requirements are present in one data file before running following steps * **********************************************************************************************************/ forval i = 1977(1)2003 {; log using "C:\intra`i'", replace; /* renaming variables */ ren test5 edu; ren duri hous; ren health3 health; /* individual consumption: sum of estimated other, health and education expenditures*/ egen consi = rsum(other health edu); /* disposable income for household heads includes interhousehold transfers */ egen yld = rsum(yl PCT interhh) if rel==1; egen yld2 = rsum(yl PCT) if rel !=1; replace yld = yld2 if rel !=1; /* household disposable income */ sort savehhid; by savehhid: egen yldhh = sum(yld); /* define current surplus or deficit for each household member */ gen nconsi = -1 * consi; egen diff = rsum(yld nconsi); /* dummy for surplus */ gen dsurp = diff > 0; gen currsurp = diff * dsurp; gen currdef = diff if dsurp==0; recode currdef (. = 0); /* create household surplus and deficits */ gen absdef = abs(currdef); sort savehhid; by savehhid: egen surphh = sum(currsurp); by savehhid: egen defhh = sum(absdef); /* checkpoint */ gen check2 = abs(consi - yld) if dsurp==0; compare check2 absdef; /* calculating taxes on individual surpluses */ gen taxj = min(1, defhh/surphh); /* calculating intrahousehold transfer outflows */ /* dummy for positive balance for household |deficit| - surplus */ gen diff2 = defhh - surphh; gen dpos = diff2 > 0; gen outij = -1 * taxj * currsurp if rel !=1; gen outh = -1 * ((taxj * currsurp) + durihh + ((defhh - surphh) * dpos)) if rel==1; replace outij = outh if rel==1; recode * (. = 0); /* calculating intra household outlfows and inflows by sector */ /* sector inflows */ /* current consumption sectors */ egen tconsi = rsum(other edu health); gen ineduij = (edu/tconsi) * absdef; gen inhealthij = (health/tconsi) * absdef; gen inothij = (other/tconsi) * absdef; /* asset consumption sectors */ gen inasset = hous if rel !=1; recode ineduij inhealthij inothij inasset (. = 0); /* household inflows by sectors */ sort savehhid; by savehhid: egen ineduhh = sum(ineduij); by savehhid: egen inhealthhh = sum(inhealthij); by savehhid: egen inothhh = sum(inothij); recode * (. = 0); /* sector outflows */ /* current consumption sectors */ egen tinj = rsum(ineduhh inhealthhh inothhh); gen outijc = outij; gen outhc = -1 * ((taxj * currsurp) + ((defhh - surphh) * dpos)) if rel==1; replace outijc = outhc if rel==1; gen outeij = (ineduhh/tinj) * outijc; gen outhij = (inhealthhh/tinj) * outijc; gen outoij = (inothhh/tinj) * outijc; /* asset consumption sectors */ sort savehhid; by savehhid: egen housing = sum(hous); gen outasset = - (housing - hous) if rel==1; recode * (. = 0); /* smooth asset flows */ lowess inasset age, gen(sina) nograph bwidth(0.1); lowess outasset age, gen(sino) nograph bwidth(0.1); /* smooth current consumption flows */ lowess ineduij age, gen(sincce) nograph bwidth(0.1); lowess inhealthij age, gen(sincch) nograph bwidth(0.1); lowess inothij age, gen(sincco) nograph bwidth(0.1); lowess outeij age, gen(soutcce) nograph bwidth(0.1); lowess outhij age, gen(soutcch) nograph bwidth(0.1); lowess outoij age, gen(soutcco) nograph bwidth(0.1); /* tabulate */ table age [w = mult1], content(mean sincce mean sincch mean sincco); table age [w = mult1], content(mean soutcce mean soutcch mean soutcco); table age [w = mult1], content(mean sina mean sino); save "C:\intra`i'.dta", replace; log close; };