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

added summary descriptives

parent a926de83
Branches
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' {
* 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
* 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
}
}
}
if `do_long_desc' {
* 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
use "`dpath'/need_eul_may2014_longfile.dta", clear use "`dpath'/need_eul_may2014_longfile.dta", clear
* summarise Electricity
table EconsValid year, c(count Econs min Econs mean Econs max Econs) table EconsValid year, c(count Econs min Econs mean Econs max Econs)
* summarise Gas
table GconsValid year, c(count Gcons min Gcons mean Gcons max Gcons) table GconsValid year, c(count Gcons min Gcons mean Gcons max Gcons)
* distributions * distributions by year
local vars "Econs Gcons" local vars "Econs Gcons"
foreach v of local vars { foreach v of local vars {
histogram `v', by(year) name(histo_`v') histogram `v', by(year) name(histo_`v')
graph export using "`rpath'/NEED-EULF-2014-histo_`v'_by_year.png", replace graph export "`rpath'/NEED-EULF-2014-histo_`v'_by_year.png", replace
graph box `v', by(year) name(box_`v') graph box `v', over(year) name(box_`v')
graph export using "`rpath'/NEED-EULF-2014-box_`v'_by_year.png", replace 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