
** 	THIS FILE ANALYSES THE CONSUMPTION

** 	CHANGE THE DIRECTORY
	cd $DIR

** 	OPEN SOLUTION.DTA
	use BSL_solution, clear
gg
*****************************************************************************************


**FAMILY SIZE (IN MALE ADULT (18-62) EQUIVALENT: 3.259 BJ/YEAR)
	g hhsize = e_demand
	g hhsize_ae = hhsize / 3.259
	label var hhsize "Household size [BJ]
	label var hhsize_ae "Household size [male adult equivalents]

** PERCAPITA ENERGY CONSUMPTION

	g pcap_en = e_supply/hhsize_ae
	collapse (mean) pcap_en, by ( aID run) fast

	twoway (kdensity pcap_en, lcolor(forest_green) lpattern(solid) lwidth(medthick)), ytitle(Kernel Density, size(medsmall)) xtitle(BJ/capita, size(medsmall)) title(Per capita food energy consumption) xline(3.259, lc(red*1.5)) text(0.10 2.8 "poverty line", orient(vertical) j(left) size(medsmall) c(red*1.5))
	gg
graph export "D:\MPMAS\Ghana_casestudy\TONO_01\Stata\results\Percapita FoodConsumprtion_BSL.tif", replace

**DIVIDE INTO GROUPS:
	xtile en10  = pcap_en, nq(10)

	graph bar (mean) pcap_en , stack over(en10, axis(off) gap(25)) ylabel(0(2)10, angle(horizontal) labsize(medlarge) glc(gs11)) ytitle("Billion joules/Capita", size(medlarge))bar(1, bc(blue*4)) xsize(20) ysize(10) graphregion(margin(b+18) color(white)) plotregion(margin(none) lc(black) lw(*2)) text( -1.5 50 "% of agents",size(medlarge)) text(-0.70 15.5 "20",size(medlarge)) text(-0.70 95.5 "100", size(medlarge)) text(-0.70 35.5 "40", size(medlarge)) text(-0.70 55.5 "60", size(medlarge)) text(-0.70 75.5 "80", size(medlarge)) 
	graph export "D:\MPMAS\Ghana_casestudy\TONO_01\Stata\results\Decom_percapita FoodConsumption_BSL.tif",replace
	gg
** COMPARISON GRAPHS OF PERCAPITA ENERGY CONSUMPTION IN DIFFERENT SENARIOS

	graph twoway (kdensity pcap_en if run == "B1", lw(*1) lc(black)) (kdensity pcap_en if run == "B4", lw(*1) lc(red*2) )   ,legend(label(1 "Without population growth") label(2 "Baseline")  pos(2) ring(0) col(1) symx(*0.5) region(lc(none)) rowgap(*2)) ylabel(0(0.1)1, angle(horizontal) format(%9.2f) glc(gs11)) ytitle("Kernel density", margin(medium)) xtitle("Food energy consumption [BJ / capita]", margin(medium))  plotregion(lc(black)) graphregion(margin(b-5 l-5)) xline(3.259, lc(red*1.5)) text(0.05 2.90 "poverty line", orient(vertical) j(left) size(medsmall) c(red*1.5)) 
		
	



	
