How many addresses in every English and Welsh postcode?

How many addresses in every English and Welsh postcode?

It’s getting interesting, isn’t it?

There’s an Office for National Statistics open dataset prosaically called “Postcodes (Enumeration) (2011) to output areas (2011) to lower layer super output areas (2011) to middle layer super output areas (2011) to local authority districts (2011) E+W Lookup” that gives me a relatively rare bit of information: which small output areas (OA) best covers which postcodes (OAs tend to be bigger than postcodes) and which postcodes happen to be split between more OAs. This is particularly interesting data because it brings together two worlds that usually are kept well separated: Census and administrative geography on one size and detailed, postcode-level postal geography on the other.

Unfortunately coverage is for England and Wales only and at the time of the last Census in 2011, but I believe I have good probability to find the same for Scotland.

Well, you may remember about NSAL, that we used to estimate “How many addresses and postcodes in the UK?”. The same dataset gives me the code of the OA each property is in. Do you see where I’m getting at?

By joining the two tables have found out that, for example, that my postcode HP4 3JD is part of output area E00118724. The OA is shared with other 9 postcodes and has a total of 160 properties. Part of one of the postcodes, HP4 3JA, is in another OA (note, though, that we can’t tell which).

Now, if you are starting thinking how I think, you’re wondering: how can I distribute the number of properties vs the postcodes? We could make a very good estimate if we had the number of households per postcode, for example, but we don’t: the Census data is available aggregated by postcode sector only.

Perhaps we don’t need that degree of precision, though. Postcodes are supposed to be around the same size, and nearby postcodes rarely will be dramatically different from a demographic point of view (although it can happen). We may divide the total number of properties evenly across the postcodes. We may ignore the postcode that is partly included in another OA. We get:

… which means that my expectation for HP4 3JD is of 16 addresses. If we asked Royal Mail at http://www.royalmail.com/find-a-postcode we would have instead 28:

That’s not a small difference unfortunately. I guess more work needs to be done in this space.

The full code for this blog post and more is here.