Skip to main content

Biostatistics in Practice: Principles and Procedures - A MedCalc companion e-book

Visualizing Univariate Data

Visualizations allow us to instantly see the shape, center, and spread of a distribution. While summary statistics such as the mean, standard deviation, and quartiles each capture one dimension of a dataset, a well-chosen chart reveals all of these features simultaneously — together with patterns no single number can convey, such as bimodality or the presence of extreme outliers.

The Histogram

A histogram groups continuous data into consecutive, non-overlapping intervals called bins. The vertical axis displays the frequency (or relative frequency) of data points falling within each bin.

Histograms are excellent for identifying:

Histogram showing the distribution of systolic blood pressure in 200 patients, with bins from 100 to 170 mmHg. The distribution is right-skewed, peaking in the 130–140 mmHg bin.

MedCalc can produce histograms using its Histogram procedure.

Cumulative Frequency Distribution

Where the histogram shows how many observations fall within each interval, the cumulative frequency distribution answers a different question: what fraction of observations fall at or below any given value? The curve starts at 0% at the lowest observed value and rises monotonically to 100% at the highest. Each point on the curve gives the cumulative proportion of the sample with values less than or equal to the corresponding $x$-value.

Cumulative frequency distribution of systolic blood pressure in 200 patients. The S-shaped blue curve rises from 0% at 100 mmHg to 100% at 180 mmHg. Dashed reference lines show Q₁ = 120 mmHg at the 25th percentile, the median = 130 mmHg at the 50th percentile, and Q₃ = 140 mmHg at the 75th percentile.

The quartiles are read directly from the curve: $Q_1$ is the value at which the curve crosses 25%, the median where it crosses 50%, and $Q_3$ where it crosses 75%. Any other percentile can be read off the same way — making the cumulative curve useful for estimating reference interval limits (the 2.5th and 97.5th percentiles).

The shape of the cumulative curve reflects the shape of the underlying distribution. A symmetric distribution produces a symmetrical S-shaped (sigmoid) curve centred on the median. A right-skewed distribution produces a curve that rises steeply at low values, corresponding to the dense left side of the histogram, and then levels off gradually. A bimodal distribution shows an inflection or plateau in the middle of the curve where the two modes are separated.

Technically, the empirical cumulative distribution function (ECDF) is a step function that increases by $1/n$ at each observed value. For large samples the steps are small and the curve appears smooth, as in the figure above.

MedCalc produces cumulative frequency distributions using its Cumulative frequency distribution procedure.

The Normal Plot and Q-Q Plot

The normal probability plot — and its close variant, the Q-Q plot (quantile-quantile plot) — is specifically designed to assess whether a dataset follows a normal distribution. Both plots compare the observed data values against what those values would be expected to be if the data were perfectly normally distributed. The difference between them is presentational: the normal probability plot uses a special probability scale on one axis so that a normal distribution produces a straight line, while the Q-Q plot uses standard axes and plots observed quantiles directly against theoretical quantiles.

In a Q-Q plot, the data are sorted from smallest to largest and each value is paired with the corresponding theoretical quantile of a standard normal distribution. When the data are normally distributed, the points fall close to a straight diagonal reference line. Departures from this line reveal the nature of any non-normality: an S-shaped curve indicates skewness; points arching away from the line at both ends indicate heavier tails than a normal distribution; a single isolated point at one end suggests an outlier rather than a general distributional departure.

Normal Q-Q plot for systolic blood pressure in 20 patients. Blue dots represent the 20 ordered observations plotted against the corresponding theoretical normal quantiles. The points follow the red dashed reference line closely, indicating that the data are approximately normally distributed. The x-axis shows theoretical quantiles from −2 to 2; the y-axis shows observed values from 100 to 160 mmHg.

The Q-Q plot is more sensitive than the histogram to departures in the tails of the distribution, which is precisely where normality matters most for reference intervals and for the validity of significance tests. For this reason it is the preferred graphical tool when assessing whether a parametric method is appropriate. A detailed discussion of normality assessment — including formal statistical tests and the interpretation of specific Q-Q plot patterns — is given in the Are the data normally distributed? chapter.

MedCalc produces both the normal probability plot and the Q-Q plot via its Normal plot procedure.

The Box Plot (Box-and-Whisker Plot)

A box plot visually abstracts a dataset using its five-number summary: minimum, $Q_1$, median ($Q_2$), $Q_3$, and maximum.

Horizontal box plot of systolic blood pressure. The box spans from Q₁ (118 mmHg) to Q₃ (142 mmHg), with a vertical median line at 128 mmHg. Whiskers extend to the minimum (98 mmHg) and maximum non-outlier value (168 mmHg). One outlier is shown at 185 mmHg.

MedCalc can create box-and-whisker plots using its Box-and-whisker plot procedure.

Identifying outliers is an important step in data cleaning. The IQR rule, Grubbs' test, and the Generalized ESD test are covered in detail in the Outlier detection chapter.