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
fe75c4d3
Commit
fe75c4d3
authored
10 years ago
by
Ben Anderson
Browse files
Options
Downloads
Patches
Plain Diff
added linearity tests to all households model
parent
20c0ba61
No related branches found
Branches containing commit
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-models-v2.0.do
+23
-8
23 additions, 8 deletions
NEED/analyse-NEED-EULF-2014-models-v2.0.do
with
23 additions
and
8 deletions
NEED/analyse-NEED-EULF-2014-models-v2.0.do
+
23
−
8
View file @
fe75c4d3
...
...
@@ -54,15 +54,15 @@ local rpath "`proot'/results/NEED"
* restricted analysis to households where gas is main heat source as it is better predicted by variables included & is more relevant to EPC (heat)
* uses 1% sample (c 30k) making sure keep proportions of property type and EE_Band to see if linktest fails with smaller n
*
local version "v2_10pc"
*
local sample 10
*
local sampleby "EE_BAND PROP_TYPE"
local
version
"v2_10pc"
local
sample
10
local
sampleby
"EE_BAND PROP_TYPE"
* uses 10% sample (c 300k) making sure keep proportions of property type and EE_Band to see if margin plots and co-efficients are the same
* (linktest etc will probably now fail due to larger n)
local
version
"v2_100pc"
local
sample
100
local
sampleby
"EE_BAND PROP_TYPE"
*
local version "v2_100pc"
*
local sample 100
*
local sampleby "EE_BAND PROP_TYPE"
* uses full sample (c 3m) to see if margin plots and co-efficients are the same
* (linktest etc will probably now fail due to larger n)
...
...
@@ -145,7 +145,11 @@ destring BOILER, force replace
replace
BOILER
=
0
if
BOILER
==
.
* household level vars
* for models
local
generic_hvars
"i.BOILER_YEAR i.MAIN_HEAT_FUEL i.LI_YEAR i.LOFT_DEPTH i.FLOOR_AREA_BAND WALL_CONS i.CWI_YEAR i.PROP_TYPE i.PROP_AGE i.EE_BAND"
* for graphs
local
generic_hvarsg
"BOILER_YEAR MAIN_HEAT_FUEL LI_YEAR LOFT_DEPTH FLOOR_AREA_BAND WALL_CONS CWI_YEAR PROP_TYPE PROP_AGE EE_BAND"
* for models by type
local
generic_hvarsnp
"i.BOILER_YEAR i.MAIN_HEAT_FUEL i.LI_YEAR i.LOFT_DEPTH i.FLOOR_AREA_BAND WALL_CONS i.CWI_YEAR i.PROP_AGE i.EE_BAND"
* area level vars
...
...
@@ -177,6 +181,17 @@ foreach v of local vars {
i.
BOILER_YEAR
est
store
`v'
* test a variable
predict
r
,
resid
foreach
testv
of
local
generic_hvarsg
{
di
"Testing residuals against `v'"
* based on http://www.ats.ucla.edu/stat/stata/webbooks/reg/chapter2/statareg2.htm
* can't use factor variables in acprplot...
graph
box
r
,
over
(
`testv'
)
name
(
rtest_
`testv'
)
graph
export
"`rpath'/graphs/rplot_`v'_`testv'-`version'.png"
,
replace
}
di
"* -> `v' estat to test for heteroskedasticity & omitted vars"
estat
ovtest
estat
hettest
...
...
@@ -189,7 +204,7 @@ foreach v of local vars {
di
"* test EPC margins for `v'"
margins
EE_BAND
marginsplot
,
name
(
mplot_
`v'
_EE_BAND
)
marginsplot
,
name
(
mplot_
`v'
_EE_BAND
)
note
(
"All dwellings"
)
graph
export
"`rpath'/graphs/mplot_`v'_EE_BAND-`version'.png"
,
replace
* models by property type - to see if rsq & coefficients vary
...
...
@@ -212,7 +227,7 @@ foreach v of local vars {
linktest
di
"* test EPC margins for `v' (`pt`p'')"
margins
EE_BAND
marginsplot
,
name
(
mplot_
`v'
_EE_BAND_
`pt`p'
'
)
marginsplot
,
name
(
mplot_
`v'
_EE_BAND_
`pt`p'
'
)
note
(
"Type: `pt`p''"
)
graph
export
"`rpath'/graphs/mplot_`v'_EE_BAND_`pt`p''-`version'.png"
,
replace
}
...
...
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