Sample size
Sample size is the number of observations, units, or items included in a sample or group being analyzed.
Grokking Statistics
Sample size is the number of observations included in a sample.
- How it is used
- Uses sample size to judge how much evidence supports estimates of population means and confidence intervals.
- How deep it goes
- Explains notation, representativeness, sampling-distribution spread, confidence-interval precision, and small-sample t-distribution choices without deriving formulas.
- Examples
- Uses dorm sleep tracking, adult body temperatures, confidence intervals for sleep hours, and constrained counts of satellites or bridges.
- What you can do after
- Evaluate/understand how sample size affects uncertainty, interval width, and whether normal or t-based methods fit a mean estimate.
Effective Data Analysis
Sample size is the number of observations or participants included in a statistical sample.
- How it is used
- Uses sample size to plan inferential tests, assess detectable effects, and protect anonymity in analytical reporting.
- How deep it goes
- Explains power-based planning, alpha adjustments, test assumptions, large-sample limits, and a five-person privacy threshold.
- Examples
- Uses t-test power calculations, simulated normal samples, Kruskal-Wallis exercises, and an employee survey with an n=1 subgroup.
- What you can do after
- Apply sample-size planning with statsmodels and evaluate how sample size affects test results and privacy-safe reporting.
Evaluating AI Systems
Sample size is the number of observations or examples included in a study or evaluation.
- How it is used
- Guides evaluation dataset sizing by balancing reliable conclusions against data collection costs.
- How deep it goes
- Explains sizing factors and metric convergence without prescribing a universal sample size formula.
- Examples
- Contrasts smoke tests with benchmark comparisons and rare-failure or subgroup evaluations.
- What you can do after
- Evaluate whether an evaluation dataset is large enough for its goals, task variability, and risk tolerance.
AI Model Evaluation
Sample size is the number of observations or participants included in a statistical experiment.
- How it is used
- Sets the number of users exposed to an online controlled experiment.
- How deep it goes
- Defines sample size operationally and connects it to traffic, duration, power, and false-positive risk without giving a calculation method.
- Examples
- Uses recommendation variants emphasizing recency, user affinity, or diversity to illustrate why additional treatments require more exposure.
- What you can do after
- Operate/configure A/B tests by allocating exposure, limiting variants, and planning enough traffic or duration for trustworthy comparisons.
Statistics Every Programmer Needs
Sample size is the number of observations or trials included in a statistical sample or simulation.
- How it is used
- Determines the amount of evidence used to estimate variation, monitor process stability, or simulate outcome frequencies.
- How deep it goes
- Explains effects on precision, control limits, statistical power, and proportion variability, but does not derive sample-size selection rules.
- Examples
- Uses 500 simulated trials, scalable trial counts, control-chart samples, and p-chart proportions as concrete examples.
- What you can do after
- Apply it to choose trial counts, interpret control-chart sensitivity, and assess how sampling affects variability estimates.
Read how Statistics Every Programmer Needs explains sample size →
Also covered in
- 100 SQL Server Mistakes and How to Avoid Them
- Designing AI SystemsIn early access (MEAP)
- First-Party Data Activation
- LLM Evaluation and Alignment, The Foundational IdeasIn early access (MEAP)
- Building Quantum Software with Python
- API Design Patterns
- Outlier Detection in Python
- Grokking BayesIn early access (MEAP)
- Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI
What to know first
- meanThe mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
- normal distributionA normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
- probability distributionA probability distribution is a mathematical specification assigning probabilities or probability densities to the possible values or outcomes of a random variable.
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
Related concepts
- power analysisproduced by · Power analysis is a statistical method for estimating a test’s ability to detect an effect under specified assumptions, often to determine an appropriate sample size.
- evaluation goalconfigured by · An evaluation goal is the purpose or decision that an evaluation is intended to support.
- statistical samplemeasures · A statistical sample is one or more observations selected or generated from a population or probability process for analysis.
- accuracycontrasts with · Accuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
- control chartconfigures · A control chart is a statistical process-monitoring graph that plots process measurements over time against a center line and control limits to assess variation.
Questions about sample size
What is sample size?
Sample size is the number of observations, units, or items included in a sample or group being analyzed.
Which Manning books explain sample size?
Grokking Statistics, Effective Data Analysis, Evaluating AI Systems, AI Model Evaluation and Statistics Every Programmer Needs.
What should I know before learning sample size?
Manning books that teach sample size usually introduce mean, normal distribution, probability distribution and Python first.
What is the difference between sample size and accuracy?
Sample size is the number of observations, units, or items included in a sample or group being analyzed. Accuracy is the degree to which a result agrees with a specified truth, reference, or criterion, commonly measured as the proportion of evaluated predictions that are correct.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




