#delimit ;
clear;

set maxvar 8000;

set mem 300m;

use c:\timeusedata\1975\timeuse_75.dta, clear;

/*
/*Demographics*/
gen agex =  v414;
replace agex=. if age==99;
gen malex =  v403 == 1;
gen marriedx =  v32 == 1;
gen num_childx=v416; /*children under 18 in fu*/
gen age_youngestx=v418;
replace age_youngestx=. if v418>17;

rename v419 ageoldst;
replace ageoldst=. if ageoldst>90;
*/

gen dage0_2 = v420>0 & v420~=9 & v421>0 & v421~=9;
gen dage3_4 = v4220>0 & v4220~=9 & v423>0 & v423~=9;
gen dage5_12 = v424>0 & v424~=9 & v425>0 & v425~=9;
gen dage13_17 = v426>0 & v426~=9 & v427>0 & v427~=9;

rename v2 pidx;
gen hhid = pidx;
gen survey=2;
gen year=1975;


keep survey hhid pidx v48 v419 dage0_2 dage3_4 dage5_12 dage13_17;

sort survey hhid ;

save merge75.dta, replace;



