Introduction to Statistics


Introduction to Statistics

Corey
Welcome to the statistics half of our probability-and-statistics course. Probability and statistics are two closely connected tools for modeling the real world, especially when a system is too complex or uncertain for a simple deterministic description. Probability builds a model of uncertainty; statistics uses data to learn about that model.

Anna
So probability starts with a model and asks what data we might expect, while statistics starts with data and asks what model could have produced it.

Corey
Exactly. In a probability problem, we might know a distribution and its parameters, then ask how likely particular observations are. In a statistics problem, we observe samples and try to infer the underlying distribution, its parameters, or something else about the system. The two subjects are dual, which is why a solid grounding in probability is so useful for statistics.

Anna
And the payoff is practical: estimating, predicting, and making decisions from data. That connection is especially important in data science and machine learning, where we often have lots of measurements but no neat, fully specified probability model.

Corey
That’s the modern motivation for the course. Classical distributions—like the normal or exponential—are still useful for many real problems. But sometimes a system’s probability distribution has no convenient analytic formula, so we need to learn patterns from data and use computational methods. The course begins with foundational statistics and then builds toward those harder settings.

Anna
The plan is roughly five hours of core, introductory-to-intermediate material, followed by more advanced topics for people who want to go deeper. The goal is to make the core useful on its own, while leaving room to explore specialized subjects later.

Corey
The first step is survey sampling. We draw a relatively small sample from a much larger population, then ask what we can responsibly conclude about that population. For instance, we might survey a group of people to estimate a broader population’s preferences, or measure a sample of people to learn about population heights.

Anna
One basic tool is the sample mean, often written as x-bar. We take the measured values in our sample and average them. That number is an estimate of the population mean, but it will vary from sample to sample—so we also need to understand its uncertainty.

Corey
That’s where the central limit theorem helps. Under suitable conditions, when the sample is large enough, the sample mean is approximately normally distributed—even if the original population itself isn’t normal. If the population has mean mu and variance sigma squared, then the sample mean has mean mu and variance sigma squared divided by n, where n is the sample size.

Anna
So increasing n reduces the variance of the sample mean and usually makes the estimate more precise. That gives us a way to think about how much sampling uncertainty remains, and it helps us plan how large a sample or experiment we need for a desired level of accuracy.

Corey
Right. The central limit theorem is powerful because it applies broadly, not just to data that already look normal. The exact conditions matter, but it gives us a general bridge from real samples to probability-based reasoning about estimates.

Anna
The next big idea is hypothesis testing: use data to assess a claim. A medical example is whether a drug has an effect. We could compare a treatment group with a control group and ask whether their outcomes differ in a way that provides evidence for an effect.

Corey
There are plenty of other examples. A company might ask whether a marketing campaign increased web traffic, or whether a change to a website led people to click an ad more often. That kind of comparison is often called A/B testing: compare outcomes under two versions or conditions.

Anna
And not every test is about comparing two averages. We might ask whether two distributions appear to be the same. The chi-square test is one tool for testing certain hypotheses about data and distributions.

Corey
A test gives us a way to quantify how compatible the observed data are with a hypothesis, using a probability model. This is connected to statistical significance, but it’s important not to misread a p-value. A p-value is not the probability that the hypothesis is true, nor is a p-value of 0.05 a 95 percent chance that our conclusion is correct.

Anna
Instead, a p-value describes how surprising data at least as extreme as what we observed would be under a specified null hypothesis and its assumptions. It can be useful evidence, but it doesn’t replace good reasoning about the study, the data, or the assumptions.

Corey
That brings us to experimental design. If we want to test whether a new drug works, or whether a new material is safer, lighter, or stronger, we need to plan how to collect the data and what comparison will test our claim. A well-designed experiment makes the result more honest, accurate, and interpretable.

Anna
Poor design can produce misleading results, even if someone reports a statistically significant p-value. The course will look at pitfalls such as p-hacking—making choices or repeating analyses in ways that manufacture a significant-looking result. That can happen through deliberate misconduct or through misunderstanding, so learning to recognize it matters.

Corey
The practical side includes coding examples in Python, so we can see how tests and analyses work on data—and how bad practices can lead us astray. Statistical significance is only as trustworthy as the design and analysis behind it.

Anna
Another major topic is fitting distributions and estimating their parameters. Imagine we have data x and a probability model that depends on unknown parameters theta. In a normal distribution, for example, those parameters could include the mean and standard deviation. Statistics asks us to use the observed data to find plausible or best-fitting values of theta.

Corey
One approach is the method of moments, which estimates population properties by matching them to quantities calculated from the sample, such as sample moments. Another major approach is maximum likelihood estimation. It chooses parameter values that make the observed data as likely as possible under the model.

Anna
Maximum likelihood is especially useful because it turns parameter estimation into an optimization problem. That connects statistical modeling to the optimization tools widely used in data science and machine learning.

Corey
After fitting a model, we still have to ask whether it fits well. Goodness-of-fit methods help assess that, and hypothesis tests can compare a model or a claim against the data. We can also report uncertainty rather than just one best estimate, using confidence intervals for parameters.

Anna
So instead of saying, ‘The parameter is exactly this value,’ we can give a range that reflects uncertainty in the estimate. Those intervals and hypothesis tests are related ways of communicating what the data do—and don’t—tell us.

Corey
When the uncertainty is difficult to calculate analytically, simulation can help. Bootstrapping repeatedly resamples from the observed data to estimate how an estimator varies. Monte Carlo simulation uses repeated random draws to approximate quantities that may be difficult to compute directly.

Anna
For example, we might want to know how variable a parameter estimate is, but lack a manageable pencil-and-paper calculation. Simulating many possible outcomes can give us an empirical picture of that uncertainty. These computational ideas are important in modern statistics, including Bayesian methods and machine learning.

Corey
Bayesian statistics gives us another way to reason about unknown parameters. We start with prior information or beliefs, combine them with observed data, and update what we believe about the parameters. That’s useful when we have meaningful knowledge before collecting the current data.

Anna
The coin example makes the distinction vivid. Probability might assume a coin’s chance of heads is known, then predict the number of heads in ten or a hundred flips. Statistics instead observes the flips and asks what the coin’s chance of heads might be.

Corey
Suppose we see ten heads in ten flips. We might ask whether the coin is fair and estimate its probability of heads. But if we see only three heads in a row, an estimate based only on those observations could be too extreme if it treats the coin as certainly biased toward heads.

Anna
A Bayesian analysis can incorporate a prior belief—for example, that an ordinary coin is probably fair—and then update that belief as evidence accumulates. Three heads in a row might not overturn that prior, while a much longer run of heads could provide stronger reason to reconsider it.

Corey
But priors need care: useful prior knowledge can make an analysis more robust, while poor prior assumptions can lead to poor conclusions. Bayesian ideas will appear throughout the statistics material, with deeper treatment in later work.

Anna
And this course overview also points toward advanced topics beyond the core: Benford’s law, Markov chains, random walks, Gaussian processes, stochastic differential equations, Monte Carlo optimization, and Bayesian methods. Those topics connect probability, statistics, computation, and models of complex systems.

Corey
The destination is modern statistics and machine learning: learning empirical probability patterns from data, including cases where a tidy classical distribution isn’t available. The route starts with samples and averages, moves through tests and experimental design, then develops parameter fitting, uncertainty, simulation, and Bayesian reasoning.

Anna
So the big picture is that probability tells us how a model predicts data, and statistics lets data inform the model. With careful sampling, sound experiments, and honest treatment of uncertainty, we can use that connection to make better estimates and decisions about a complicated world.

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