>This fridayFagPacket was first published as a [blog](https://dataknut.wordpress.com/2020/10/16/retrofit-or-bust/)
<hr>
# fridayFagPackets
Numbers that could have been done on the back of one and should probably come with a similar health warning...
>Find out [more](https://dataknut.github.io/fridayFagPackets/).
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(data.table)
library(ggplot2)
```
# It's the cats, stupid
Inspired by @giulio_mattioli's [recent paper on the car dependence of dog ownership](https://twitter.com/giulio_mattioli/status/1466361022747455492) we thought we'd take a look at [cats](https://twitter.com/giulio_mattioli/status/1466710752606179331) and residential energy demand. Why? Well people like to keep their cats warm but, more importantly, they also cut big holes in doors and/or windows to let the cats in and out. Hardly a thermally sealed envelope!
# What's the data?
For now we're using:
* postcode sector level estimates of cat ownership in the UK. Does such a thing exist? [YEAH](https://t.co/ZEwaB5YEHI)!
* LSOA level data on gas and electricity 'consumption' at LSOA/SOA level aggregated to postcode sectors
cats_DT <- data.table::fread("~/Dropbox/data/UK_Animal and Plant Health Agency/APHA0372-Cat_Density_Postcode_District.csv")
cats_DT[, pcd_sector := PostcodeDistrict]
setkey(cats_DT, pcd_sector)
setkey(postcode_sector_energy, pcd_sector)
pc_district <- cats_DT[postcode_sector_energy]
```
We could also use @SERL_UK's [smart meter gas/elec data](https://twitter.com/dataknut/status/1466712963222540289?s=20), dwelling characteristics and pet ownership (but no species detail :-)
# What do we find?
Well, in some places there seem to be a lot of estimated cats...
LL23 is on the south east corner of the [Snowdonia National Park...](https://www.google.co.uk/maps/place/Bala+LL23/@52.8953768,-3.775299,11z/data=!3m1!4b1!4m5!3m4!1s0x4865404ae1208f67:0x65a437b997c0dfb2!8m2!3d52.8825403!4d-3.6497989) while EH25 is on the outskirts of [Edinburgh](https://www.google.co.uk/maps/place/EH25/@55.8518992,-3.2076308,13z/data=!4m5!3m4!1s0x4887bf6548dd78d7:0xd6f980c5a3b93592!8m2!3d55.8560564!4d-3.1733124).
Is there a correlation between estimated total cats and the number of dwellings (electricity meters)?
```{r testTotalGas}
ggplot2::ggplot(pc_district, aes(x = nElecMeters , y = EstimatedCatPopulation)) +
geom_point() +
geom_smooth()
```
Is there a correlation between estimated cat ownership and energy use?
```{r testTotalGas}
ggplot2::ggplot(pc_district, aes(x = EstimatedCatPopulation, y = total_gas_kWh)) +
geom_point()
```
```{r testMeanGas}
ggplot2::ggplot(pc_district, aes(x = mean_Cats, y = mean_gas_kWh)) +
geom_point()
```
```{r testTotalElec}
ggplot2::ggplot(pc_district, aes(x = EstimatedCatPopulation, y = total_elec_kWh)) +
geom_point()
```
```{r testMeanElec}
ggplot2::ggplot(pc_district, aes(x = mean_Cats, y = mean_elec_kWh)) +