Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LCFS
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ben Anderson
LCFS
Commits
ff07a0b6
Commit
ff07a0b6
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
added calculation of income deciles & quartiles within each year
parent
b6ac0bb6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ONS-UK-EFS-time-series-extract.do
+22
-14
22 additions, 14 deletions
ONS-UK-EFS-time-series-extract.do
with
22 additions
and
14 deletions
ONS-UK-EFS-time-series-extract.do
+
22
−
14
View file @
ff07a0b6
...
@@ -75,7 +75,7 @@ local mergeyears = "2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009
...
@@ -75,7 +75,7 @@ local mergeyears = "2002-2003 2003-2004 2004-2005 2005-2006 2006 2007 2008 2009
* be sure to keep only these from the dv hh file - these will be 'kept' after the var names have been reduced to lower case
* be sure to keep only these from the dv hh file - these will be 'kept' after the var names have been reduced to lower case
* DEMAND 2.3 (older people mobile lives)
* DEMAND 2.3 (older people mobile lives)
local
dvhh_keepvars
=
"b480 b481 c96111* c96112* cc5413* c73311* c73312*"
local
dvhh_keepvars
=
"b480 b481
b485
c96111* c96112* cc5413* c73311* c73312*"
* needed for income equivalisation later
* needed for income equivalisation later
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon weight* a055 g018 g019 p116* p344* p389*"
local
dvhh_keepvars
=
"`dvhh_keepvars' incanon weight* a055 g018 g019 p116* p344* p389*"
...
@@ -357,23 +357,31 @@ if `do_extracts' {
...
@@ -357,23 +357,31 @@ if `do_extracts' {
gen
ba_adults
=
g018
if
g018
>
0
gen
ba_adults
=
g018
if
g018
>
0
* ignore hhs with no adults (how many are there?)
* ignore hhs with no adults (how many are there?)
/* 1st adult = .67 spouse = .33 other 2nd adult = .33 3rd adult = .33 subsequent adults = .33 children aged < 14 = .2 children aged 14+ = .33 */
*
catch
hh
with
no
children
replace
ba_under14
=
0
if
ba_under14
==
.
replace
ba_over14
=
0
if
ba_over14
==
.
gen
oecd_equivbhcwt
=
0.67
if
ba_adults
>=
1
replace
oecd_equivbhcwt
=
oecd_equivbhcwt
+
((
ba_adults
-1
)
*
0.33
)
+
(
ba_under14
*
0.2
)
+
(
ba_over14
*
0.33
)
di
"Calculating equiv income (OECD)"
/* 1st adult = .67 spouse = .33 other 2nd adult = .33 3rd adult = .33 subsequent adults = .33 children aged < 14 = .2 children aged 14+ = .33 */
*
catch
hh
with
no
children
replace
ba_under14
=
0
if
ba_under14
==
.
replace
ba_over14
=
0
if
ba_over14
==
.
gen
oecd_equivbhcwt
=
0.67
if
ba_adults
>=
1
replace
oecd_equivbhcwt
=
oecd_equivbhcwt
+
((
ba_adults
-1
)
*
0.33
)
+
(
ba_under14
*
0.2
)
+
(
ba_over14
*
0.33
)
di
"Calculating equiv income (OECD) and quartiles/deciles"
local
incanonl
"anonymised hhold inc + allowances"
* p344 & p389 changed to *p after 2006 and top coded (!)
* p344 & p389 changed to *p after 2006 and top coded (!)
if
"`y'"
==
"2001-2002"
|
"`y'"
==
"2002-2003"
|
"`y'"
==
"2003-2004"
|
"`y'"
==
"2004-2005"
|
"`y'"
==
"2005-2006"
|
"`y'"
==
"2006"
{
capture
nosily
:
renpfix
p344p
p344
capture
nosily
:
renpfix
p389
p389
gen
equiv_p344
=
p344
/
oecd_equivbhcwt
gen
equiv_p344
=
p344
/
oecd_equivbhcwt
gen
equiv_p389bhc
=
p389
/
oecd_equivbhcwt
gen
equiv_p389bhc
=
p389
/
oecd_equivbhcwt
gen
equiv_p389ahc
=
(
p389
-
p116t
)
/
oecd_equivbhcwt
gen
equiv_p389ahc
=
(
p389
-
p116t
)
/
oecd_equivbhcwt
}
else
{
gen
equiv_p344
=
p344p
/
oecd_equivbhcwt
gen
equiv_p389bhc
=
p389p
/
oecd_equivbhcwt
gen
equiv_p389ahc
=
(
p389p
-
p116t
)
/
oecd_equivbhcwt
}
lab
var
equiv_p344
"Equivalised normal gross household income (OECD)"
lab
var
equiv_p344
"Equivalised normal gross household income (OECD)"
lab
var
equiv_p389bhc
"Equivalised normal disposable (net) household income (BHC, OECD)"
lab
var
equiv_p389bhc
"Equivalised normal disposable (net) household income (BHC, OECD)"
lab
var
equiv_p389ahc
"Equivalised normal disposable (net) household income (AHC, OECD)"
lab
var
equiv_p389ahc
"Equivalised normal disposable (net) household income (AHC, OECD)"
local
incomes
"incanon p344 p389"
local
incanonl
"anonymised hhold inc + allowances"
local
p344l
"gross normal weekly household income"
local
p389l
"normal weekly disposable hhld income"
foreach
i
of
local
incomes
{
egen
`i'
_dec
=
cut
(
`i'
),
group
(
10
)
lab
var
`i'
_dec
"Deciles: ``i'l'"
egen
`i'
_quart
=
cut
(
`i'
),
group
(
4
)
lab
var
`i'
_quart
"Quartiles: ``i'l'"
}
* quarter labels changed in 2006
* quarter labels changed in 2006
...
...
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