Statistics
Statistics is the science of collecting, analyzing, presenting, and interpreting data.[1] Statisticians usually study a small part of a group, called a sample, and use it to learn about the whole group. A sample is not guaranteed to match the whole group, so statistics uses probability to measure how sure we can be of each conclusion.[2]
Much of the early push for statistics came from governments that needed census data (official counts of the population) and facts about trade and money.[1] In 17th-century England this work was called political arithmetic, "the art of reasoning by figures, upon things relating to government."[3] Today many fields rely heavily on statistics, including:[1]
- health care and biology
- chemistry and physics
- education and engineering
- business and economics
Populations, samples, and data
A population is the whole collection of people, things, or events under study. A sample is a part of the population. Researchers study samples because measuring every member usually costs too much or is impossible.[2][4]
A parameter is a number that describes the population, such as the average amount all first-year students at a college spend in a term. A statistic is the matching number worked out from the sample. A central question in the field is how well a statistic estimates its parameter.[2]
A variable is a feature measured on each member, such as age or income. There are two main types:[1][2]
- Quantitative (numerical) variables measure how much or how many, such as income.
- Qualitative (categorical) variables place each member in a named group, such as marital status.
The field has two broad branches:
- Descriptive statistics summarizes data with tables, graphs, and numbers such as an average.[1]
- Inferential statistics uses data from a sample to make statements about a population. Its main tools are estimation and hypothesis testing.[1]
Collecting data
How data are collected decides what they can show. Sample surveys collect data for observational studies, which record what happens without assigning treatments. Experimental design, the planning of how an experiment assigns treatments and measures outcomes, collects data for experiments.[1][5]
Sampling
In random sampling, each member of the population starts with an equal chance of being chosen. This helps the sample have the same features as the population.[4] The common methods of sampling are:
- Simple random sample: every group of members is as likely to be chosen as any other group of members.
- Stratified sample: the population is split into groups called strata, and a random sample is taken from each one, sized in proportion to the stratum.
- Cluster sample: the population is split into groups called clusters, some clusters are picked at random, and every member of those clusters is included.
- Systematic sample: a random starting point is picked, then every th member of a list is taken.
- Convenience sample: a non-random sample of whoever is easy to reach. Its results may be good or highly biased.[4]
Two kinds of error affect samples:[4]
- Sampling error comes from chance differences between samples. Two random samples from the same population will usually differ, and larger samples usually have smaller sampling error.
- Sampling bias comes from unequal chances of selection, when some members are less likely to be chosen than others. It can lead to wrong conclusions.
Experiments and observational studies
An experiment tests whether one variable causes change in another. The researcher sets the explanatory variable (the factor being tested), whose values are called treatments, and measures the response variable (the outcome).[5]
Random assignment is what lets an experiment show cause and effect. When subjects are assigned to treatments at random, lurking variables (other factors that could affect the result) are spread evenly among the groups. The only planned difference between groups is then the treatment.[5]
Many experiments add further safeguards, as in a randomized controlled trial:
- A control group receives a placebo, a treatment that cannot directly affect the response.
- Blinding means a person in the study does not know who receives the real treatment.
- In a double-blind experiment, both the subjects and the researchers working with them are blinded.[5]
In an observational study, researchers record what happens without assigning treatments. Some variables, such as a person's birth order, cannot be assigned at random, so the groups being compared also differ in other ways.[5] This can cause confounding, where the effects of several factors cannot be separated.[4]
Describing data
Center
A measure of center gives a typical value for the data. The three common ones are the mean, the median, and the mode.[6]
The mean (average) is the sum of the values divided by how many there are:
Here are the data values and is the number of values.[6]
- The median is the middle value, with half the data below it and half above. When is even, it is the average of the two middle values.
- The mode is the value that occurs most often. A data set can have more than one mode.[6]
The three measures agree for the normal distribution, which is symmetric. In a skewed distribution, the mean is pulled toward the longer tail.[6]
A few extreme values can distort the mean but not the median. For data with extreme values, the median is often the better typical value.[6]
Spread
A measure of spread shows how far the values are scattered. The sample variance and standard deviation are
where is the sample mean.[7]
Squaring gives more weight to points far from the mean: a point 2 units away adds 4 to the sum, while a point 10 units away adds 100. The standard deviation puts the spread back in the units of the data.[7]
- The range is the largest value minus the smallest. It uses only the two extremes.
- The interquartile range is the 75th percentile minus the 25th percentile, where a percentile is the value below which that percentage of the data falls. It measures the spread of the middle half of the data.[7]
Graphs
A histogram counts how many values fall in each interval and draws the counts as bars. It shows both the spread near the center and the shape of the tails.[7] A histogram also shows whether data have one peak or several.[6]
Probability and distributions
A probability distribution describes how likely each possible value of a variable is. Inferential statistics uses probability to judge how confident we can be in a conclusion.[2]
The normal distribution
The normal distribution is a symmetric, bell-shaped curve with a single peak at the center.[6] It is set by its mean and standard deviation . The 68-95-99.7 rule describes how its values spread out:[8]
- About 68% of values lie within one standard deviation of the mean.
- About 95% lie within two standard deviations.
- About 99.7% lie within three standard deviations.
Sampling distributions and the central limit theorem
A statistic changes from one sample to the next. The sampling distribution of the mean is the distribution of over many repeated samples of the same size .[9]
The central limit theorem describes that distribution. Take random samples of size from a population with mean and finite variance . As grows, the sample means come closer to a normal distribution with mean and variance , whatever the shape of the population.[9][10]
The standard error of the mean, , describes how far the sample mean typically falls from the population mean.[9] Some textbooks treat a sample size of about 30 as large enough for the normal approximation.[10]
The finite-variance condition matters. The Cauchy distribution is symmetric with a single peak, but it is heavy-tailed, meaning extreme values are far more common than in a normal distribution. For it, collecting more data does not give a more accurate estimate of the mean, and the median is a far better typical value.[6]
Statistical inference
Estimation and confidence intervals
An estimator is a rule that turns sample data into an estimate of a parameter, such as using to estimate . Because the estimate changes from sample to sample, statisticians often give a confidence interval, a lower and upper limit for the parameter.[11] A common interval for a mean is
where is the sample mean, the sample standard deviation, and the sample size. The value comes from Student's t-distribution with degrees of freedom, a count that picks which t-distribution to use. The confidence level is .[11]
The 95% level is the most widely used, with 90% and 99% also common.[11]
The interval gets narrower as grows and wider as grows.[11]
For small samples, this method assumes the population is roughly normal. For large samples, the central limit theorem makes the normal approximation reasonable.[10]
A 95% confidence interval does not mean there is a 95% probability that this particular interval contains the true mean. Any computed interval either contains the mean or does not. The 95% describes the method: over many samples, about 95% of the intervals built this way would contain the true mean.[11]
Hypothesis testing
A hypothesis test checks whether data fit a specific claim about the population. The claim being tested is the null hypothesis . It often says there is no effect, such as no difference between two groups.[12]
A one-sample t-test for a mean works in four steps:[11]
- State and the alternative hypothesis , the claim tested against .
- Choose a significance level , the chance of wrongly rejecting a true that the test allows.[13] The most common value is 0.05.
- Compute the test statistic .
- Reject if is larger than the critical value , the cutoff that decides the test.
Tests and intervals agree. If a 95% confidence interval does not contain , then is rejected at the 0.05 level.[11]
The p-value summarizes the evidence against . It is the probability, under a specified statistical model (a set of assumptions about how the data arise), that a summary of the data would be equal to or more extreme than the value observed. The smaller the p-value, the less the data fit , provided the assumptions behind it hold.[12]
A result that passes the chosen cutoff, such as a p-value below 0.05, is called statistically significant. Fisher suggested 0.05 as a useful cutoff in 1925.[14]
Errors and power
A test can go wrong in two ways, called type I and type II errors.[13]
| Decision | is true | is false |
|---|---|---|
| Reject | Type I error (probability ) | Correct (probability , the power) |
| Keep | Correct | Type II error (probability ) |
Power is the probability of correctly rejecting a false . Neyman and Pearson often used of 5% or 1%, and proposed 20% as an upper limit for , which means power of at least 80%.[13] Power rises with sample size, effect size (how large the true difference or effect is), and , so researchers choose a sample size in advance to reach good power.[13]
What a p-value does not show
In 2016 the American Statistical Association issued a statement on p-values to correct common misreadings.[12] Among its points:
- A p-value is not the probability that the hypothesis is true, nor the probability that the data came from chance alone.
- A p-value does not measure the size of an effect or how important a result is.
- A p-value near 0.05, by itself, is only weak evidence against .
- A large p-value is not evidence for , because many other hypotheses may fit the data as well or better.[12]
See Misuse of p-values for more.
Relationships between variables
Correlation
The correlation coefficient measures the strength and direction of a straight-line relationship between two variables and . It always lies between and .[15]
- A positive means tends to rise when rises. A negative means tends to fall.
- At or , all points lie exactly on a straight line.
- An near 0 means little linear relationship, but the data may still follow a curve, so the scatterplot should be checked.[15]
A relationship between two variables does not mean one causes the other. They may be linked through a third variable.[4] This principle is often stated as correlation does not imply causation.
Regression
Linear regression fits a straight line to paired data. The least-squares line is the one that makes the sum of squared errors (the vertical gaps between points and line) as small as possible:[15]
Here is the slope, the intercept (the value of where the line crosses the -axis, at ), and and the means. The formula needs the values to not all be equal, so the denominator is not zero. The sign of always matches the sign of .[15]
The name regression comes from Francis Galton. He found that unusually large or small parent seeds tended to produce offspring seeds closer to the average, a pattern now called regression toward the mean.[16] The wider field of fitting such relationships is regression analysis.
Frequentist and Bayesian approaches
The two major theories of statistical method are classical (frequentist) statistics and Bayesian statistics.[17] They differ mainly in what a probability means.
Frequentist statistics
Frequentist statistics treats probabilities as frequencies, or proportions within a class of similar events. Its procedures rely only on probabilities over the samples that could be drawn.[17]
An estimation method picks the hypothesis that best fits the sample. A test points to a hypothesis that makes the sample too improbable, which is then a candidate for rejection.[17] Confidence intervals and p-values come from this tradition.
Bayesian statistics
Bayesian statistics is named after Thomas Bayes. It allows a probability to be assigned to a hypothesis, expressing how strongly one believes it.[17] A prior probability is combined with the likelihood (the probability of the observed data under a given hypothesis) to give a posterior probability, using Bayes' theorem:[17]
Here is a hypothesis, is the observed sample, is the prior, is the likelihood, and is the posterior. This process is also called Bayesian inference.
Where they disagree
Much of the debate centers on the likelihood principle. It says the evidence in the data depends only on how likely the observed data are under each hypothesis.[17] Bayesian methods follow it, since only the prior and the likelihood of the observed data matter. Classical tests break it, because their results also depend on samples that could have been observed but were not.[17]
| Feature | Frequentist | Bayesian |
|---|---|---|
| Meaning of probability | Frequency in a class of similar events | Degree of belief |
| Probability of a hypothesis | Not assigned | Assigned (prior and posterior) |
| Main tools | Estimators, tests, confidence intervals | Prior, likelihood, Bayes' theorem |
| Likelihood principle | Not followed | Followed |
History
Political arithmetic
Statistics as a study of data is often traced to John Graunt, a London businessman. Around 1660 he began analyzing London's bills of mortality, the city's published death records, and in 1662 he published Natural and Political Observations Made upon the Bills of Mortality.[18] According to Kenneth Rothman, an epidemiologist (a scientist who studies patterns of health and disease), Graunt:[18]
- was the first to document that more boys than girls are born
- presented one of the first life tables
- gave the first reasoned estimate of London's population
Graunt's friend William Petty introduced the term political arithmetic around 1672. Charles Davenant later defined it as "the art of reasoning by figures, upon things relating to government."[3]
The word statistics
In 1749 the German professor Gottfried Achenwall used the word Statistik for collecting numbers about the state and recording them in tables. Before then, terms such as political arithmetic covered this work.[19] Sir John Sinclair's Statistical Account of Scotland, from the 1790s, helped set the modern meaning of the word.[19]
Least squares
Adrien-Marie Legendre first published the method of least squares in 1805, in an appendix to a work on the orbits of comets. In 1809 Carl Friedrich Gauss wrote that he had used it since 1795, while noting that Legendre published it first.[20]
Correlation and regression
In 1875 Galton sent packets of sweet pea seeds to seven friends and plotted the weights of offspring seeds against those of the parent seeds.[16] He presented his first regression line in a lecture in 1877. In 1896 Karl Pearson published the first full mathematical treatment of correlation and regression, crediting Auguste Bravais (1846) with the first formulas for correlation.[16]
Classical inference
Ronald Fisher extended significance tests in papers from 1922, including tests based on Student's t-distribution.[14] His 1925 book Statistical Methods for Research Workers brought these tests to experimenters in many fields, and The Design of Experiments followed in 1935.[14]
Jerzy Neyman and Egon Pearson developed a rival theory of testing from 1928, adding an alternative hypothesis, the type II error, and power.[13] Their 1933 paper proved the result now called the Neyman-Pearson lemma.[21]
Null hypothesis significance testing, the method taught today, mixes the Fisher and Neyman-Pearson approaches. E. F. Lindquist first put it together in 1940, and critics call the mix incompatible, meaning its two parts do not fit together.[13] The statistician E. L. Lehmann wrote that classical statistical theory was mainly the creation of Fisher (1890 to 1962) and Neyman (1894 to 1981), even though the two detested each other.[22]
The computer era
Computers made new methods practical. The bootstrap, introduced by Bradley Efron in 1979, resamples the observed data to study the distribution of statistics that are too complicated to work out by formula.[23] Methods like this belong to computational statistics.
Common pitfalls
Many errors in using statistics come from how data are gathered or read. Common ones include:[4]
- Biased samples, such as self-selected call-in surveys, or surveys where many people refuse to answer.
- Confounding, where several factors are mixed together and their effects cannot be separated.
- Reading causation into a correlation.
- Misleading graphs, incomplete data, or missing context.
- Misreading p-values, as described above.[12]
Running many tests at once is a further trap, called the multiple comparisons problem. If enough tests are run, some are likely to pass the chosen significance cutoff even when there is nothing to find.[24]
In the dead salmon study, Craig Bennett and colleagues scanned a dead Atlantic salmon with a brain scanner (functional magnetic resonance imaging, or fMRI) and, without correction, found three "significant" spots of activity. After correcting for multiple comparisons, the spots disappeared. The work was presented in 2009 and won an Ig Nobel Prize in 2012.[24]
See Misuse of statistics for more examples.
Branches and related fields
Statistics has many branches and close neighbors:
- Mathematical statistics studies the theory behind statistical methods, built on probability.
- Applied statistics and biostatistics use those methods on real problems, biostatistics in biology and medicine.
- Computational statistics develops computer-intensive methods such as the bootstrap.[23]
- Multivariate statistics studies relationships among two or more variables, while univariate methods study one variable at a time.[1]
- Time series analysis and spatial analysis handle data ordered in time or in space.
- Data science, data analysis, and machine learning overlap heavily with statistics.
References
- Statistics, Encyclopaedia Britannica.
- 1.1 Definitions of Statistics, Probability, and Key Terms, Introductory Statistics 2e, OpenStax, 2023.
- John Graunt F.R.S. (1620-74), Journal of Medical Biography (University of Birmingham repository), 2022.
- 1.2 Data, Sampling, and Variation in Data and Sampling, Introductory Statistics 2e, OpenStax, 2023.
- 1.4 Experimental Design and Ethics, Introductory Statistics 2e, OpenStax, 2023.
- Measures of Location, NIST/SEMATECH e-Handbook of Statistical Methods, NIST.
- Measures of Scale, NIST/SEMATECH e-Handbook of Statistical Methods, NIST.
- 6.1 The Standard Normal Distribution, Introductory Statistics 2e, OpenStax, 2023.
- 7.1 The Central Limit Theorem for Sample Means (Averages), Introductory Statistics 2e, OpenStax, 2023.
- Central limit theorem: the cornerstone of modern statistics, Korean Journal of Anesthesiology, 2017.
- Confidence Limits for the Mean, NIST/SEMATECH e-Handbook of Statistical Methods, NIST.
- The ASA Statement on p-Values: Context, Process, and Purpose, The American Statistician, 2016.
- Fisher, Neyman-Pearson or NHST? A tutorial for teaching data testing, Frontiers in Psychology, 2015.
- Before p < 0.05 to Beyond p < 0.05: Using History to Contextualize p-Values and Significance Testing, The American Statistician, 2019.
- 12.3 The Regression Equation, Introductory Statistics 2e, OpenStax, 2023.
- Galton, Pearson, and the Peas: A Brief History of Linear Regression for Statistics Instructors, Journal of Statistics Education, 2001.
- Philosophy of Statistics, Stanford Encyclopedia of Philosophy, 2014.
- History of Statistics 1: The Bills of Mortality, and the Beginning of Statistics, American Statistical Association.
- Some Linguistic Aspects of the Term "Statistics", Encyclopedia (MDPI), 2024.
- Legendre On Least Squares, University of York (translated by H. A. Ruger and H. M. Walker).
- On the problem of the most efficient tests of statistical hypotheses, Philosophical Transactions of the Royal Society A, 1933.
- Fisher, Neyman, and the Creation of Classical Statistics, Springer, 2011.
- Bootstrapping: applications to psychophysiology, Psychophysiology, 1989.
- Statistics lessons from a salmon, Tidsskrift for Den norske legeforening, 2023.
