Biostatistics: Standard Error, Quantiles, Probability Distributions, and Boxplots

Foundations: Variance, Standard Deviation, and Residuals

  • Exploratory Data Inspection and Summaries:

    • Tabular data import and exploratory analysis provide the baseline for characterizing biological measurements.

    • Histograms illustrate empirical data distributions by plotting either absolute frequencies (counts) or relative frequencies across discrete bin intervals, constructible manually or programmatically in R.

    • Selection between central tendency measures depends on the analytical objective:

    • Arithmetic Mean (xˉ\bar{x}): Sensitive to extreme values and outliers.

    • Median: Robust against outliers and skewed values.

  • Residuum (Residual):

    • Defined as the directed difference (distance) between an observed value (xix_i) and the arithmetic mean (xˉ\bar{x}):     Residuum=xi−xˉ\text{Residuum} = x_i - \bar{x}

Residual distances between individual data points and arithmetic mean
  • Sample Variance (s2s^2):

    • Measures the average squared dispersion of data points around their sample mean:     s2=∑i=1n(xi−xˉ)2n−1s^2 = \frac{\sum_{i=1}^n (x_i - \bar{x})^2}{n - 1}

    • The denominator uses n−1n - 1 (Bessel's correction) degrees of freedom to ensure an unbiased estimator of the population variance.

  • Sample Standard Deviation (ss):

    • The positive square root of the sample variance:     s=s2=∑i=1n(xi−xˉ)2n−1s = \sqrt{s^2} = \sqrt{\frac{\sum_{i=1}^n (x_i - \bar{x})^2}{n - 1}}

    • Unlike variance, standard deviation shares the exact unit of measurement as the original variable and its arithmetic mean, making it directly interpretable in biological contexts.

Standard Error of the Mean (SEM)

  • Parameter vs. Statistic:

    • Population Parameter: A fixed, true numerical characteristic of an entire population, denoted for the mean by the Greek letter μ\mu.

    • Sample Statistic: An empirical estimate calculated from a drawn sample, denoted for the sample mean by xˉ\bar{x}.

    • The sample statistic xˉ\bar{x} serves as an estimator for the unknown population parameter μ\mu.

Estimation of population mean parameter by sample mean statistic
  • Definition and Function of SEM:

    • The Standard Error of the Mean (sem\text{sem} or SEM\text{SEM}) quantifies the precision of the sample mean estimate.

    • Crucial distinction: sem\text{sem} is not a metric for data dispersion or variability within a population; that role is fulfilled solely by standard deviation (ss) and variance (s2s^2).

    • For normally distributed data, the true population mean μ\mu falls within an interval of one standard error (±1 sem\pm 1\,\text{sem}) around the sample mean xˉ\bar{x} with an approximate probability of 68%68\%.

  • Mathematical Formulation:   sem=sn=StandardabweichungAnzahl Datenpunkte\text{sem} = \frac{s}{\sqrt{n}} = \frac{\text{Standardabweichung}}{\sqrt{\text{Anzahl Datenpunkte}}}

    • Where ss is the sample standard deviation and nn is the total number of observations (sample size).

  • Factors Influencing Precision:

    • Variability (ss): A smaller standard deviation produces a smaller sem\text{sem}, increasing estimation precision.

    • Sample Size (nn): A larger sample size reduces sem\text{sem} proportionally to 1n\frac{1}{\sqrt{n}}, narrowing the confidence margin of the estimate.

    • Concrete examples illustrating relationships:

    • Baseline condition: n=100n = 100, s=10→sem=10100=1.0s = 10 \rightarrow \text{sem} = \frac{10}{\sqrt{100}} = 1.0

    • Reduced dispersion: n=100n = 100, s=5→sem=5100=0.5s = 5 \rightarrow \text{sem} = \frac{5}{\sqrt{100}} = 0.5

    • Reduced sample size: n=25n = 25, s=10→sem=1025=2.0s = 10 \rightarrow \text{sem} = \frac{10}{\sqrt{25}} = 2.0

Impact of sample size and standard deviation on the standard error of the mean
  • Application in Group Comparisons:

    • sem\text{sem} is applied when displaying error bars to evaluate differences between group means, such as comparing heights among multiple tree species (e.g., Eichen [oaks], Buchen [beeches], and Mammutbäume [giant sequoias]).

Comparison of group means with standard error bars
  • Computation in R:

    • Calculation of standard deviation:     sd_umfang <- sd(eschendatenumfang)</code></p></li><li><p>Samplesizeacquisition:    <code>numfang<−length(eschendatenumfang)</code></p></li><li><p>Sample size acquisition:     <code>n_umfang <- length(eschendatenumfang)

    • Standard error calculation using square root function sqrt():     sem_umfang <- sd_umfang / sqrt(n_umfang)

Quantiles and Percentiles

  • Definitions and Mathematical Partitioning:

    • The pp-quantile (where p∈[0,1]p \in [0, 1]) divides an ordered set of data points into two defined fractions:

    • Exactly 100×p %100 \times p\,\% of all values lie to the left (below or equal to) the pp-quantile.

    • Exactly 100×(1−p) %100 \times (1 - p)\,\% of all values lie to the right (above) the pp-quantile.

    • Scale Terminology:

    • Quantile: Scaled over the closed real interval [0,1][0, 1].

    • Percentile: Expressed as a percentage over the interval [0,100] %[0, 100]\,\%.

  • Key Reference Quantiles:

    • Minimum (0 %0\,\% smaller): Lowest observed value (p=0.0p = 0.0).

    • 10 %10\,\% Quantile (p=0.10p = 0.10): Threshold delimiting the lowest tenth of observations.

    • Lower Quartile (25 %25\,\% smaller): First quartile (Q1Q_1, p=0.25p = 0.25).

    • Median (50 %50\,\% smaller): Second quartile (Q2Q_2, p=0.50p = 0.50); numerical quantile algorithms can yield small deviations from traditional median definitions due to interpolation procedures.

    • Upper Quartile (75 %75\,\% smaller): Third quartile (Q3Q_3, p=0.75p = 0.75).

    • 90 %90\,\% Quantile (p=0.90p = 0.90): Threshold above which only the top 10 %10\,\% of observations remain.

    • Maximum (100 %100\,\% smaller): Highest observed value (p=1.0p = 1.0).

Histogram of 100 ash tree circumferences marked with key percentile boundaries
  • Biological Applications:

    • Identifying whether an individual organism is atypically small or large within its population.

    • Trimming extreme values (e.g., removing the lowest 5 %5\,\% and top 5 %5\,\% of records) to minimize leverage in downstream statistical tests.

  • Computation in R:

    • Calculated via the quantile() function:     q10 <- quantile(eschendaten$umfang, probs = 0.1)

    • Console output showing the 10th percentile for ash circumference: > q10 10% 29 &nbsp;&nbsp;&nbsp;&nbsp;

Statistical Distributions: Overview and Types

  • Fundamental Classification:

    • Frequency Distribution (Häufigkeitsverteilung): An empirical record showing how frequently each individual value or discrete class of values occurs within an actual sample.

    • Probability Distribution (Wahrscheinlichkeitsverteilung): A theoretical mathematical model specifying how probabilities are apportioned across all potential random outcomes.

  • Methodological Significance:

    • The underlying distributional properties of empirical data dictate the validity of candidate inferential tests.

    • Many classical parametric hypothesis tests mandate that data satisfy the assumption of normality.

    • In linear models, the specific distribution of error terms (residuals) governs the appropriate mathematical modeling approach (e.g., ordinary linear regression versus generalized linear models).

  • Survey of Major Statistical Distributions:

    • Continuous Distributions:

    • Normal Distribution (symmetric, unbounded real values).

    • Log-Normal Distribution (strictly positive, right-skewed).

    • Discrete Distributions:

    • Discrete Uniform Distribution (Gleichverteilung, e.g., standard six-sided die roll where each outcome x∈{1,2,3,4,5,6}x \in \{1, 2, 3, 4, 5, 6\} exhibits P(x)=16≈0.167P(x) = \frac{1}{6} \approx 0.167).

    • Binomial Distribution (bounded discrete successes in repeated binary trials).

    • Poisson Distribution (unbounded count data representing rare events across time or space).

Visual profiles of normal, log-normal, binomial, and Poisson distributionsDiscrete uniform probability distribution of a fair six-sided die

The Normal Distribution (Gaussian Distribution)

  • Biological Example and Law of Large Numbers:

    • In a study measuring sprint hunting velocities (km/h\text{km/h}) of cheetahs (Acinonyx jubatus), as the sample size increases (N=20→N=200→N=2,000→N=20,000N = 20 \rightarrow N = 200 \rightarrow N = 2{,}000 \rightarrow N = 20{,}000), the empirical relative frequency histogram progressively smooths and converges onto the continuous theoretical bell curve (Gaussian curve).

Convergence of sample relative frequencies to theoretical Gaussian curve with increasing sample size
  • Properties of the Normal Distribution:

    • A continuous distribution spanning the entire domain of real numbers (−∞<x<∞-\infty < x < \infty).

    • Perfectly symmetric around the mean.

  • Probability Density Function (PDF):

    • The mathematical formula defining probability density f(x)f(x) is:     f(x)=1σ2πe−12(x−μσ)2f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2} \left(\frac{x - \mu}{\sigma}\right)^2}

    • Parameters:

    • μ\mu: Population mean (expected value).

    • σ\sigma: Population standard deviation.

    • Important parameter note: Population parameters μ\mu and σ\sigma are utilized here rather than sample estimates xˉ\bar{x} and ss.

  • Concept of Probability Density:

    • In any continuous probability distribution, the probability of obtaining an exact, infinitesimally precise point value is zero:     P(X=x)=0P(X = x) = 0

    • The function value f(x)f(x) represents probability density rather than discrete probability.

    • Actual probability is computed by integrating the probability density over an interval [a,b][a, b], representing the geometric area under the curve:     P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_{a}^{b} f(x)\,dx

    • Numerical example: For a cheetah velocity distribution with μ=80 km/h\mu = 80\,\text{km/h} and σ=10 km/h\sigma = 10\,\text{km/h}, the probability of recording a velocity between 60 km/h60\,\text{km/h} and 61 km/h61\,\text{km/h} is:     P(60≤X≤61)=0.006=0.6 %P(60 \le X \le 61) = 0.006 = 0.6\,\%

  • Modulation of Parameters:

    • Altering μ\mu translates the distribution along the horizontal axis without altering its geometry (e.g., moving the central peak from μ=80 km/h\mu = 80\,\text{km/h} to μ=90 km/h\mu = 90\,\text{km/h} with fixed σ=10 km/h\sigma = 10\,\text{km/h}).

    • Altering σ\sigma alters the breadth and height: increasing σ\sigma from 10 km/h10\,\text{km/h} to 14 km/h14\,\text{km/h} (with fixed μ=80 km/h\mu = 80\,\text{km/h}) widens and flattens the distribution curve.

Comparative curves showing variations in mean position and standard deviation width
  • Empirical Rule (68–95 Rule):

    • Approximately 68.27 %68.27\,\% of all observations reside within one standard deviation of the mean:     [μ−σ,μ+σ][\mu - \sigma, \mu + \sigma]

    • Approximately 95.45 %95.45\,\% of all observations reside within two standard deviations of the mean:     [μ−2σ,μ+2σ][\mu - 2\sigma, \mu + 2\sigma]

Empirical probability density areas covering 68.27% and 95.45% of a normal distribution

The Poisson Distribution

  • Characteristics of Count Data (Zähldaten):

    • Models non-negative integer values (x∈{0,1,2,3,… }x \in \{0, 1, 2, 3, \dots\}).

    • Strictly bounded on the left by zero, extending infinitely upward with no fixed upper limit (NN is unbounded or infinite).

    • Connected line plots shown in graphical representations serve exclusively as visual aids; intermediate real values do not exist.

  • Biological Application:

    • Number of flower heads (capitula) per plant: observed with an average count of λ=2.5\lambda = 2.5.

    • The distribution is asymmetric and right-skewed (skewed toward higher values), with many plants possessing fewer than three capitula.

  • Single-Parameter Structure:

    • Controlled by a single parameter λ\lambda (lambda), which simultaneously specifies both the expected mean and the variance:     μ=λ\mu = \lambda     σ2=λ\sigma^2 = \lambda

    • Probability mass function:     p(x)=λxx!e−λp(x) = \frac{\lambda^x}{x!} e^{-\lambda}

    • Where x!x! represents the factorial function:     x!=x×(x−1)×(x−2)×⋯×1x! = x \times (x - 1) \times (x - 2) \times \dots \times 1

    • With 0!=10! = 1.

  • Behavior as λ\lambda Changes:

    • For low values of λ\lambda (λ=1,2,3\lambda = 1, 2, 3), the distribution is right-skewed with peak mass at low counts.

    • As λ\lambda increases (λ=5,10\lambda = 5, 10), the distribution shifts rightward, broadens, and becomes symmetrical, increasingly approximating a normal distribution.

Poisson distribution probabilities across increasing values of lambda

The Binomial Distribution

  • Properties of Bernoulli Trials:

    • Models discrete count data arising from a fixed, predetermined total number of trials (NN).

    • Each individual trial permits exactly two mutually exclusive outcomes: "success" (with probability pp) or "failure" (with probability 1−p1 - p).

    • Examples:

    • Coin tossing: Heads or Tails (pKopf=0.5p_{\text{Kopf}} = 0.5, pZahl=0.5p_{\text{Zahl}} = 0.5).

    • Board game dice rolls: Rolling a six (p6=16p_6 = \frac{1}{6}, p≠6=56p_{\ne 6} = \frac{5}{6}).

    • Plant ecology: Seedling establishing versus failing to establish.

    • Focuses on aggregate outcomes over multiple independent trials (e.g., getting exactly 2 heads in 3 coin tosses, getting zero sixes in 3 dice rolls, or at least 50 established seedlings out of 100 plantings).

  • Key Contrast with Poisson Distribution:

    • In a binomial distribution, the total potential trial pool (NN) is finite and explicitly known (observing kk successes out of NN attempts), unlike unbounded Poisson count processes.

  • Mathematical Formulations:

    • Mean (expected value):     μ=N×p\mu = N \times p

    • Variance:     σ2=N×p×(1−p)\sigma^2 = N \times p \times (1 - p)

  • Influence of Success Probability (pp):

    • As pp approaches 0.50.5, the distribution achieves maximum variance and becomes symmetrical.

    • As pp shifts toward either 00 or 11, the distribution narrows and becomes asymmetric.

    • Ecological case study: Tagging N=100N = 100 European moles (Talpa europaea). When evaluating survival through a spring flooding event with per-individual survival probabilities p∈{0.1,0.25,0.5,0.75,1.0}p \in \{0.1, 0.25, 0.5, 0.75, 1.0\}, the distribution of surviving individuals displays maximal spread at p=0.5p = 0.5, collapsing to zero variance at p=1.0p = 1.0.

Binomial probability distributions for mole survival across different individual survival probabilities

Cumulative Probability Functions

  • Definition:

    • The cumulative probability function (F(x)F(x)) represents the probability that a random variable XX takes on a value less than or equal to a specified threshold xx:     F(x)=P(X≤x)F(x) = P(X \le x)

    • For continuous variables, F(x)F(x) is the definite integral of the probability density function f(x)f(x) evaluated from negative infinity to xx:     F(x)=∫−∞xf(t) dtF(x) = \int_{-\infty}^{x} f(t)\,dt

    • As x→∞x \rightarrow \infty, cumulative probability converges strictly to 11:     lim⁡x→∞F(x)=1.0\lim_{x \rightarrow \infty} F(x) = 1.0

  • Cumulative Probability in the Normal Distribution:

    • For cheetah velocities with μ=80 km/h\mu = 80\,\text{km/h} and σ=10 km/h\sigma = 10\,\text{km/h}:

    • Probability of a velocity X≤70 km/hX \le 70\,\text{km/h}:       F(70 km/h)=P(X≤70 km/h)=0.16F(70\,\text{km/h}) = P(X \le 70\,\text{km/h}) = 0.16

    • Probability of a velocity X≤80 km/hX \le 80\,\text{km/h}:       F(80 km/h)=P(X≤80 km/h)=0.50F(80\,\text{km/h}) = P(X \le 80\,\text{km/h}) = 0.50

    • Interval probability between 70 km/h70\,\text{km/h} and 80 km/h80\,\text{km/h}:       P(70≤X≤80)=F(80 km/h)−F(70 km/h)=0.50−0.16=0.34P(70 \le X \le 80) = F(80\,\text{km/h}) - F(70\,\text{km/h}) = 0.50 - 0.16 = 0.34

Cumulative distribution function curve of cheetah velocityShaded area representing probability between 70 and 80 km/h under the normal curve
  • Cumulative Probability in Discrete Distributions:

    • Poisson Distribution Example:

    • Calculating the probability of observing between 4 and 6 flower heads per plant:       P(4≤X≤6)=F(X≤6)−F(X≤3)P(4 \le X \le 6) = F(X \le 6) - F(X \le 3)

    • Binomial Distribution Example:

    • Calculating the probability that 81 or more of the 100 marked moles survive the flood:       P(X≥81)=1−F(X≤80)P(X \ge 81) = 1 - F(X \le 80)

Cumulative distribution versus density function for Poisson count dataCumulative probability calculation for binomial mole survival

Distribution Morphology: Skewness and Kurtosis

  • Skewness (Schiefe):

    • Quantifies the degree of horizontal asymmetry of a probability distribution around its center.

    • Modalwert (Mode): The value of xx corresponding to the peak frequency or maximum probability density.

    • Symmetric Distributions (e.g., Normal Distribution):     Mean=Median=Mode\text{Mean} = \text{Median} = \text{Mode}

    • Right-Skewed / Positive Skew (rechtsschief):

    • Characterized by an elongated tail extending to the right toward larger positive values.

    • Relationship between central tendency metrics:       Mode<Median<Mean\text{Mode} < \text{Median} < \text{Mean}

    • Left-Skewed / Negative Skew (linksschief):

    • Characterized by an elongated tail extending to the left toward smaller or negative values.

    • Relationship between central tendency metrics:       Mean<Median<Mode\text{Mean} < \text{Median} < \text{Mode}

Profile of a right-skewed distribution indicating the ordering of mode, median, and mean
  • Kurtosis (Wölbung):

    • Measures the tailedness and central concentration (peakedness) of a distribution relative to a standard Gaussian curve.

    • Characterizes how steeply the distribution ascends toward its central peak and tapers down.

    • Morphological Categories:

    • Steilgipflig (Leptokurtic): Sharply peaked with heavy tails.

    • Normalverteilt (Mesokurtic): Standard baseline curvature characteristic of a Gaussian distribution.

    • Flachgipflig (Platykurtic): Broad, flattened central peak with thinner tails.

Exploratory Data Analysis: Boxplots

  • Purpose and Relative Utility:

    • Graphical representation condensing univariate data distributions into five summary statistics.

    • While histograms require substantial visual space to depict full bin frequencies, boxplots aggregate distributional properties into a compact space, enabling side-by-side multigroup comparisons.

  • Structural Anatomy of a Boxplot:

    • Median (Q2Q_2, 50 %50\,\% Quantile): Solid horizontal bar dividing the box.

    • Interquartile Range (IQR\text{IQR} / Box Height):

    • Lower Box Hinge (Q1Q_1): Lower quartile, representing the 25 %25\,\% quantile (0.250.25-quantile).

    • Upper Box Hinge (Q3Q_3): Upper quartile, representing the 75 %75\,\% quantile (0.750.75-quantile).

    • The interior of the box spans the central 50 %50\,\% of all observed data points.

    • Whiskers (Antennen):

    • Upper Whisker: Extends to the largest observed data point that does not exceed 1.5×IQR1.5 \times \text{IQR} above the upper quartile (≤Q3+1.5×IQR\le Q_3 + 1.5 \times \text{IQR}).

    • Lower Whisker: Extends to the smallest observed data point that is not further than 1.5×IQR1.5 \times \text{IQR} below the lower quartile (≥Q1−1.5×IQR\ge Q_1 - 1.5 \times \text{IQR}).

    • Outliers (Ausreißer): Any data point positioned beyond the 1.5×IQR1.5 \times \text{IQR} boundary, depicted individually as standalone open circles.

Structural components and quantile boundaries of a standard boxplot
  • Implementation in R:

    • Single Variable Boxplot:r boxplot(eschen$umfang, ylab = "Umfang (cm)", main = "Umfang von 100 Eschen") &nbsp;&nbsp;&nbsp;&nbsp;

  • Multigroup Grouped Boxplot:

    • Data file ("03_Baeume.txt") containing tree species (Art) and corresponding height records (Hoehe) for Birke (birch), Buche (beech), and Eiche (oak). r baeume <- read.table("03_Baeume.txt", header = TRUE) boxplot(Hoehe ~ Art, data = baeume, xlab = "Baumart", ylab = "Höhe (m)") &nbsp;&nbsp;&nbsp;&nbsp;

  • Model Formula Notation: The formula syntax y ~ x instructs R to model the dependent response variable yy conditioned across levels of the categorical predictor xx (here: tree height conditioned on tree species).

Comparative grouped boxplots of heights across birch, beech, and oak trees

Data Subsetting in R

  • Purpose and Use Case:

    • Isolates subsets of records from a full data frame based on logical evaluation of one or more variables.

  • The subset() Function:

    • Syntax structure: r nur_eichen <- subset(baeume, Art == "Eiche") &nbsp;&nbsp;&nbsp;&nbsp;

    • Arguments:

    • First parameter specifies the target data frame (baeume).

    • Second parameter specifies the logical filter condition (Art == "Eiche").

  • Logical Operators:

    • ==: Logical identity equality check (composed of two consecutive equal signs).

    • !=: Logical inequality check (not equal to).

  • Downstream Computation on Subsets:

    • Standard descriptive functions applied to isolated variables: r mean(nur_eichenHoehe) &nbsp;&nbsp;&nbsp;&nbsp;

  • Console output: > mean(nur_eichenHoehe) [1] 22.7422 &nbsp;&nbsp;&nbsp;&nbsp;