********************************************************************************
************************************
cd "F:\Intergenerational_Health_12_9_2021\Replication_EHB_12_20_2021\progs\Figures"
clear all
set more on 
set matsize 11000
#delimit ;
graph set window fontface Century;
graph set window fontface Century;
use .\..\..\data\output\natality_1969_2004_clean_collapsed_merged_cohort_var_def , clear ;
drop if is_white==1 & chrate0>0.1;
label var chrate0 "Medicaid-Year AFDC Rate%";
replace chrate0=chrate0*100;

twoway (hist   chrate0  if is_white==0 , bin(9) bcolor( "127 112 57" )   )
	       (hist   chrate0  if is_white==0 , bin(9) fcolor(none) lcolor(khaki) lwidth(vthin)     )
		   (kdensity  chrate0  if is_white==0 ,lcolor(gs0) lwidth(0.7)),
ytitle("Density",size(vsmall))	
xtitle("Medicaid-Year AFDC Rate%",size(vsmall))	
xlabel( , labsize(vsmall)   )	 
ylabel( , labsize(vsmall)   )	 
legend(off);	   
graph save .\..\..\data\interwrk\afdc_temp4.gph , replace ;

	
twoway (hist   chrate0  if is_white==1 , bin(9) bcolor( "127 112 57" )   )
	       (hist   chrate0  if is_white==1 , bin(9) fcolor(none) lcolor(khaki) lwidth(vthin)     )
		   (kdensity  chrate0  if is_white==1 ,lcolor(gs0) lwidth(0.7)),
ytitle("Density",size(vsmall))	
xtitle("Medicaid-Year AFDC Rate%",size(vsmall))	
xlabel( , labsize(vsmall)   )	 
ylabel( , labsize(vsmall)   )	 
legend(off);	   
graph save .\..\..\data\interwrk\afdc_temp3.gph , replace ;

		   


graph box chrate0 if is_white==1 ,
box(1,color("10 110 205") lcolor("153 0 102") lwidth(medthick) )
ytitle("Medicaid-Year AFDC Rate%",size(vsmall))	
ylabel( , labsize(vsmall)   )
;
graph save .\..\..\data\interwrk\afdc_temp1.gph , replace ;

graph box chrate0 if is_white==0 ,
box(1,color("10 110 205") lcolor("153 0 102") lwidth(medthick) )
ytitle("Medicaid-Year AFDC Rate%",size(vsmall))	
ylabel( , labsize(vsmall)   )
;
graph save .\..\..\data\interwrk\afdc_temp2.gph , replace ;



/**********COMBINE****************/

	graph combine  .\..\..\data\interwrk\afdc_temp1.gph
	               .\..\..\data\interwrk\afdc_temp3.gph               
	               , cols(2) xsize(20) ysize(10) title("Whites",box bexpand bcolor(ltkhaki) size(small)) ;
	graph save .\..\..\data\interwrk\afdc_temp13.gph , replace;
	graph export .\..\..\data\interwrk\afdc_temp13.emf, replace;

	graph combine  .\..\..\data\interwrk\afdc_temp2.gph
	               .\..\..\data\interwrk\afdc_temp4.gph               
	               , cols(2) xsize(20) ysize(10) title("Non-Whites",box bexpand bcolor(ltkhaki) size(small)) ;
	graph save .\..\..\data\interwrk\afdc_temp24.gph , replace;
	graph export .\..\..\data\interwrk\afdc_temp24.emf, replace;

	
	graph combine  .\..\..\data\interwrk\afdc_temp24.gph
	               .\..\..\data\interwrk\afdc_temp13.gph               
	               , cols(1) xsize(20) ysize(20) ;
	graph save .\..\..\figs\afdc_temp.gph , replace;
	graph export .\..\..\figs\afdc_temp.emf, replace;

	
  












