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:
- Skewness: Left-skewed (tail to the left), right-skewed (tail to the right), or symmetric.
- Modality: Unimodal (one peak) or bimodal (two peaks).
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 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.
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.
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.
- The box spans from $Q_1$ to $Q_3$, representing the IQR.
- A vertical line inside the box marks the median.
- The whiskers extend from the edges of the box to the smallest and largest data points that are considered outliers.
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.