Skip to content
Snippets Groups Projects
Commit c9e6cbca authored by Ben Anderson's avatar Ben Anderson
Browse files

added summary descriptives

parent a926de83
No related branches found
No related tags found
No related merge requests found
...@@ -23,27 +23,52 @@ local proot "`home'/Work/Data/Social Science Datatsets/DECC" ...@@ -23,27 +23,52 @@ local proot "`home'/Work/Data/Social Science Datatsets/DECC"
* for clam * for clam
* local proot "`home'/Work/NEED" * local proot "`home'/Work/NEED"
local dpath "`proot'/NEED/End User Licence File 2014/processed" local dpath "`proot'/NEED/End User Licence File 2014/processed"
local rpath "`proot'/results/NEED/" local rpath "`proot'/results/NEED"
local version "v1.1" local version "v1.1"
local do_2014_desc 1 /// quick tests for 2014
local do_long_dec 0 /// tests for all years using long file - takes a while
set more off set more off
log using "`rpath'/analyse-NEED-EULF-2014-descriptives-`version'-$S_DATE.smcl", replace log using "`rpath'/analyse-NEED-EULF-2014-descriptives-`version'-$S_DATE.smcl", replace
* use the pre-processed long form file which contains all years of consumption data but not the constant values (housing charactersitics etc) which are in the xwave file if `do_2014_desc' {
use "`dpath'/need_eul_may2014_longfile.dta", clear * first use the original file for basic descrpitives
use "`proot'/NEED/End User Licence File 2014/UKDA-7518-stata11/stata11/need_eul_may2014.dta", clear
table EconsValid year, c(count Econs min Econs mean Econs max Econs)
table GconsValid year, c(count Gcons min Gcons mean Gcons max Gcons) * distributions for 2012 (to test)
local vars "Econs2012 Gcons2012"
local tvars "EE_BAND FLOOR_AREA_BAND PROP_AGE"
foreach v of local vars {
foreach tv of local tvars {
histogram `v' , by(`tv') name(histo_`tv'_`v')
graph export "`rpath'/NEED-EULF-2014-histo_`v'_by_`tv'.png", replace
graph box `v', over(`tv') name(box_`tv'_`v')
graph export "`rpath'/NEED-EULF-2014-box_`v'_by_`tv'.png", replace
}
}
}
* distributions if `do_long_desc' {
local vars "Econs Gcons" * Now use the pre-processed long form file which contains all years of consumption data but not the constant values (housing charactersitics etc) which are in the xwave file
foreach v of local vars { use "`dpath'/need_eul_may2014_longfile.dta", clear
histogram `v', by(year) name(histo_`v')
graph export using "`rpath'/NEED-EULF-2014-histo_`v'_by_year.png", replace * summarise Electricity
graph box `v', by(year) name(box_`v') table EconsValid year, c(count Econs min Econs mean Econs max Econs)
graph export using "`rpath'/NEED-EULF-2014-box_`v'_by_year.png", replace * summarise Gas
table GconsValid year, c(count Gcons min Gcons mean Gcons max Gcons)
* distributions by year
local vars "Econs Gcons"
foreach v of local vars {
histogram `v', by(year) name(histo_`v')
graph export "`rpath'/NEED-EULF-2014-histo_`v'_by_year.png", replace
graph box `v', over(year) name(box_`v')
graph export "`rpath'/NEED-EULF-2014-box_`v'_by_year.png", replace
}
} }
di "* Done!" di "* Done!"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment