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

updated descriptives to test panel transitions for 'valid'

parent 9613cb4f
Branches
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ local rpath "`proot'/results/NEED" ...@@ -28,7 +28,7 @@ local rpath "`proot'/results/NEED"
local version "v1.1" local version "v1.1"
* quick tests for 2012 * quick tests for 2012
local do_2012_desc = 1 local do_2012_desc = 0
* tests for all years using long file - takes a while * tests for all years using long file - takes a while
local do_long_desc = 1 local do_long_desc = 1
...@@ -60,7 +60,7 @@ if `do_2012_desc' { ...@@ -60,7 +60,7 @@ if `do_2012_desc' {
tabstat `v', by(`v'Valid) s(n mean semean min max) tabstat `v', by(`v'Valid) s(n mean semean min max)
foreach tv of local tvars { foreach tv of local tvars {
di "***************" di "***************"
di "* Testing `tv'" di "* Testing `v' by `tv' for `s'% sample"
* test values for `tv' - check for 0s for example * test values for `tv' - check for 0s for example
tabstat `v' if `v'Valid == "V", by(`tv') s(n mean semean min max) tabstat `v' if `v'Valid == "V", by(`tv') s(n mean semean min max)
tab `v' if `v' < 1000 tab `v' if `v' < 1000
...@@ -78,7 +78,8 @@ if `do_2012_desc' { ...@@ -78,7 +78,8 @@ if `do_2012_desc' {
if `do_long_desc' { 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 * 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
* do this for each random sample of differening sizes as a check * do this for each random sample of differening sizes as a check
local samples "10 20 30 40 50 100" * local samples "10 20 30 40 50 100"
local samples "50"
foreach s of local samples { foreach s of local samples {
di "************************" di "************************"
di "* Using `s'% sample" di "* Using `s'% sample"
...@@ -93,6 +94,9 @@ if `do_long_desc' { ...@@ -93,6 +94,9 @@ if `do_long_desc' {
* distributions for valid obs * distributions for valid obs
local vars "Econs Gcons" local vars "Econs Gcons"
foreach v of local vars { foreach v of local vars {
di "***************"
di "* Testing `v' for `s'% sample"
* overall * overall
xtsum `v' if `v'Valid == "V" xtsum `v' if `v'Valid == "V"
* test values for valid - check for valid 0s for example. This only happens for gas where: * test values for valid - check for valid 0s for example. This only happens for gas where:
...@@ -101,7 +105,7 @@ if `do_long_desc' { ...@@ -101,7 +105,7 @@ if `do_long_desc' {
* elec always rounded to nearest 50 so min shoudl always be 100 * elec always rounded to nearest 50 so min shoudl always be 100
tabstat `v', by(`v'Valid) s(n mean semean min max) tabstat `v', by(`v'Valid) s(n mean semean min max)
* by year * by year
* check for 0s di "* check `v' for 0s (`s'% sample)"
table `v' year if `v' < 1000 table `v' year if `v' < 1000
table `v'Valid year, c(count `v' min `v' mean `v' max `v') table `v'Valid year, c(count `v' min `v' mean `v' max `v')
...@@ -111,9 +115,13 @@ if `do_long_desc' { ...@@ -111,9 +115,13 @@ if `do_long_desc' {
graph box `v' if `v'Valid == "V", over(year) name(box_`s'pc_`v') graph box `v' if `v'Valid == "V", over(year) name(box_`s'pc_`v')
graph export "`rpath'/NEED-EULF-2014-`s'pc-box_`v'_by_year_valid.png", replace graph export "`rpath'/NEED-EULF-2014-`s'pc-box_`v'_by_year_valid.png", replace
} }
* check the panel transitions for each valid
recode `v'Valid (V = 1) (O = 2) (L = 3) (G = 4) (M = 5), gen(EconsValidr)
lab var `v'Validr "Recoded `v'Valid"
lab def `v'Validr 1 "V" 2 "O" 3 "L" 4 "G" 5 "M"
lab val `v'Validr `v'Validr
xttrans `v'Validr
} }
* check the years where gas = valid but consumption = 0
* Presumably in these cases gas > 100 but < 249 ?
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment