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

updated IoW analysis with correct definitions

parent 38fe900d
No related branches found
No related tags found
No related merge requests found
......@@ -199,10 +199,15 @@ nrow(dtMsoaSpineIoW[elecRatio > 0.80])
# Ellis' question...
1) join income deprivation score to LSOA shapefiles. If you could produce a map that would be great.
2) Count dwellings in LSOAs with have EPC < C (D-G) and main fuel type not mains gas. If you could map all EPCs and then the EPCs that match the criteria.
3) Join tenure to LSOA shapefiles. Multiply count by LSOA level census figure for % of private dwellings.
4) Multiply by 1/0.687 to correct for dwellings without an EPC.
For the Isle of Wight, can we estimate the number of private (owned or rented) addresses in high income deprivation areas which do not have gas?
Our method:
1. Join LSOA data to EPC data to
join IMD income deprivation score to LSOA.
2. Count dwellings in LSOAs with have EPC < C (D-G) and main fuel type not mains gas. If you could map all EPCs and then the EPCs that match the criteria.
3. Join tenure to LSOA shapefiles. Multiply count by LSOA level census figure for % of private dwellings.
4. Multiply by 1/0.687 to correct for dwellings without an EPC.
```{r loadData}
# this will break here if you don't have the data obvs
......@@ -427,21 +432,26 @@ Table \@ref(tab:depr10pc) shows the same results but for the 10% most income dep
Next we assume that the EPC addresses of interest are as likely to be social/private rented as owner-occupied and multiply the EPC address counts by the Census-derived household ownership tenure rate for each LSOA. Without knowing the tensure status of the EPC we cannot do anything else.
```{r select20pc}
lsoaDT[, nHHsSelected := selectedEPCAddresses*`Owned (%)`]
# multiply by tenure needed
lsoaDT[, nEPCAddressessSelectedOwned := selectedEPCAddresses*`Owned (%)`] # just owned
lsoaDT[, nEPCAddressessSelectedPrivate := selectedEPCAddresses*(`Owned (%)` + `Private rented (%)`)] # just owned
t <- lsoaDT[, .(nHHsSelected = sum(nHHsSelected),
t <- lsoaDT[, .(nEPCAddressessSelectedOwned = sum(nEPCAddressessSelectedOwned),
nEPCAddressessSelectedPrivate = sum(nEPCAddressessSelectedPrivate),
nHHsCensus = sum(nHHsCensus),
nLSOAs = .N), keyby = .(deprived20pc)]
kableExtra::kable(t, digits = 2,
caption = "Summary of EPC households and all census households by LSOA deprivation type (20% most income deprived)") %>%
kable_styling()
res20pc <- round(t[deprived20pc == "highDep", nHHsSelected])
res20pcOwned <- round(t[deprived20pc == "highDep", nEPCAddressessSelectedOwned])
res20pcPrivate <- round(t[deprived20pc == "highDep", nEPCAddressessSelectedPrivate])
```
```{r select10pc}
t <- lsoaDT[, .(nHHsSelected = sum(nHHsSelected),
t <- lsoaDT[, .(nEPCAddressessSelectedOwned = sum(nEPCAddressessSelectedOwned),
nEPCAddressessSelectedPrivate = sum(nEPCAddressessSelectedPrivate),
nHHsCensus = sum(nHHsCensus),
nLSOAs = .N), keyby = .(deprived10pc)]
......@@ -449,21 +459,26 @@ kableExtra::kable(t, digits = 2,
caption = "Summary of EPC households and all census households by LSOA deprivation type (10% most income deprived)") %>%
kable_styling()
res10pc <- round(t[deprived10pc == "highDep", nHHsSelected])
res10pcOwned <- round(t[deprived10pc == "highDep", nEPCAddressessSelectedOwned])
res10pcPrivate <- round(t[deprived10pc == "highDep", nEPCAddressessSelectedPrivate])
epcMissingPC <- 100*(1-(1/epcMissingFactor))
```
> In summary using the EPC data we have estimated the number of addresses in low income areas which are owned and do not have gas to be:
> In summary using the EPC data we have estimated the number of addresses in high income deprivation areas which do not have gas to be:
* 10% most deprived: `r res10pc` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res10pc * epcMissingFactor)`;
* 20% most deprived: `r res20pc` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res20pc * epcMissingFactor)`;
* 10% most deprived:
* Owned: `r res10pcOwned` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res10pcOwned * epcMissingFactor)`
* Private (owned & private rent): `r res10pcPrivate` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res10pcPrivate * epcMissingFactor)`
* 20% most deprived:
* Owned: `r res20pcOwned` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res20pcOwned * epcMissingFactor)`
* Private (owned & private rent): `r res20pcPrivate` or, if we uprate to allow for the `r epcMissingPC` % missing EPCs, `r round(res20pcPrivate * epcMissingFactor)`
Table \@ref(tab:lsoaTable) shows the LSOA level results.
```{r lsoaTable}
t<- lsoaDT[, .(lsoaCode, nAddressesEPC = nHHsEPC, notSelectedEPCAddresses, selectedEPCAddresses, pcOwned=pcOwned*100, deprived20pc, deprived10pc,nHHsSelected)]
t<- lsoaDT[, .(lsoaCode, nAddressesEPC = nHHsEPC, notSelectedEPCAddresses, selectedEPCAddresses, pcOwned=pcOwned*100, deprived20pc, deprived10pc,
nEPCAddressessSelectedOwned,nEPCAddressessSelectedPrivate)]
setkey(t, deprived20pc, deprived10pc)
kableExtra::kable(t, caption = "Final results at LSOA level",
......@@ -476,20 +491,33 @@ data.table::fwrite(t, file = "lsoaTableForEllis.csv")
```{r resultsChecks}
totSelectedHH <- sum(lsoaDT[!is.na(lsoaCode)]$selectedEPCAddresses)
totPrivSelected <- sum(lsoaDT[!is.na(lsoaCode)]$nEPCAddressessSelectedPrivate)
totOwnedSelected <- sum(lsoaDT[!is.na(lsoaCode)]$nEPCAddressessSelectedOwned)
meanPrivate <- mean(lsoaDT$pcOwned + lsoaDT$`Private rented (%)`)
res10own <- totOwnedSelected * meanPrivate * 0.1
res20own <- totOwnedSelected * meanPrivate * 0.2
res10priv <- totPrivSelected * meanPrivate * 0.1
res20priv <- totPrivSelected * meanPrivate * 0.2
meanOwnership <- mean(lsoaDT$pcOwned)
res10priv
res10own
res10 <- totSelectedHH * meanOwnership * 0.1
res20 <- totSelectedHH * meanOwnership * 0.2
res20priv
res20own
```
As a rough check, if we multiply the total number of EPC addresses which fit the criteria by the mean ownership rate we get:
As a rough check, if we multiply the total number of EPC addresses which fit the criteria by the mean private ownership rate (owned + private rental = `r round(100*meanPrivate)`%) we get:
* 10% of households = `r round(res10)`
* 20% of households = `r round(res20)`
* 10% of households:
* Private: `r round(res10priv)`
* Owned: `r round(res10own)`
* 20% of households:
* Private: `r round(res20priv)`
* Owned: `r round(res20own)`
Note that this is only a rough guide since it assumes that LSOAs have exactly the same number of addresses/households in them.
Note that these values have not been uprated to correct for missing EPCs and that they are only a rough guide since they assume that LSOAs have exactly the same number of addresses/households in them.
# Annexes
......
This diff is collapsed.
lsoaCode,nAddressesEPC,notSelectedEPCAddresses,selectedEPCAddresses,pcOwned,deprived20pc,deprived10pc,nHHsSelected
E01033229,615,576,39,83.4890966,,,32.560747674
E01033237,566,531,35,39.2523364,,,13.73831774
E01033239,904,778,126,89.1089109,,,112.277227734
E01017322,558,473,85,45.3936348,highDep,highDep,38.58458958
E01017328,597,458,139,48.030303,highDep,highDep,66.76212117
E01017331,589,531,58,57.2948328,highDep,highDep,33.231003024
E01017332,710,688,22,47.6190476,highDep,highDep,10.476190472
E01017336,905,622,283,38.647343,highDep,highDep,109.37198069
E01017343,437,348,89,58.377425,highDep,highDep,51.95590825
E01017345,753,636,117,38.4520885,highDep,highDep,44.988943545
E01017363,887,667,220,50.25,highDep,highDep,110.55
E01017366,455,406,49,62.3987034,highDep,highDep,30.575364666
E01017295,356,315,41,63.4328358,highDep,notHighDep,26.007462678
E01017318,320,306,14,59.2592593,highDep,notHighDep,8.296296302
E01017319,533,421,112,68.6363636,highDep,notHighDep,76.872727232
E01017326,815,636,179,39.2086331,highDep,notHighDep,70.183453249
E01017340,736,645,91,57.8144854,highDep,notHighDep,52.611181714
E01017341,411,384,27,62.8304821,highDep,notHighDep,16.964230167
E01017350,559,536,23,63.2198953,highDep,notHighDep,14.540575919
E01017356,672,565,107,55.8035714,highDep,notHighDep,59.709821398
E01017282,458,430,28,73.3788396,notHighDep,notHighDep,20.546075088
E01017283,506,397,109,81.4589666,notHighDep,notHighDep,88.790273594
E01017284,714,660,54,85.546875,notHighDep,notHighDep,46.1953125
E01017285,664,577,87,80.490524,notHighDep,notHighDep,70.02675588
E01017286,457,414,43,84.4250364,notHighDep,notHighDep,36.302765652
E01017287,439,423,16,90.0815217,notHighDep,notHighDep,14.413043472
E01017288,489,432,57,79.4066318,notHighDep,notHighDep,45.261780126
E01017289,650,571,79,75.9864713,notHighDep,notHighDep,60.029312327
E01017290,366,34,332,83.3625219,notHighDep,notHighDep,276.763572708
E01017291,412,69,343,87.5675676,notHighDep,notHighDep,300.356756868
E01017292,549,534,15,76.0432767,notHighDep,notHighDep,11.406491505
E01017293,471,464,7,85.7142857,notHighDep,notHighDep,5.999999999
E01017294,414,320,94,83.3075734,notHighDep,notHighDep,78.309118996
E01017296,330,130,200,85.4085603,notHighDep,notHighDep,170.8171206
E01017297,485,161,324,78.7021631,notHighDep,notHighDep,254.995008444
E01017298,427,47,380,86.2068966,notHighDep,notHighDep,327.58620708
E01017299,423,65,358,71.2945591,notHighDep,notHighDep,255.234521578
E01017300,1324,1079,245,64.144454,notHighDep,notHighDep,157.1539123
E01017301,277,240,37,90.7024793,notHighDep,notHighDep,33.559917341
E01017302,462,448,14,85.0609756,notHighDep,notHighDep,11.908536584
E01017303,521,481,40,70.7720588,notHighDep,notHighDep,28.30882352
E01017304,388,362,26,75.0902527,notHighDep,notHighDep,19.523465702
E01017305,717,663,54,55.7275542,notHighDep,notHighDep,30.092879268
E01017306,360,318,42,65.6880734,notHighDep,notHighDep,27.588990828
E01017307,815,737,78,81.3348416,notHighDep,notHighDep,63.441176448
E01017308,598,538,60,63.6612022,notHighDep,notHighDep,38.19672132
E01017309,543,489,54,66.3805436,notHighDep,notHighDep,35.845493544
E01017310,349,306,43,89.4736842,notHighDep,notHighDep,38.473684206
E01017311,439,387,52,67.5637394,notHighDep,notHighDep,35.133144488
E01017312,755,674,81,64.7606383,notHighDep,notHighDep,52.456117023
E01017315,443,373,70,64.1369048,notHighDep,notHighDep,44.89583336
E01017316,747,703,44,82.2360248,notHighDep,notHighDep,36.183850912
E01017317,428,405,23,76.8768769,notHighDep,notHighDep,17.681681687
E01017320,344,321,23,89.1304348,notHighDep,notHighDep,20.500000004
E01017321,416,301,115,84.4897959,notHighDep,notHighDep,97.163265285
E01017323,358,314,44,90.8548708,notHighDep,notHighDep,39.976143152
E01017324,413,364,49,83.2520325,notHighDep,notHighDep,40.793495925
E01017325,483,391,92,56.1258278,notHighDep,notHighDep,51.635761576
E01017327,443,398,45,73.5426009,notHighDep,notHighDep,33.094170405
E01017329,569,442,127,86.9158879,notHighDep,notHighDep,110.383177633
E01017333,391,364,27,77.3700306,notHighDep,notHighDep,20.889908262
E01017334,319,268,51,76.059322,notHighDep,notHighDep,38.79025422
E01017335,627,492,135,54.8941799,notHighDep,notHighDep,74.107142865
E01017337,740,496,244,51.7902813,notHighDep,notHighDep,126.368286372
E01017338,475,435,40,79.3495935,notHighDep,notHighDep,31.7398374
E01017339,497,435,62,74.3243243,notHighDep,notHighDep,46.081081066
E01017342,560,509,51,69.4986072,notHighDep,notHighDep,35.444289672
E01017344,464,384,80,82.6629681,notHighDep,notHighDep,66.13037448
E01017346,623,510,113,55.9345157,notHighDep,notHighDep,63.206002741
E01017347,495,431,64,72.1288515,notHighDep,notHighDep,46.16246496
E01017348,486,417,69,61.8042226,notHighDep,notHighDep,42.644913594
E01017349,783,663,120,62.4161074,notHighDep,notHighDep,74.89932888
E01017351,708,520,188,81.3169985,notHighDep,notHighDep,152.87595718
E01017352,434,417,17,93.3566434,notHighDep,notHighDep,15.870629378
E01017353,353,138,215,86.6541353,notHighDep,notHighDep,186.306390895
E01017354,546,426,120,70.0342466,notHighDep,notHighDep,84.04109592
E01017355,504,415,89,81.969697,notHighDep,notHighDep,72.95303033
E01017357,472,402,70,63.6650869,notHighDep,notHighDep,44.56556083
E01017358,425,387,38,84.137931,notHighDep,notHighDep,31.97241378
E01017359,648,550,98,76.6519824,notHighDep,notHighDep,75.118942752
E01017360,892,695,197,56.0853199,notHighDep,notHighDep,110.488080203
E01017361,545,447,98,83.68,notHighDep,notHighDep,82.0064
E01017362,686,599,87,68.8650307,notHighDep,notHighDep,59.912576709
E01017364,632,508,124,76.6961652,notHighDep,notHighDep,95.103244848
E01017365,731,474,257,81.0271041,notHighDep,notHighDep,208.239657537
E01017367,585,483,102,88.5478158,notHighDep,notHighDep,90.318772116
E01017368,475,432,43,70,notHighDep,notHighDep,30.1
E01017369,439,294,145,77.0597738,notHighDep,notHighDep,111.73667201
E01017370,486,418,68,77.0595691,notHighDep,notHighDep,52.400506988
lsoaCode,nAddressesEPC,notSelectedEPCAddresses,selectedEPCAddresses,pcOwned,deprived20pc,deprived10pc,nEPCAddressessSelectedOwned,nEPCAddressessSelectedPrivate
E01033229,615,576,39,83.4890966,,,32.560747674,37.238317779
E01033237,566,531,35,39.2523364,,,13.73831774,16.616822425
E01033239,904,778,126,89.1089109,,,112.277227734,123.27812784
E01017322,558,473,85,45.3936348,highDep,highDep,38.58458958,52.68006699
E01017328,597,458,139,48.030303,highDep,highDep,66.76212117,120.887878691
E01017331,589,531,58,57.2948328,highDep,highDep,33.231003024,39.930091184
E01017332,710,688,22,47.6190476,highDep,highDep,10.476190472,12.278095236
E01017336,905,622,283,38.647343,highDep,highDep,109.37198069,266.594203038
E01017343,437,348,89,58.377425,highDep,highDep,51.95590825,66.867724839
E01017345,753,636,117,38.4520885,highDep,highDep,44.988943545,69.136363647
E01017363,887,667,220,50.25,highDep,highDep,110.55,181.225
E01017366,455,406,49,62.3987034,highDep,highDep,30.575364666,37.722852517
E01017295,356,315,41,63.4328358,highDep,notHighDep,26.007462678,33.886194017
E01017318,320,306,14,59.2592593,highDep,notHighDep,8.296296302,10.343079922
E01017319,533,421,112,68.6363636,highDep,notHighDep,76.872727232,93.163636272
E01017326,815,636,179,39.2086331,highDep,notHighDep,70.183453249,142.72781769
E01017340,736,645,91,57.8144854,highDep,notHighDep,52.611181714,79.783989831
E01017341,411,384,27,62.8304821,highDep,notHighDep,16.964230167,19.903576986
E01017350,559,536,23,63.2198953,highDep,notHighDep,14.540575919,18.123036645
E01017356,672,565,107,55.8035714,highDep,notHighDep,59.709821398,95.694940466
E01017282,458,430,28,73.3788396,notHighDep,notHighDep,20.546075088,24.511945388
E01017283,506,397,109,81.4589666,notHighDep,notHighDep,88.790273594,104.030395155
E01017284,714,660,54,85.546875,notHighDep,notHighDep,46.1953125,53.296875018
E01017285,664,577,87,80.490524,notHighDep,notHighDep,70.02675588,78.561872958
E01017286,457,414,43,84.4250364,notHighDep,notHighDep,36.302765652,41.31004367
E01017287,439,423,16,90.0815217,notHighDep,notHighDep,14.413043472,15.869565216
E01017288,489,432,57,79.4066318,notHighDep,notHighDep,45.261780126,54.314136174
E01017289,650,571,79,75.9864713,notHighDep,notHighDep,60.029312327,68.223224401
E01017290,366,34,332,83.3625219,notHighDep,notHighDep,276.763572708,316.301225952
E01017291,412,69,343,87.5675676,notHighDep,notHighDep,300.356756868,322.605405563
E01017292,549,534,15,76.0432767,notHighDep,notHighDep,11.406491505,13.910355495
E01017293,471,464,7,85.7142857,notHighDep,notHighDep,5.999999999,6.761467888
E01017294,414,320,94,83.3075734,notHighDep,notHighDep,78.309118996,91.384853166
E01017296,330,130,200,85.4085603,notHighDep,notHighDep,170.8171206,191.8287938
E01017297,485,161,324,78.7021631,notHighDep,notHighDep,254.995008444,290.036605716
E01017298,427,47,380,86.2068966,notHighDep,notHighDep,327.58620708,364.6176912
E01017299,423,65,358,71.2945591,notHighDep,notHighDep,255.234521578,298.221388404
E01017300,1324,1079,245,64.144454,notHighDep,notHighDep,157.1539123,230.88564065
E01017301,277,240,37,90.7024793,notHighDep,notHighDep,33.559917341,36.770661161
E01017302,462,448,14,85.0609756,notHighDep,notHighDep,11.908536584,13.359756102
E01017303,521,481,40,70.7720588,notHighDep,notHighDep,28.30882352,38.97058824
E01017304,388,362,26,75.0902527,notHighDep,notHighDep,19.523465702,22.855595672
E01017305,717,663,54,55.7275542,notHighDep,notHighDep,30.092879268,48.148606818
E01017306,360,318,42,65.6880734,notHighDep,notHighDep,27.588990828,34.910091762
E01017307,815,737,78,81.3348416,notHighDep,notHighDep,63.441176448,75.44117646
E01017308,598,538,60,63.6612022,notHighDep,notHighDep,38.19672132,48.6885246
E01017309,543,489,54,66.3805436,notHighDep,notHighDep,35.845493544,50.137339014
E01017310,349,306,43,89.4736842,notHighDep,notHighDep,38.473684206,42.077972715
E01017311,439,387,52,67.5637394,notHighDep,notHighDep,35.133144488,46.033994344
E01017312,755,674,81,64.7606383,notHighDep,notHighDep,52.456117023,69.043882977
E01017315,443,373,70,64.1369048,notHighDep,notHighDep,44.89583336,50.62500002
E01017316,747,703,44,82.2360248,notHighDep,notHighDep,36.183850912,42.524223588
E01017317,428,405,23,76.8768769,notHighDep,notHighDep,17.681681687,20.6861862
E01017320,344,321,23,89.1304348,notHighDep,notHighDep,20.500000004,22.20833333
E01017321,416,301,115,84.4897959,notHighDep,notHighDep,97.163265285,107.489795855
E01017323,358,314,44,90.8548708,notHighDep,notHighDep,39.976143152,42.512922496
E01017324,413,364,49,83.2520325,notHighDep,notHighDep,40.793495925,46.052032502
E01017325,483,391,92,56.1258278,notHighDep,notHighDep,51.635761576,69.609271472
E01017327,443,398,45,73.5426009,notHighDep,notHighDep,33.094170405,40.358744415
E01017329,569,442,127,86.9158879,notHighDep,notHighDep,110.383177633,119.878504718
E01017333,391,364,27,77.3700306,notHighDep,notHighDep,20.889908262,25.472477079
E01017334,319,268,51,76.059322,notHighDep,notHighDep,38.79025422,44.192796573
E01017335,627,492,135,54.8941799,notHighDep,notHighDep,74.107142865,122.499999945
E01017337,740,496,244,51.7902813,notHighDep,notHighDep,126.368286372,234.639386032
E01017338,475,435,40,79.3495935,notHighDep,notHighDep,31.7398374,37.72357724
E01017339,497,435,62,74.3243243,notHighDep,notHighDep,46.081081066,57.717717722
E01017342,560,509,51,69.4986072,notHighDep,notHighDep,35.444289672,45.033426156
E01017344,464,384,80,82.6629681,notHighDep,notHighDep,66.13037448,77.55894592
E01017346,623,510,113,55.9345157,notHighDep,notHighDep,63.206002741,104.67530695
E01017347,495,431,64,72.1288515,notHighDep,notHighDep,46.16246496,56.1120448
E01017348,486,417,69,61.8042226,notHighDep,notHighDep,42.644913594,63.834932757
E01017349,783,663,120,62.4161074,notHighDep,notHighDep,74.89932888,117.98657724
E01017351,708,520,188,81.3169985,notHighDep,notHighDep,152.87595718,181.378254224
E01017352,434,417,17,93.3566434,notHighDep,notHighDep,15.870629378,16.881118881
E01017353,353,138,215,86.6541353,notHighDep,notHighDep,186.306390895,196.40977431
E01017354,546,426,120,70.0342466,notHighDep,notHighDep,84.04109592,106.6438356
E01017355,504,415,89,81.969697,notHighDep,notHighDep,72.95303033,83.740909099
E01017357,472,402,70,63.6650869,notHighDep,notHighDep,44.56556083,53.74407584
E01017358,425,387,38,84.137931,notHighDep,notHighDep,31.97241378,34.134482756
E01017359,648,550,98,76.6519824,notHighDep,notHighDep,75.118942752,94.977973608
E01017360,892,695,197,56.0853199,notHighDep,notHighDep,110.488080203,188.595984925
E01017361,545,447,98,83.68,notHighDep,notHighDep,82.0064,92.9824
E01017362,686,599,87,68.8650307,notHighDep,notHighDep,59.912576709,78.460122717
E01017364,632,508,124,76.6961652,notHighDep,notHighDep,95.103244848,119.061946884
E01017365,731,474,257,81.0271041,notHighDep,notHighDep,208.239657537,243.068473582
E01017367,585,483,102,88.5478158,notHighDep,notHighDep,90.318772116,101.5182999
E01017368,475,432,43,70,notHighDep,notHighDep,30.1,36.810606058
E01017369,439,294,145,77.0597738,notHighDep,notHighDep,111.73667201,128.836833615
E01017370,486,418,68,77.0595691,notHighDep,notHighDep,52.400506988,56.968314372
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment