Member-only story

Building a graph, step by step

Data visualisation depends on analytical choices.

Anthony B. Masters
5 min readDec 21, 2024

Graphs can tell stories about numbers, with clarity and concision. Data visualisation is a great skill for data analysts. Academic papers, business reports, and public debates often include graphs.

The ‘ggplot2’ package in R is a common tool for making these graphs. This article will look at the steps used to create a single graph. Since response rates to the Labour Force Survey reached a low in 2023, let’s work out how to recreate this:

(Image: Office for National Statistics)

With lower response rates, there is higher risk that people who did not answer differ from those who did. Lower responses put more strain on weights to make the sample look like the population. The statistics may be less reliable than when the survey had high response rates.

Graphs have a grammar. Each layer adds new parts to the graph, helping to convey information.

(Image: QCBS R Workshop Series)

Preparation

Preparation and planning are useful skills when making graphs. The data should be in a ‘tidy’ format. That means every row contains a different observation.

--

--

Anthony B. Masters
Anthony B. Masters

Written by Anthony B. Masters

This blog looks at the use of statistics in Britain and beyond. It is written by RSS Statistical Ambassador and Chartered Statistician @anthonybmasters.

No responses yet