About me

  • From Bloemfontein, Free State.
  • BSc, BSc (Hons) and MSc Mathematical Statistics, University of the Free State (UFS).
  • PhD Mathematical Statistics, Stellenbosch University (SU) (2019)
  • Research focus: Multivariate data analysis, Data visualisation, missing data analysis, R package development.
  • Current R packages:

Why are we considering descriptive statistics?

  • This is the first stop on our path through data analysis.

  • You can think of it as the mother tongue of data analysis, this is where everyone starts.

  • Questions we need to answer: “What is a typical occurrence?”, “How different is one case from another?”, “Are there unusual subjects?”

  • We are interested in understanding the shape of the data, also referred to as the behaviour of the data.

What is exploratory data analysis?

EDA

Task list for today

  1. Foundations: terminology, data, variable types and measurement scales

  2. Central tendency: triple M (mean, median, mode)

  3. Location: quantiles, percentiles

  4. Dispersion: range, variance, standard deviation, coefficient of variation

  5. Distribution shape: skewness, kurtosis, normality

  6. Table summaries: frequencies and cross tabulations

  7. Choosing suitable visualisations

  8. Final remarks

Focus will be on interpretation, not computation.

gapminder (Bryan (2025)), a real data set will be used throughout to be able to expose the underlying story.
Excerpt from this project: Youtube Hans Rosling: The Joy of Stats

Gapminder

Motivation for this data set: categorical and continuous variables, as well as a time dimension.
Provides possible links between various disciplines: health, economics, demography, political science.

Gapminder

Variable Description
country Country name (142 countries)
continent Africa, Americas, Asia, Europe, Oceania (5 continents)
year 1952–2007, increments of 5 years
lifeExp Life expectancy at birth (in years)
gdpPercap Gross Domestic Product (GDP) per capita (US$); national wealth indicator
pop Population size

Gapminder website

Foundations

General terminology

  • data: plural and typically refers to multiple rows and columns
  • rows: observations, samples, subjects
  • columns: variables, features, measurements
  • again sample: data extracted from a population
  • statistic: a summary from a sample
  • parameter: a summary from a population

Foundations

Variable types and measurement scales

Type Scale Definition Possible summaries
Categorical Nominal Named categories, no order Mode, frequencies
Categorical Ordinal Ordered categories, unequal spacing possible Median, mode, ranks
Numerical Interval Ordered, no true zero Mean, standard deviation, etc.
Numerical Ratio Ordered, true zero Mean, standard deviation, all ratios

Numerical: Continuous or Discrete

Gapminder variable classifications

This is your first step in the process!

Variable Type Scale
continent Categorical Nominal
year Numerical, discrete Interval
lifeExp Numerical, continuous Ratio
gdpPercap Numerical, continuous Ratio
pop Numerical, discrete Ratio

Central tendency

Arithmetic mean, mode and median

  • What is a typical value?
  • Is there a trend?
  • What do we expect to see?

Mean

\[\bar{x} = \frac{\sum_{i=1}^{n}x_i}{n}\] Requirements: numerical data - measured on an interval or ratio scale

  • Gold standard of understanding the average behaviour of data.
  • Best practice to not refer to the mean as the average.
  • Sum of all observations / values divided by the total number of observations / values.
  • All observations are utilised.
  • Disadvantage: Can be easily influenced by extreme values. These are values that are much larger or smaller relative to the majority of values.

Median and Mode

\(M_e \rightarrow\) middle observation of the sorted observations
Requirements: numerical data, measured on an interval, ratio OR ordinal scaled data.

  • Interpretation: 50% of observations are larger than the median, 50% of observations are smaller than the median.
  • Advantage: More robust and not influenced by extreme values.

\(M_o \rightarrow\) observation that occurs the most frequently
Requirements: suitable for ALL measurement scales
The only option for nominal scaled variables.

  • This value gives us some insight of where the peak of the shape of the data is.

Triple M

Figure Zar (2013), page 27.

lifeExp: central tendency (numerical summary)

Consider the life expectancy variable for the year 2007

Summaries:

Statistics Value
Sample size 142
Mean 67.0074
Median 71.9355
Mode no mode

mean \(<\) median

lifeExp: central tendency (visual summary)

Majority of observations on the right. Distribution is skewed to the left - panel (d) on slide 12.
However, mean and median are reasonably close together and in relative closeness. Not severe skewness.

gdpPercap: central tendency (numerical summary)

Consider the life expectancy variable for the year 2007

Summaries:

Statistics Value
Sample size 142
Mean 11 680.07
Median 6 124.371
Mode no mode

mean \(>>>\) median

gdpPercap: central tendency (visual summary)

Majority of observations on the left. Distribution is severely skewed to the right - panel (c) on slide 12.
A small number of wealthy countries pull the mean above “typical” values. Mean and median are very different.

Some comments

  • The mean is probably the most widely used measure of central tendency for numerical data. It is easy to compute and is usually a good indication of the centrality of the data set.
  • The mean is however sensitive to outliers (extreme values).
  • The median and the mode are more robust measures in the sense that they are not particularly sensitive to outliers in the data.
  • Short answer: use the mean, except when there are outliers in the data in which case the median or mode would be more appropriate.

Other location measures

Quantiles, quartiles, percentiles

  • Quantiles: General term to consider a specific location (point) in the sorted data set.
  • Quartiles: the sorted data set is divided into four equal intervals / parts
  • Percentiles: the sorted data set is divided into hundred equal intervals / parts

Quantiles interpretation

  • Similar to the median.
  • Important to remember that these summary statistics refer to a location in the sorted data set.
  • \(P_{20}\): 20th percentile. 20% of observations are smaller than this value and 80% of observations are larger than this value.
  • \(Q_3\): upper quartile. 75% of observations are smaller than this value and 25% of observations are larger than this value.

Quartile visualisation

Boxplot: five-number summary
Minimum, Lower quartile (\(Q_1\)), Median (\(M_e\)), Upper quartile (\(Q_3\)) and Maximum.

Error bars? To be discussed.

Dispersion

Information on the spread and variation of the data

Measures of spread

Range: Maximum - Minimum
Indicates the range of the entire data set.
Take note: Not robust against outliers and skewed distributions.

Interquartile range (IQR): Upper quartile - Lower quartile = \(Q_3 - Q_1\)
Indicates the range over the middle 50% of the data.
Take note: Robust against outliers.

Back to the boxplot

Error bars: \(Q_3 + 1.5\times IQR\) and \(Q_1 - 1.5\times IQR\)
Values above \(Q_3 + 1.5\times IQR \rightarrow\) outliers to the right of the distribution
Values below \(Q_1 - 1.5\times IQR \rightarrow\) outliers to the left of the distribution

Outlier countries

Variance and standard deviation

The variance is a measure of how far observations tend to be away from the mean.

\[s^2 = \frac{\sum_{i=1}^{n}(x_i-\bar{x})^2}{n-1}\]

An easier computational formula:

\[s^2 =\frac{\sum_{i=1}^{n}x_i^2-\frac{(\sum_{i=1}^{n}x_i)^2}{n}}{n-1}\]

  • The mean of the squared differences between each observation / value and the mean.
  • Difficult to interpret in terms of the original scale of the data.

Standard deviation: square-root of the variance. \(s= \sqrt{s^2}\)
Quantification of the variation in the original measurement scale.
Easier to interpret and understand.

Unit-free measure of dispersion

  • It is difficult to understand the magnitude of variation by only considering the standard deviation and variance.
  • A unit-free measurement allows us to understand the variation across different variables.

Coefficient of variation: \(\frac{s}{\bar{x}}\), ratio of the standard deviation and mean

  • Since it expresses relative variation rather than absolute variation, it can be used to compare the variation of variables measured on different scales.
  • Interpreted as a proportion or percentage.

Gapminder: measures of dispersion

Dispersion statistics: Year 2007 (N = 142)
Variable Std. Deviation Variance CV
lifeExp 1.21e+01 1.46e+02 18.02%
gdpPercap 1.29e+04 1.65e+08 110.10%
pop 1.48e+08 2.18e+16 335.34%

Central tendency and dispersion using groups

Life expectancy by continent, still considering 2007

Life expectancy: descriptive statistics by continent, 2007
Continent n Mean Median Std. Deviation Variance CV
Africa 52 54.81 52.93 9.63 92.75 17.57%
Americas 25 73.61 72.90 4.44 19.72 6.03%
Asia 33 70.73 72.40 7.96 63.42 11.26%
Europe 30 77.65 78.61 2.98 8.88 3.84%
Oceania 2 80.72 80.72 0.73 0.53 0.90%

Africa has the most variation around the mean life expectancy.
Europe has the lowest variation around the mean life expectancy.
CAUTION: Oceania small sample size.

Empirical rule

Only suitable for bell-shaped, symmetrical distributions.

  • Calculate and report intervals from the mean and standard deviation.
  • Approximately 68% of observations fall within 1 standard deviation from the mean: \(\bar{x}\pm s\).
  • Approximately 95% of observations fall within 2 standard deviations from the mean: \(\bar{x}\pm 2s\).
  • Approximately 99.7% of observations fall within 3 standard deviations from the mean: \(\bar{x}\pm 3s\).

Distribution shape: skewness, kurtosis, normality

  • General statements have been made about the central tendency measurements and skewness.
  • Skewness refers to the symmetry of the distribution.
  • Kurtosis refers to the shape of the distribution relative to the normal distribution.
  • Formulas for skewness and kurtosis will not be considered today, as there are variants and we typically don’t calculate them manually.
  • Ensure that you are aware of the variant used for your results.
  • Interpretations will be the same.

Distribution shape

Interpreting skewness and kurtosis. Figure: Zar (2013), page 96.

Statistic Skewness Kurtosis
\(\approx 0\) Roughly symmetrical Tails similar to normal distribution
\(>0\) Positively skewed Heavier tails (more outliers)
\(<0\) Negatively skewed Lighter tails (more uniform)

Distribution shape

Typical variants:

Skewness and kurtosis: life expectancy, 2007
Type Convention / Software Skewness Kurtosis
Type 1 (g1 / g2) Simple moment coefficient -0.6815 -0.8428
Type 2 (G1 / G2) Bias-adjusted (SPSS/SAS) -0.6888 -0.8298
Type 3 (b1 / b2) MINITAB/BMDP -0.6743 -0.8731

The three conventions agree on direction (all negative — left-skewed) but differ in magnitude.
Always report which formula/software you used.
This also confirms the previous visual inspection and measures of central tendency (Slide 16).

Normality

Quantile-quantile (QQ) plot

When the points follow the diagonal line closely (“hugging”) it provides evidence of normality.
The concave shape (curves downwards) of life expectancy provides evidence of negative skewness.
The convex shape (curves upwards) of GDP per capita provides evidence of positive skewness.

Some comments

  • Checking for normality is important if hypothesis tests will follow.
  • Model assumption that should hold for example: t-tests, analysis of variance (ANOVA).
  • If there are severe deviations from normality, non-parametric alternative tests can be applied.
  • Again, step 1 of descriptive statistics will guide following steps in the data analysis process.

Table summaries

Frequencies and cross-tabulations

Suitable to summarise information on categorical variables.

Frequencies of continents

Frequency distribution of countries by continent, 2007
Continent Frequency Percentage
Africa 52 36.6%
Asia 33 23.2%
Europe 30 21.1%
Americas 25 17.6%
Oceania 2 1.4%
Total 142 100.0%

Cross-tabultation / contingency table

Using bins for the life expectancy

Countries by continent and life expectancy band, 2007
Continent <60 yrs 60-70 70-80 80+ Total
Africa 40 5 7 0 52
Americas 0 3 21 1 25
Asia 3 8 19 3 33
Europe 0 0 23 7 30
Oceania 0 0 0 2 2
Total 43 16 70 13 142
  • Investigate the relationship between two categorical variables.
  • Next step, tests for independence (\(\chi^2\)-test).

General comments

  • Table caption is placed above the table.
  • Try to be as simplistic as possible with your formatting. Less is more.
  • Round to the same number of decimals. Again, less is more. Be consistent throughout your document.
  • If you add a table, it has to be discussed.

Choosing suitable visualisations

Matching your data to a figure

Data description Possible figure Gapminder example
Counts within categories Bar chart, pie chart Countries per continent
Distribution of one continuous variable Histogram, boxplot Spread of life expectancy
Comparing a variable across groups Boxplot Life expectancy by continent
Relationship between two continuous variables Scatterplot GDP vs. life expectancy
Change over time Line graph Mean life expectancy, 1952–2007
Several variables at once Bubble chart, Biplot GDP, life expectancy, population, continent

Bar chart

Line graph

Only connect data points if they represent sequential measurements, such as time.

Scatterplot

Overall positive trend, but not linear.
A transformation should be applied to GDP before applying correlation or regression techniques.

Scatterplot: Log transformation on GDP

Scatterplot: selected country names

Bubble chart

Four variables in one figure. Wealth, health and population size.

Biplot

Multivariate visualisation tool. Generalised scatterplot.
biplotEZ Lubbe et al. (2024)

Make it move!

moveEZ Ganey and Nienkemper-Swanepoel (2026)

Final remarks

Generally, quantitative results chapters start with descriptive statistics:

  • Characteristics of your sample: sample size, missing values, variables
  • Examine key variables: central tendency and dispersion
  • Distribution / shape diagnostics: check for normality before hypothesis tests
  • Include supporting tables and figures, be selective.
  • Next steps: inferential analysis (hypothesis tests)

Be careful

  • Reporting a mean in isolation without comparing it to the other measures of central tendency.
  • Truncated axes that visually exaggerate small differences
  • Investigate outliers, do not delete them.
  • Don’t include tables or figures without including some discussion / interpretation to accompany it.
  • Don’t generalise confidently from a tiny subgroup — recall Oceania, n = 2.

Important takeaways

  • Descriptive statistics are the foundation every later analysis stands on
  • Choose your statistic based on the variable type and measurement scale
  • Report central tendency and spread together — never one without the other
  • Check distribution shape before assuming the mean is the appropriate summary
  • Let the data type dictate the figure — not habit or software defaults
  • Every table and figure needs a sentence of plain-language interpretation

Resources





Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Questions

nienkemperj@sun.ac.za

References

Anthropic. 2026. Claude (Sonnet 5) [Large Language Model]. https://claude.ai.
Bryan, Jennifer. 2025. Gapminder: Data from Gapminder. https://doi.org/10.32614/CRAN.package.gapminder.
Chang, Winston. 2023. R Graphics Cookbook: Practical Recipes for Visualizing Data. 2nd ed. O’Reilly Media. https://r-graphics.org/index.html.
Ganey, Raeesa, and Johané Nienkemper-Swanepoel. 2026. moveEZ: Animated Biplots. https://github.com/MuViSU/moveEZ.
Healy, Kieran. 2018. Data Visualization: A Practical Introduction. Princeton University Press. https://socviz.co/.
Lubbe, Sugnet, Niël le Roux, Johané Nienkemper-Swanepoel, et al. 2024. biplotEZ: EZ-to-Use Biplots. https://doi.org/10.32614/CRAN.package.biplotEZ.
Wickham, Hadley, Mine Çetinkaya-Rundel, and Garrett Grolemund. 2023. R for Data Science: Import, Tidy, Transform, Visualize, and Model Data. 2nd ed. O’Reilly Media. https://r4ds.hadley.nz/.
Zar, Jerrold H. 2013. Biostatistical Analysis. 5th ed. Pearson.