1. Home
  2. Explore
  3. Statistics
  4. Introduction to Statistics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to Statistics

Probability Distributions

Why probability matters in experimental science

Probability and statistics help scientists describe variation and uncertainty. Repeated measurements made under apparently identical conditions rarely produce exactly the same result. For example, measuring bacterial concentration by optical density at 600600600 nanometers (OD600) across several aliquots may give slightly different readings each time.

Such variation is a normal feature of experimental work. A result can be treated as the outcome of a process that could have produced other possible values. Probability distributions describe those possibilities and how likely each one is.

Understanding probability also helps people interpret scientific findings and data reported in everyday contexts, including public-health reporting. Without a basic understanding of statistical variation, it is easy to mistake an unusual observation for evidence of a special cause.


Random variables and probability distributions

A random variable represents the possible numerical outcomes of a random process or experiment. Before an experiment is performed, its result is uncertain, though the range of possible outcomes may be known. Once the experiment is performed, one value is observed.

For example, when two dice are rolled, the sum can be any integer from 222 to 121212. A particular roll might produce 444; this observed outcome is one realization of the random variable. Repeating the experiment produces further realizations, which can reveal the pattern of variation.

An experiment can therefore be viewed as a process that generates outcomes from a probability distribution. Repeated observations allow the distribution—and thus the uncertainty of the result—to be investigated empirically.

Discrete and continuous random variables

  • Discrete random variables take values from a countable set. Examples include:

    • The sum of two dice.

    • A category such as small, medium, or large.

    • The number of mice that survive a treatment.

  • Continuous random variables can take values across a continuous range. Examples include:

    • A mouse’s weight or a person’s height.

    • Fluorescence intensity.

    • Protein abundance.

A count, such as the number of surviving mice, may be fixed once observed, but it can still be random before the experiment is performed. Repeating the experiment under the same conditions might produce a different count.

What a probability distribution describes

A probability distribution assigns probabilities to the possible outcomes of a random variable.

For two dice, there are 363636 equally likely combinations. The sum 222 can be produced in only one way: 1+11+11+1. The sum 444 can be produced in three ways: 1+31+31+3, 2+22+22+2, or 3+13+13+1. Thus, the sum 444 is more likely than the sum 222.

For a discrete random variable XXX, the probability of a particular outcome kkk is written as:

P(X=k)P(X = k)P(X=k)

For example, if a distribution assigns probability 0.10.10.1 to the outcome 666, then:

P(X=6)=0.1P(X = 6) = 0.1P(X=6)=0.1

The probability of an outcome in a range is found by adding the probabilities of the outcomes in that range. For example:

P(5≤X≤7)=P(X=5)+P(X=6)+P(X=7)P(5 \leq X \leq 7) = P(X=5) + P(X=6) + P(X=7)P(5≤X≤7)=P(X=5)+P(X=6)+P(X=7)

In a graph of a discrete distribution, this corresponds to summing the heights of the relevant probability bars. The probabilities of all possible outcomes sum to 111.


Continuous distributions and tail probabilities

A continuous random variable is described by a probability density function, rather than by a probability assigned to each individual value. The density indicates how probability is distributed across the variable’s range.

For a continuous variable, the probability of observing exactly one specified value is 000:

P(X=a)=0P(X = a) = 0P(X=a)=0

This does not mean that the value cannot be observed. Rather, a single point has no width, and therefore contributes no area under the density curve. Probabilities are found over intervals. For example, the probability that XXX exceeds a threshold aaa is the area under the density curve to the right of aaa:

P(X>a)=∫a∞f(x) dxP(X > a) = \int_a^\infty f(x)\,dxP(X>a)=∫a∞​f(x)dx

Here, f(x)f(x)f(x) is the density function. More generally, probabilities over intervals correspond to areas under the density curve. The total area under a valid density curve is 111.

A tail probability is the probability of a value falling beyond a specified threshold. Tail probabilities are central to statistical testing, where they help assess how unusual an observed result would be under a specified model.


The normal distribution

The normal distribution, also called the Gaussian distribution, is a symmetric, bell-shaped continuous distribution. It is commonly used because many measurements are approximately normal, and because normal distributions arise in important statistical results such as the central limit theorem.

A normal distribution is determined by two parameters:

  • Mean, denoted by μ\muμ, which marks the distribution’s center.

  • Standard deviation, denoted by σ\sigmaσ, which describes its spread.

The variance is the square of the standard deviation, σ2\sigma^2σ2. The normal density can be written as:

f(x)=1σ2πexp⁡(−(x−μ)22σ2)f(x) = \frac{1}{\sigma\sqrt{2\pi}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right)f(x)=σ2π​1​exp(−2σ2(x−μ)2​)

The formula is useful for defining the distribution, but it is generally not necessary to memorize it for routine analysis. In a normal distribution, the mean lies at the center, and the curve is symmetric on either side.

Areas within standard deviations

For a normal distribution:

  • About 68.3%68.3\%68.3% of observations lie within one standard deviation of the mean:

μ−σ≤X≤μ+σ\mu - \sigma \leq X \leq \mu + \sigmaμ−σ≤X≤μ+σ
  • About 95%95\%95% lie within approximately two standard deviations.

  • More precisely, about 95%95\%95% lie within 1.961.961.96 standard deviations of the mean:

μ−1.96σ≤X≤μ+1.96σ\mu - 1.96\sigma \leq X \leq \mu + 1.96\sigmaμ−1.96σ≤X≤μ+1.96σ

Thus, the central 95%95\%95% of a normal distribution leaves about 2.5%2.5\%2.5% in each tail, or 5%5\%5% outside the interval altogether. The number 1.961.961.96 appears frequently in confidence intervals and other statistical calculations.

A three-standard-deviation threshold is sometimes used in fields where measurements can be very precise. The appropriate threshold depends on the scientific context and the consequences of false positives and false negatives.

A statistical significance threshold should not be interpreted as the probability that a conclusion is wrong. For example, a 5%5\%5% significance level does not mean there is a 5%5\%5% probability that a particular result or conclusion is false. It describes a decision rule under specified assumptions; the meaning of a test’s result depends on its model and study design.

Normal distributions in real data

Human height is often approximately normal within a suitably defined population. For example, a large sample of professional baseball players’ heights can be represented reasonably well by a bell-shaped curve. Real measurements are not necessarily perfectly normal; a normal distribution is often an approximation.

The normal distribution’s parameters describe a location and spread, but real-world data can depart from this pattern through skewness, outliers, or other features. Examining the distribution of data before selecting an analysis is therefore important.


The log-normal distribution and log transformation

A positive random variable is log-normally distributed when its logarithm follows a normal distribution. Such data are often right-skewed: most observations are relatively small, while a smaller number are much larger.

This pattern occurs in many biological measurements, particularly in high-throughput experiments such as RNA sequencing, microarrays, and mass spectrometry. Drug potency measurements such as IC50 values may also be log-normally distributed.

Why log-transform data?

Taking the logarithm can make a strongly right-skewed distribution more symmetric and closer to normal. This matters because some statistical methods and common interpretations rely on a roughly normal distribution.

For example, when replicate gene-expression measurements vary over several orders of magnitude, plotting raw values may compress most observations into a small part of the graph. Plotting the values on a logarithmic scale makes variation across the full range easier to see.

A log transformation can also change how summaries should be interpreted. For log-normal data, the arithmetic mean and standard deviation on the original scale may not describe the distribution in the same way they do for normal data. In a normal distribution, about 68%68\%68% of observations lie within one standard deviation of the mean; this rule does not generally hold for the original values of a log-normal distribution.

When using logarithms, the base may be 222, 101010, or the natural logarithm. The mathematical behavior is consistent as long as the analysis is performed consistently, but the base affects how values are interpreted. Base 101010 can be intuitive for presentation: a value of 555 on a base-101010 logarithmic scale corresponds to an original value of 10510^5105. A value of 101010 on a base-222 scale corresponds to 210=10242^{10}=1024210=1024.

The distribution of a dataset should be plotted and inspected before analysis. A log transformation may be useful when data are positive and strongly right-skewed, but it should be chosen to suit the data and the intended analysis.


The Poisson distribution

The Poisson distribution describes counts of events within a defined interval or region, often called a bin. A bin might be a period of time, an area of space, or a combination of the two.

Examples include:

  • Bacterial colonies per plate.

  • Radioactive decays per second.

  • Cell counts in a counting chamber.

  • Mutations in a DNA fragment.

  • Deaths in a population during a specified period.

Counts can vary between repeated observations even when the underlying conditions are unchanged. For instance, a small aliquot of a bacterial solution may contain different numbers of bacteria each time it is sampled.

Conditions and assumptions

The Poisson model is appropriate when events occur randomly and independently within the defined bin, with a stable average rate. In particular:

  • Events are counted within a specified interval, area, or other unit.

  • The count in one bin does not determine the count in another.

  • Events are not strongly clustered or otherwise dependent.

  • The average event rate is reasonably stable across the bins being modeled.

If bacteria clump together, for example, the counts on plates may be more variable than a Poisson model predicts. Clustering violates the assumption that events occur independently.

Formula and parameters

The probability of observing exactly kkk events when the average count is μ\muμ is:

P(X=k)=e−μμkk!P(X=k) = \frac{e^{-\mu}\mu^k}{k!}P(X=k)=k!e−μμk​

The Poisson distribution has one parameter, μ\muμ, which is both its mean and its variance:

E⁡(X)=μ\operatorname{E}(X) = \muE(X)=μ
Var⁡(X)=μ\operatorname{Var}(X) = \muVar(X)=μ

Therefore, its standard deviation is:

σ=μ\sigma = \sqrt{\mu}σ=μ​

Unlike the normal distribution, whose mean and standard deviation can vary independently, a Poisson distribution’s spread is determined by its mean.

Relationship to the normal distribution

As the mean count increases, the Poisson distribution becomes more symmetric and can be approximated by a normal distribution with the same mean and variance. This approximation is less appropriate for small means, where the Poisson distribution may be strongly skewed and has only nonnegative integer outcomes.

Example: deaths caused by horse kicks

Counts of deaths caused by horse kicks in Prussian army corps were analyzed as deaths per corps per year. The average count was approximately 0.70.70.7 per corps-year. Although four deaths in one corps in one year seemed unusually high, that observation could be assessed using the Poisson distribution.

Under the model with mean 0.70.70.7, the probability of four deaths in one corps-year is approximately 0.00780.00780.0078. Across many corps-years, an event with this probability can occur occasionally simply through random variation. A striking count is not by itself proof of a special cause; its plausibility should be evaluated against an appropriate probability model.


The binomial distribution

The binomial distribution describes the number of successes in a fixed number of trials when each trial has two possible outcomes: success or failure.

Its assumptions are:

  • The number of trials, nnn, is fixed.

  • Each trial has two possible outcomes.

  • The probability of success, ppp, is the same for every trial.

  • The trials are independent.

The probability of failure on each trial is 1−p1-p1−p. The binomial distribution answers questions such as: What is the probability of observing exactly kkk successes in nnn trials?

The probability is:

P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k}p^k(1-p)^{n-k}P(X=k)=(kn​)pk(1−p)n−k

Here, (nk)\binom{n}{k}(kn​) counts the number of different arrangements that contain kkk successes among nnn trials.

Example: tossing a coin

For a fair coin, define heads as success. Then p=0.5p=0.5p=0.5, and tails has probability 1−p=0.51-p=0.51−p=0.5. If the coin is tossed eight times, the number of heads follows a binomial distribution with n=8n=8n=8.

The probability of exactly four heads is much larger than the probability of eight heads. There is only one sequence that gives eight heads, but there are many sequences that give four heads. The number of arrangements for four heads in eight tosses is:

(84)=70\binom{8}{4} = 70(48​)=70

This multiplicity of possible arrangements is why four heads is substantially more likely than eight heads.

Mean and standard deviation

For a binomial distribution, the mean is:

μ=np\mu = npμ=np

The variance and standard deviation are:

Var⁡(X)=np(1−p)\operatorname{Var}(X) = np(1-p)Var(X)=np(1−p)
σ=np(1−p)\sigma = \sqrt{np(1-p)}σ=np(1−p)​

These expressions are useful in error estimation for proportions and related analyses.

Relationship to other distributions

For a sufficiently large number of trials and a probability that is not too close to 000 or 111, the binomial distribution can often be approximated by a normal distribution with the same mean and variance.

When the number of trials is large and the probability of success is small, the binomial distribution can often be approximated by a Poisson distribution with mean npnpnp. These approximations are useful because they can simplify calculations, though their suitability depends on the parameter values.


Calculating distribution probabilities in R

R provides a consistent family of functions for many probability distributions. For a given distribution, the function name begins with one of three letters:

  • d gives the density for a continuous distribution or the probability of an exact outcome for a discrete distribution.

  • p gives a cumulative probability, typically the probability that a variable is less than or equal to a specified value.

  • q gives a quantile: the value corresponding to a specified cumulative probability.

For the normal distribution, the functions include dnorm, pnorm, and qnorm. For the binomial distribution, they include dbinom, pbinom, and qbinom. Similar functions exist for Poisson, log-normal, chi-square, and Student’s ttt distributions.

Finding a central 95%95\%95% normal interval

For a standard normal variable, a central 95%95\%95% interval has 2.5%2.5\%2.5% in each tail. The cumulative probability up to the upper endpoint is therefore:

0.95+0.025=0.9750.95 + 0.025 = 0.9750.95+0.025=0.975

The corresponding quantile is obtained with:

qnorm(0.975)

This returns approximately 1.961.961.96. By symmetry, the lower endpoint is approximately −1.96-1.96−1.96, so the central interval is from −1.96-1.96−1.96 to 1.961.961.96 standard deviations from the mean.

Binomial probability examples

To calculate the probability of exactly two heads in eight fair-coin tosses, use:

dbinom(2, size = 8, prob = 0.5)

The arguments specify the number of successes, the number of trials, and the success probability.

To calculate the probability of at least six heads, the cumulative probability through five heads is subtracted from 111:

1 - pbinom(5, size = 8, prob = 0.5)

The value 555 is used because the cumulative calculation includes outcomes up to and including 555, leaving outcomes 666, 777, and 888 in the upper tail.

These distribution functions make it possible to calculate exact probabilities, cumulative probabilities, and quantiles without manually integrating or summing a distribution.


Key distribution summaries

Normal distribution

  • A symmetric, bell-shaped continuous distribution.

  • Described by its mean μ\muμ and standard deviation σ\sigmaσ.

  • Often approximates naturally occurring measurements, though real data may depart from normality.

  • About 68.3%68.3\%68.3% of values lie within one standard deviation; about 95%95\%95% lie within 1.961.961.96 standard deviations.

Log-normal distribution

  • A positive variable is log-normal when its logarithm is normally distributed.

  • Often right-skewed on the original scale.

  • Common in high-throughput biological measurements.

  • A logarithmic scale or transformation can make patterns easier to see and may better suit some analyses.

Poisson distribution

  • A count distribution for events in a defined interval or region.

  • Described by one parameter, μ\muμ, which is both the mean and the variance.

  • Often appropriate when events occur randomly and independently at a stable average rate.

  • Approaches a normal shape as the mean becomes larger.

Binomial distribution

  • Describes the number of successes in a fixed number of independent, two-outcome trials.

  • Determined by the number of trials nnn and success probability ppp.

  • Has mean npnpnp and standard deviation np(1−p)\sqrt{np(1-p)}np(1−p)​.

  • Can be approximated by a normal distribution in some large-trial cases and by a Poisson distribution when success is rare.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent