Appendix B — Descriptive Statistics

This appendix provides an overview of essential descriptive statistics for measurement data.

B.1 Measurement scale typology

Before performing any statistical analysis, it is important to understand the type of measurement scale. The typology, originally proposed by Stevens (1946), distinguishes between four types of scales:

Nominal scale: Categories with no inherent ordering. Examples include gender, ethnicity, or answer options in a multiple-choice test (before scoring).

Ordinal scale: Categories with a natural ordering, but distances between categories are not meaningful. Examples include Likert scales (strongly disagree – disagree – neutral – agree – strongly agree) or education level (high school – college – graduate).

Interval scale: Numerical values with meaningful distances, but no true zero point. Examples include temperature in Celsius or calendar year.

Ratio scale: Numerical values with meaningful distances and a true zero point. Examples include height, weight, or response time.

For statistical analysis:

  • Nominal data: Use frequencies, mode, chi-square tests
  • Ordinal data: Use median, percentiles, non-parametric tests
  • Interval/Ratio data: Use mean, standard deviation, parametric tests

B.2 Sample moments and summary statistics

B.2.1 Measures of central tendency

The sample mean (arithmetic average) for \(n\) observations \(x_1, x_2, \ldots, x_n\) is defined as:

\[ \bar{x} = \frac{1}{n} \sum_{i=1}^{n} x_i \tag{B.1}\]

The sample median is the middle value when observations are ordered. For an odd number of observations, it is the middle value. For an even number, it is typically the average of the two middle values.

The mode is the most frequently occurring value.

In R:

data("HCI", package = "ShinyItemAnalysis")
mean(HCI$total)
[1] 12.21198
median(HCI$total)
[1] 12

B.2.2 Measures of dispersion

The sample variance is the average squared deviation from the mean:

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

The sample standard deviation is the square root of the variance:

\[ s = \sqrt{s^2} \tag{B.3}\]

The range is the difference between the maximum and minimum values.

The interquartile range (IQR) is the difference between the 75th and 25th percentiles.

In R:

var(HCI$total)
[1] 13.2473
sd(HCI$total)
[1] 3.639684
range(HCI$total)
[1]  3 20
IQR(HCI$total)
[1] 5

B.2.3 Measures of shape

The sample skewness measures the asymmetry of the distribution:

\[ \text{Skewness} = \frac{1}{n} \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{s} \right)^3 \tag{B.4}\]

  • Skewness = 0: Symmetric distribution
  • Skewness > 0: Right-skewed (positive skew), tail extends to the right
  • Skewness < 0: Left-skewed (negative skew), tail extends to the left

The sample kurtosis measures the “tailedness” of the distribution:

\[ \text{Kurtosis} = \frac{1}{n} \sum_{i=1}^{n} \left( \frac{x_i - \bar{x}}{s} \right)^4 \tag{B.5}\]

  • Kurtosis = 3: Normal distribution (mesokurtic)
  • Kurtosis > 3: Heavy tails, more outliers (leptokurtic)
  • Kurtosis < 3: Light tails, fewer outliers (platykurtic)

Note: Some software reports excess kurtosis (kurtosis − 3), so a normal distribution has excess kurtosis of 0.

In R, the moments package provides these functions:

library(moments)
skewness(HCI$total)
[1] -0.1982404
kurtosis(HCI$total)
[1] 2.347352

B.3 Percentiles and quantiles

The p-th percentile is the value below which p% of the data falls. The quantile function is the generalization, where the 0.25 quantile equals the 25th percentile.

Special quantiles:

  • Q1 (25th percentile): First quartile
  • Q2 (50th percentile): Median
  • Q3 (75th percentile): Third quartile

In R:

quantile(HCI$total, probs = c(0.25, 0.50, 0.75))
25% 50% 75% 
 10  12  15 

B.4 Summary tables

A comprehensive summary can be obtained using:

summary(HCI$total)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   3.00   10.00   12.00   12.21   15.00   20.00 

For more detailed statistics:

psych::describe(HCI$total)
   vars   n  mean   sd median trimmed  mad min max range skew kurtosis   se
X1    1 651 12.21 3.64     12   12.32 4.45   3  20    17 -0.2    -0.66 0.14