This item is archived. Information presented here may be out of date.

Improving statistics on rough sleeping: how BPI helped MHCLG

Alexander Amaral-Rogers

The Best Practice and Impact (BPI) division, based at the Office for National Statistics (ONS), provides a range of services for the whole Government Statistical Service (GSS) to help improve government statistics.

One service we offer is free consultancy. This can be tailored to any challenges or obstacles that your department faces. Recently, the Quality Centre in BPI completed a consultancy project which reviewed the Quality Assurance (QA) processes in place for rough sleeping statistics published by the Ministry of Housing, Communities and Local Government (MHCLG). We also helped implement reproducible analytical pipelines in the production of the statistics.

The Quality Centre were commissioned by MHCLG to review the QA processes in place for the rough sleeping statistics. This review aimed to identify the main strengths of current processes, as well as making recommendations for change and improvement.

What did we do?

After several meetings with colleagues from MHCLG involved in producing the rough sleeping statistics, we collated our findings and recommendations into a report. We identified four key recommendations relating to the rough sleeping statistics publication itself as well as six additional recommendations to improve the QA processes. These ranged from improving documentation, introducing Reproducible Analytical Pipeline (RAP) processes and using SQL. These tied in nicely with MHCLG’s new IT tools. We also held a peer review workshop with colleagues from across the GSS to review and improve the rough sleeping statistics bulletin.

Sandra Tudor, the Head of Professions for Statistics at MHCLG, said of the quality assurance review:

“We’re really grateful for the way in which the Best Practice and Impact team were able to lead a review of quality assurance for us. They worked well with our teams to understand the practices at MHCLG and made practical recommendations which will help improve our statistics going forwards.”

Implementing RAP methodology

Anthony Ash at MHCLG began development of a reproducible analytical pipeline. David Foster, from BPI, supported MHCLG in this move towards using a more automated approach to produce the rough sleeping statistics.

Anthony transferred storage of survey returns to an SQL server database, which is updated when new data is available from the DELTA data collection system. The production pipeline was subsequently developed in the programming language R. This pipeline retrieves data from the database, calculates the rough sleeping statistics and generates both the bulletin and reference tables, minimising the manual input required to produce the publication. In addition to the published bulletin, the R pipeline generates a report containing quality metrics for the input data, assisting quality assurance of the returns data.

Prior to running the pipeline, analysts can manually update the bulletin commentary, which is written in the form of an Rmarkdown file. The bulletin requires additional processing using the {govspeakr} package, developed by BPI and Public Health England, before the final bulletin and associated content are finally uploaded to the GOV.UK Whitehall Publisher for publication.

Anthony Ash, Homelessness and Troubled Families Team at MHCLG, said of the RAP support:

“The help given to our team by David Foster was invaluable. David was very helpful in offering his advice when we came up against technical hurdles and in demonstrating general good coding practice. Personally, I learnt a lot of coding skills from working alongside David, which I will endeavour to share with my colleagues whenever opportunities arise. It was very reassuring that we had someone of David’s capabilities to call for support during the development of the rough sleeping snapshot RAP.”

The team continues to refine this new process and hope to share the pipeline source code in the near future, via MHCLG’s GitHub page. Further information can also be found in Anthony Ash’s Data in government blog post.

What was the impact?

We were really pleased to see how the MHCLG team had implemented our recommendations, when MHCLG published the latest set of rough sleeping statistics for autumn 2019 in February.

Highlights include:

  • A HTML bulletin which is very clear and easy to navigate for users.
  • A HTML technical report which provides comprehensive information to users on how the rough sleeping statistics are produced and quality assured – this helps users to understand the quality of the statistics.
  • Improved reference tables which provide more detailed breakdowns of the data e.g. by local authority, nationality and age. The new tables are simple in structure and show minimal formatting, enabling users to easily process the data using computers.
  • An infographic which summarises the key findings from the statistics in a clear and concise way.
  • An interactive dashboard, produced using Power BI, which enables users to explore the rough sleeping data and filter by year, local authority and region.

What can we offer you?

BPI has also undertaken significant consultancy projects for Department for International Development and the Office for National Statistics.

This service is available to the whole GSS, if you are interested in this consultancy service or would like to know more about BPI, please email

David Mais and David Foster
Alexander Amaral-Rogers
Both David Mais and David Foster work in the Quality Centre, part of the Best Practice and Impact division.