**HW: Changed July 18 2012 to append all years in one file**

clear
set more off
#delimit ;

if c(username)=="HelenW" {;
//PATH;
	local path "/Users/HelenW/Dropbox/BF";
//DEEFINE DATASET NAME;
	local dataset "/Users/HelenW/Dropbox/BF/dtafiles/expandedDHSGPS_Mergedallyears.dta";
	
};

if c(username)=="Kartini" {;
**Kartini's Paths;
//PATH;
local path "C:\Users\Kartini\Dropbox\BF";
//DEEFINE DATASET NAME;
local dataset "C:\Users\Kartini\Dropbox\BF/dtafiles/expandedDHSGPS_Mergedallyears.dta";
};

use "`path'/dtafiles/expandedDHSGPS_Mergedhh2007.dta";

append using "`path'/dtafiles/expandedDHSGPS_Mergedhh2004.dta";

append using "`path'/dtafiles/expandedDHSGPS_Mergedhh1999";

**HW: Birth year is coded differently in 1999 file, change format to match 2004 and 2007**;
replace childbyear=1994 if childbyear==94;
replace childbyear=1995 if childbyear==95;
replace childbyear=1996 if childbyear==96;
replace childbyear=1997 if childbyear==97;
replace childbyear=1998 if childbyear==98;
replace childbyear=1999 if childbyear==99;
replace childbyear=2000 if childbyear==0;

** lots of missing will have to recode later;
*recode miscarriage 3=0 4=0 .=0 2=1;
recode miscarriage 9=.;

save "`dataset'", replace;
