Start free trial
Trending New Genres Authors
EnglishEnglish
EspañolSpanish
简体中文Chinese
繁體中文Chinese (Traditional)
FrançaisFrench
DeutschGerman
日本語Japanese
PortuguêsPortuguese
ItalianoItalian
한국어Korean
РусскийRussian
NederlandsDutch
العربيةArabic
PolskiPolish
हिन्दीHindi
Tiếng ViệtVietnamese
SvenskaSwedish
ΕλληνικάGreek
TürkçeTurkish
ไทยThai
ČeštinaCzech
RomânăRomanian
MagyarHungarian
УкраїнськаUkrainian
IndonesiaIndonesian
DanskDanish
SuomiFinnish
БългарскиBulgarian
עבריתHebrew
NorskNorwegian
HrvatskiCroatian
CatalàCatalan
SlovenčinaSlovak
LietuviųLithuanian
SlovenščinaSlovenian
СрпскиSerbian
EestiEstonian
LatviešuLatvian
فارسیPersian
മലയാളംMalayalam
தமிழ்Tamil
اردوUrdu
Searching...
SoBrief
Think Stats

Think Stats

Learn statistics by coding real investigations, from messy samples to models that may mislead.
by Allen B. Downey 2011 138 pages
3.64
469 ratings
Listen
Immersive
V2.3
Amazon Kindle Audible
Try Full Access for 3 Days
Unlock listening & more!
Continue

Key Takeaways

Turn data into evidence by coding the whole inquiry, not just its final test

Start with a question. The book follows a deceptively ordinary one: do first babies tend to arrive late? Personal stories offer clues, but small samples, selective recollection, and confirmation bias make them unreliable evidence. Downey investigates the question using pregnancy records from the National Survey of Family Growth, a large survey designed to support population-level conclusions.

Make every step inspectable. The analysis moves from importing and cleaning data to checking summaries against the survey codebook, exploring patterns, estimating uncertainty, and testing hypotheses. Cleaning catches errors such as an implausible 51-pound birth weight. Interpretation also means remembering that each record represents a person, not merely a row of numbers.

Analysis

The book's strongest teaching move is to make statistical reasoning an executable process. Code forces assumptions into the open: a cleaning rule, a group definition, or a test statistic can be inspected and revised rather than hidden inside prose. This resembles an audit trail in laboratory science, where a result matters partly because another person can reconstruct how it was produced. But reproducibility is not validity. A perfectly repeatable analysis can still answer the wrong question or inherit a biased sample, so transparency must accompany, not replace, judgment.

Compare distributions and effect sizes before deciding what an average means

See more than the center. A distribution shows which values occur and how often. Histograms reveal common values and unusual tails, while summary statistics condense the picture. But the mean can describe a sample poorly when values cluster into unlike groups or include extreme observations. Spread, shape, and outliers matter too.

Measure practical difference. In the NSFG data, first babies averaged 38.601 weeks of pregnancy, compared with 38.523 weeks for other babies. The difference is about 13 hours. Cohen's d, which expresses a difference in means relative to the groups' variability, is only 0.029 standard deviations. The groups differ slightly, but the effect is tiny beside the ordinary variation in pregnancy length.

Analysis

This distinction separates statistical description from the decision a reader actually needs to make. A tiny average shift may matter in a large population study but be useless for predicting one person's outcome. Reporting a standardized effect alongside units helps, although no single effect-size measure determines importance. Clinical decisions, costs, and individual risk may depend on parts of a distribution, especially its tails, rather than on the mean. Good summaries therefore explain both what changed and whether that change could alter a real choice.

Ask who gets observed, because sampling can make large groups look common

Observation creates bias. In the class size paradox, a college offers 65 classes with an average size of 23.7 students. A student survey produces an average of 29.1. That is not necessarily faulty arithmetic: students are more likely to be in a large class, so large classes are overrepresented in their experience. The observation process changes the distribution being measured.

Account for selection. The NSFG deliberately recruited more Hispanic, African American, and teenage respondents than their population shares, allowing better analysis of those groups. But unadjusted totals then misrepresent the population as a whole. Survey weights account for how many people each respondent represents. Before generalizing a result, identify who could enter the sample and who had a greater chance of being counted.

Analysis

The class size example illustrates a broad statistical problem: the most visible cases are not always the most common cases. A person samples the world through exposure, not through a neutral census, which can distort judgments about class sizes, family patterns, or risk. Weighting can correct known differences in selection, but it cannot automatically repair nonresponse, inaccurate reports, or unmeasured selection factors. The key question is not simply how many observations exist, but what mechanism made those observations available.

Use cumulative distributions to compare whole patterns, not isolated values

Accumulate the evidence. A probability mass function assigns a probability to each distinct value. It works well for a small set of outcomes, but a plot with many possible values can look noisy and difficult to compare. A cumulative distribution function, or CDF, gives the fraction of observations at or below any chosen value. Its curve makes the overall shape and relative positions easier to see.

Read percentiles directly. For pregnancy length, the CDF shows that roughly 10% of pregnancies are shorter than 36 weeks and about 90% are shorter than 41 weeks. The 50th percentile is the median; the gap between the 25th and 75th percentiles is the interquartile range. These summaries are less dominated by extreme values than the mean and standard deviation.

Analysis

A CDF changes the question from what happened at each exact value to how much of the population lies below a threshold. That is often closer to practical questions, such as whether a measurement is unusually high or what share of cases falls within a range. It also makes comparison less dependent on arbitrary histogram bins. The tradeoff is that a cumulative curve can conceal local features, such as a sharp peak. Visualization is not a contest with one winning chart; the right display depends on the question.

Treat a distribution model as a fit for a purpose, not reality

Compress without pretending. An analytic distribution is a mathematical curve used to simplify observed data. A normal model, described by a mean and standard deviation, fits birth weights reasonably well near the center: the reported parameters are 7.28 pounds and 1.24 pounds. Yet the lightest and heaviest babies depart from the model, and the lower tail contains more light babies than the normal curve predicts.

Choose for the task. Adult weights in the book are better described by a lognormal model, where the logarithms of values are approximately normal. City populations can fit a Pareto pattern in the largest 1% while a lognormal model fits much of the rest. A model may be useful for one region of the data and misleading for another.

Analysis

A model is a compact map, not a miniature copy of the world. Its usefulness depends on which features survive the simplification. A normal approximation may be adequate for describing typical birth weights yet poor for estimating the frequency of very small babies. This is why residual patterns and tail behavior deserve attention, especially when consequences are asymmetric. A single goodness-of-fit verdict can hide that distinction. The more consequential the tail, the less comfort a good fit near the center should provide.

Plot relationships before trusting correlation or inferring cause

Check the shape first. Correlation summarizes how two variables move together, but Pearson's correlation measures linear association. In the BRFSS data, height and weight have a correlation of 0.51. Yet a relationship can be curved or otherwise systematic while its Pearson correlation is near zero. Scatter plots reveal such patterns, as well as rounding, outliers, and crowded points that a coefficient cannot show.

Separate association from explanation. A correlation does not establish whether one variable causes another, whether the direction runs the other way, or whether a third factor influences both. Randomized trials help isolate causal effects by assigning treatments at random. When experiments are impossible, timing and careful comparison can strengthen an argument, but unobserved differences between groups remain a risk.

Analysis

The scatter plot is more than a preliminary illustration. It tests whether a compact statistic is describing the relationship readers can actually see. Rank correlation can help when data are skewed or outliers distort linear association, but it does not solve the causal problem. Causal claims require a design or assumptions that explain why competing causes are unlikely. This is a useful division of labor: visualization diagnoses form, correlation summarizes association, and experimental or quasi-experimental reasoning addresses cause.

Test whether an effect could be chance, then judge whether it matters

Simulate the no-effect world. A hypothesis test begins with a null hypothesis, a model in which the apparent effect is absent. A test statistic measures the observed effect, and a p-value estimates how often a result at least that extreme would arise under the null. When 250 coin tosses yield 140 heads, the two-sided p-value is about 7%, so the evidence does not strongly establish a biased coin.

Keep significance in perspective. For pregnancy length, the observed first-baby difference has a p-value near 17%, while a 0.12-pound birth-weight difference has a p-value below 0.001. The second result is unlikely under the null, but it is still small. Repeated testing and reuse of exploratory data also raise false-positive risk, making independent replication important.

Analysis

Simulation gives the p-value a concrete interpretation: repeatedly generate data under a stated no-effect model and count how often the test statistic reaches the observed range. That clarity does not make the p-value the probability that a hypothesis is true. Nor does a threshold turn a continuous evidential scale into a natural boundary. The examples also show why effect size and uncertainty belong beside significance. A very small effect can be estimated precisely in a large dataset, while a meaningful effect can go undetected in an underpowered one.

Quantify sampling uncertainty without mistaking it for total uncertainty

Repeat the imagined study. A sampling distribution shows how an estimate would vary if the same study were repeated many times. In the book's gorilla example, nine adult females have an average weight of 90 kilograms and a sample standard deviation of 7.5 kilograms. The estimated standard error of the mean is about 2.5 kilograms, and a 90% confidence interval is roughly 86 to 94 kilograms.

Name what remains. Standard error measures sampling variation, not the spread of individual weights. A confidence interval describes the long-run behavior of the estimation procedure; it does not mean there is a 90% probability that a fixed population mean lies in this particular interval. Neither quantity captures sampling bias or measurement error. Simulation and analytic results can be compared to check calculations and assumptions.

Analysis

Uncertainty is not one undifferentiated cloud. Sampling variation can often be quantified, while measurement error, nonresponse, and a flawed sampling frame require different evidence. The Central Limit Theorem helps explain why averages often have approximately normal sampling distributions when observations are independent and have finite variance, but those conditions matter. The practical virtue of resampling is that its assumptions can be inspected and adapted. Its limitation is equally important: repeatedly resampling a biased dataset can estimate its variability with great precision while leaving its bias intact.

Use regression to control plausible confounders, then check predictive gains

Compare like with like. First babies in the NSFG sample weigh about 0.125 pounds less on average, and their mothers are about 3.59 years younger. Since maternal age is associated with birth weight, a regression model can include age alongside first-baby status. The estimated first-baby difference then shrinks by about half; adding a curved age term makes it statistically insignificant. Age helps explain part of the original association.

Measure prediction honestly. A statistically significant coefficient need not make a useful forecast. The age-only model accounts for less than 1% of birth-weight variation, and adding several variables in a data-mining exercise improves prediction only modestly. Regression can clarify adjusted relationships, but a model should be evaluated on whether it predicts well, not merely on whether its coefficients look impressive.

Analysis

Regression is valuable because it forces a comparison to specify which variables are being held constant. That makes confounding visible and offers a more disciplined description than comparing two raw averages. Still, adjustment is not automatic causal proof: an omitted factor, a poor functional form, or a variable measured after the outcome can distort interpretation. Prediction has a separate standard. A model that fits the data used to build it may not generalize, so evaluation on new observations is essential before treating a small accuracy gain as real.

Respect the clock. In crowdsourced cannabis transaction reports, daily prices vary sharply and some dates are missing. A straight-line fit suggests high-quality prices fell about 71 cents per gram per year, while medium- and low-quality prices rose. But the trend may change, and successive observations can be correlated. A moving average smooths short-term variation; an exponentially weighted moving average gives recent observations more influence.

Test what repeats. Serial correlation measures association between a series and a shifted version of itself. After removing the estimated trend, the book finds little evidence of daily, weekly, monthly, or yearly patterns in these data. Missing dates can be represented explicitly and estimated, but filling gaps introduces uncertainty. Prediction intervals based on the observed past cannot capture every policy change or other structural shift.

Analysis

Time series analysis exposes a common forecasting mistake: treating a pattern that held over one interval as a stable law. Smoothing helps reveal a trend, but the smooth line is a chosen summary, not a mechanism. Giving recent observations greater weight can make a forecast more responsive, yet it can also chase temporary noise. The critical diagnostic is whether the process remains stable enough for past behavior to inform the future. Policy-driven markets are a particularly clear reminder that a forecast can fail because the system changes, not because the arithmetic was wrong.

Keep censored cases in survival estimates, and separate cohort patterns from forecasts

Use incomplete histories. Survival analysis estimates how long it takes for an event to occur. In the marriage example, respondents who have not married by interview time have incomplete outcomes, but their known unmarried years still matter. Kaplan-Meier estimation uses them as people still at risk, rather than discarding them and making marriage appear inevitable. The resulting curve estimates the chance of remaining unmarried beyond a given age.

Treat projections cautiously. Marriage patterns differ across birth cohorts, with younger groups marrying later at early ages in the survey data. Extending a younger cohort's curve by borrowing an older cohort's later-life pattern creates a forecast, not an observation. A widely repeated Newsweek claim about unmarried 40-year-old women rested on faulty analysis, illustrating how fragile statistics can become when uncertainty and context disappear.

Analysis

Censoring is a useful reminder that an unfinished observation is not the same as a missing one. A respondent still unmarried at 30 supplies real information about the time before 30, even though the eventual outcome is unknown. Kaplan-Meier methods preserve that information under assumptions about how censoring occurs. Cohort comparisons add another challenge: age differences can reflect generation, historical period, or both. Extrapolation may be necessary, but its assumptions should be visible, particularly when a dramatic statistic could shape public beliefs.

Analysis

Think Stats is a computational introduction to statistics organized as a working investigation rather than a catalog of formulas. Its through-line is the question of whether first babies arrive late, but its deeper subject is how programmers can build defensible knowledge from imperfect data. The recurring sequence is practical: inspect provenance, clean and validate records, explore distributions, compare groups, quantify uncertainty, and test explanations. Later chapters extend the same logic to regression, time series, and survival analysis.

The most durable contribution is its insistence that statistical tools are choices with consequences. A mean can conceal a distribution's shape; a survey can overrepresent the people easiest to observe; a significant coefficient can have negligible predictive value; and a smooth model can fail in the tails. The class-size paradox makes selection bias intuitive, while the pregnancy case shows how a small average difference can be real yet practically unimportant. These examples teach readers to ask not only whether a result exists, but what it means for a particular decision.

The computational emphasis is also a methodological argument. Simulation and resampling make assumptions tangible, are adaptable to unfamiliar statistics, and can be cross-checked against analytic results. This is especially useful for learners who understand code more readily than symbolic derivations. Yet computation does not dissolve design problems. Resampling cannot rescue nonrepresentative observations, and a test cannot repair a poorly chosen question.

Some explanations are intentionally simplified for instruction. In particular, a p-value is not the probability that an observed effect arose by chance in an unrestricted sense, nor the probability that the null hypothesis is true. It is a probability calculated under a specified null model. Likewise, weighting alone may not reflect every feature of a complex survey design. The book's best lesson is therefore not to trust any single procedure, but to make the data-generating process, assumptions, effect size, and uncertainty part of the result itself.

Summary in 30 Seconds
Statistical conclusions depend on how data are collected, cleaned, and represented. Averages can hide important distribution patterns, while biased samples can distort population estimates. First babies in the example arrive only about 13 hours later on average, a tiny difference of 0.029 standard deviations. A low p-value does not guarantee practical importance, and sampling error excludes other sources of uncertainty. Regression can adjust for confounders yet add little predictive power.
Contains spoilers

Last updated:

Report Issue

Review Summary

3.64 out of 5
Average of 469 ratings from Goodreads and Amazon.

Think Stats receives mixed reviews with an overall 3.64/5 rating. Readers appreciate its computational approach to statistics using Python and practical examples. However, many criticize the author's custom libraries rather than standard ones like pandas and NumPy, making real-world application difficult. Common complaints include unclear prerequisites, terms used before definition, excessive Wikipedia references, and poor organization. Some find it valuable for programmers learning statistics, while others feel it lacks depth and doesn't adequately teach either statistics or Python independently. The book works better as supplementary material than a primary resource.

Your rating:
4.2
69 ratings
Want to read the full book?

Glossary

Exploratory data analysis

Investigating data systematically

A practical process for understanding a dataset before settling on conclusions. It includes importing and cleaning records, checking values against documentation, examining variables and distributions, looking for relationships, and using visualizations to identify possible patterns. Exploration also tests whether the data and the analyst's interpretation are plausible.

Probability mass function (PMF)

Probabilities for distinct values

A representation of a discrete distribution that maps each possible value to its probability. The probabilities sum to one. A PMF can show how likely each observed value is, but when there are many distinct values, its plot may be noisy and difficult to compare with another distribution.

Cumulative distribution function (CDF)

Probability at or below a value

A function that maps a value to the fraction of observations less than or equal to it. A CDF represents the full distribution as a cumulative curve, supports percentile calculations, and makes it possible to compare groups across a range rather than at a single summary statistic.

Class size paradox

Large classes are overobserved

The difference between the average class size across a college's courses and the average class size reported by students. Students are more likely to encounter large classes because those classes contain more students. In the book's example, the course average is 23.7 students, while the student-observed average is 29.1.

Kernel density estimation (KDE)

A smoothed distribution estimate

A method for estimating a continuous probability density from observed sample values. KDE places a smooth contribution around each observation and combines them into an estimated curve. It can help visualize data, interpolate between sampled values, or generate smoother simulation inputs, but its result depends on the degree of smoothing.

Cohen's d

Standardized difference between means

An effect-size statistic that expresses the difference between two group means in units of a pooled standard deviation. It helps place a mean difference in context when the original measurement scale is hard to interpret. In the first-baby pregnancy-length comparison, the estimated value is 0.029, a very small standardized difference.

Sampling distribution

Variation across repeated estimates

The distribution of a statistic, such as a sample mean, across hypothetical repetitions of the same sampling process. It describes how much an estimate would vary because different samples include different observations. Its spread can be summarized by a standard error, and its quantiles can form a confidence interval.

Permutation test

Test by rearranging observed labels

A simulation-based hypothesis test that shuffles observed values or group labels to represent a null hypothesis of no group difference or association. The test statistic is recalculated for each shuffled dataset. The proportion of simulated statistics at least as extreme as the observed statistic estimates the p-value.

Central Limit Theorem

Sums tend toward normality

A result stating that sums, and therefore averages, of sufficiently many independent observations from the same distribution tend toward a normal distribution when the underlying values have finite mean and variance. The speed of convergence depends on the distribution, and strong dependence or extreme heavy tails can undermine the approximation.

Exponentially-weighted moving average (EWMA)

Recent values receive greater weight

A time-series smoothing method that averages current and earlier observations while assigning the greatest weight to the most recent value and progressively less weight to older values. A span parameter controls how quickly weights decline. Compared with a fixed rolling mean, the method can handle missing observations more conveniently.

Kaplan-Meier estimation

Survival estimates with incomplete outcomes

A method for estimating a survival curve when some subjects have not yet experienced the event being studied. It estimates the event hazard at observed event times using the number of events and the number still at risk, then combines those estimates to calculate the probability of remaining event-free.

Hazard function

Event risk at a given time

A function describing the fraction of subjects still at risk at a particular time who experience the event then. In pregnancy data, it represents the proportion of pregnancies continuing to a given week that end during that week. It helps construct a survival curve from event-time data.

About the Author

Allen Downey is Professor Emeritus at Olin College and accomplished author of multiple free textbooks on software and data science. His notable works include Think Python, Think Bayes, and Think Complexity, all published by O'Reilly Media. He maintains an active blog called Probably Overthinking It, where he writes articles exploring Bayesian probability and statistics. His academic credentials include a Ph.D. in computer science from U.C. Berkeley, along with both Master of Science and Bachelor of Science degrees from MIT, demonstrating strong technical foundations in computing and analytical fields.

Other books by Allen B. Downey

Download PDF

To save this Think Stats summary for later, download the free PDF. You can print it out, or read offline at your convenience.
Download PDF
File size: 0.33 MB     Pages: 18

Download EPUB

To read this Think Stats summary on your e-reader device or app, download the free EPUB. The .epub digital book format is ideal for reading ebooks on phones, tablets, and e-readers.
Download EPUB
File size: 1.38 MB     Pages: 22
Want to read the full book?
Follow
Listen1 mins
Home
Swipe
Library
Get App
Try Full Access for 3 Days
Listen, bookmark, and more
Compare Features Free Pro
📖 Read Summaries
Read unlimited summaries. Free users get 3 per month
🎧 Listen to Summaries
Listen to unlimited summaries in 40 languages
—
❤️ Unlimited Bookmarks
Free users are limited to 4
—
📜 Unlimited History
Free users are limited to 4
—
📥 Unlimited Downloads
Free users are limited to 1
—
Risk-Free Timeline
Today: Get Instant Access
Listen to full summaries of 26,000+ books. That's 12,000+ hours of audio!
Day 2: Trial Reminder
We'll send you a notification that your trial is ending soon.
Day 3: Your subscription begins
You'll be charged on Nov 24,
cancel anytime before.
Consume 2.8× More Books
2.8× more books Listening Reading
Our users love us
1M+ readers
Trustpilot Rating
TrustPilot
4.6 Excellent
This site is a total game-changer. I've been flying through book summaries like never before. Highly, highly recommend.
— Dave G
Worth my money and time, and really well made. I've never seen this quality of summaries on other websites. Very helpful!
— Em
Highly recommended!! Fantastic service. Perfect for those that want a little more than a teaser but not all the intricate details of a full audio book.
— Greg M
Save 62%
Yearly
$119.88 $44.99/year/yr
$3.75/mo
Monthly
$9.99/mo
Start a 3-Day Free Trial
3 days free, then $44.99/year. Cancel anytime.
Unlock a world of fiction & nonfiction books
26,000+ books for the price of 2 books
Read any book in 10 minutes
Discover new books like Tinder
Request any book if it's not summarized
Read more books than anyone you know
#1 app for book lovers
Lifelike & immersive summaries
30-day money-back guarantee
Download summaries in EPUBs or PDFs
Cancel anytime in a few clicks

Why one summary?

Scanner
Find a barcode to scan

⭐
⭐
⭐
We have a special gift for you
Open
38% off
DISCOUNT FOR YOU
⭐
⭐
⭐
$79.99
$49.99/year
Only $4.16 per month
Continue
2 taps to start, super easy to cancel
Settings
General
Widget
Loading...