Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
DECC-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Anderson
DECC-data
Commits
d222dcc6
Commit
d222dcc6
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
updated descriptives script
2012 descriptives uses 20pc sample file Long file descriptives loops over % samples
parent
f1c588a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
NEED/analyse-NEED-EULF-2014-descriptives.do
+16
-10
16 additions, 10 deletions
NEED/analyse-NEED-EULF-2014-descriptives.do
with
16 additions
and
10 deletions
NEED/analyse-NEED-EULF-2014-descriptives.do
+
16
−
10
View file @
d222dcc6
...
@@ -27,28 +27,34 @@ local rpath "`proot'/results/NEED"
...
@@ -27,28 +27,34 @@ local rpath "`proot'/results/NEED"
local
version
"v1.1"
local
version
"v1.1"
local
do_2014_desc
0
/// quick tests for 2014
* quick tests for 2012
local
do_long_dec
1
/// tests for all years using long file - takes a while
local
do_2012_desc
=
1
* tests for all years using long file - takes a while
local
do_long_dec
=
1
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
if
`do_2014_desc'
{
if
`do_2012_desc'
{
* first use the original file for basic descrpitives
* use a subsample for speed
use
"`proot'/NEED/End User Licence File 2014/UKDA-7518-stata11/stata11/need_eul_may2014.dta"
,
clear
local
sample
=
"20pc"
* first use the wide file for basic descrpitives
use
"`dpath'/need_eul_may2014_consumptionfile_wide_`sample'.dta"
,
clear
* match in the xwave file with the vars we want
merge
1
:
1
HH_ID
using
"`dpath'/need_eul_may2014_xwavefile_`sample'"
,
keepusing
(
EE_BAND
FLOOR_AREA_BAND
PROP_AGE
)
* distributions for 2012 (to test)
* distributions for 2012 (to test)
* processor intensive
* processor intensive
local
vars
"Econs2012 Gcons2012"
local
vars
"Econs2012 Gcons2012"
local
tvars
"EE_BAND FLOOR_AREA_BAND PROP_AGE"
local
tvars
"EE_BAND FLOOR_AREA_BAND PROP_AGE"
foreach
v
of
local
vars
{
foreach
v
of
local
vars
{
foreach
tv
of
local
tvars
{
foreach
tv
of
local
tvars
{
histogram
`v'
,
by
(
`tv'
)
name
(
histo_
`tv'
_
`v'
)
histogram
`v'
,
by
(
`tv'
)
name
(
histo_
`tv'
_
`v'
_
`sample'
)
graph
export
"`rpath'/NEED-EULF-2014-histo_`v'_by_`tv'.png"
,
replace
graph
export
"`rpath'/NEED-EULF-2014-histo_`v'_by_`tv'
_`sample'
.png"
,
replace
graph
box
`v'
,
over
(
`tv'
)
name
(
box_
`tv'
_
`v'
)
graph
box
`v'
,
over
(
`tv'
)
name
(
box_
`tv'
_
`v'
)
graph
export
"`rpath'/NEED-EULF-2014-box_`v'_by_`tv'.png"
,
replace
graph
export
"`rpath'/NEED-EULF-2014-box_`v'_by_`tv'
_`sample'
.png"
,
replace
}
}
}
}
}
}
...
@@ -60,7 +66,7 @@ if `do_long_desc' {
...
@@ -60,7 +66,7 @@ if `do_long_desc' {
foreach
s
of
local
samples
{
foreach
s
of
local
samples
{
di
"************************"
di
"************************"
di
"* Using `s'% sample"
di
"* Using `s'% sample"
use
"`dpath'/need_eul_may2014_longfile_`s'
pc
.dta"
,
clear
use
"`dpath'/need_eul_may2014_longfile_`s'.dta"
,
clear
* set as panel
* set as panel
xtset
HH_ID
year
,
delta
(
1
year
)
xtset
HH_ID
year
,
delta
(
1
year
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment