Probability and Inferential Statistics Course with Python

Probability and Inferential Statistics is an intermediate-level course of 5 lessons (about 2 h 34 min), with 15 exercises and 15 quiz questions. Prerequisites: Descriptive Statistics. Exercises run in the browser, with nothing to install.

  • Statistics
  • Intermediate
  • 5 lessons
  • 2 h 34 min
  • 15 exercises
  • Exercises run in the browser

The course in brief

This course gives you the tools to draw reliable conclusions from a sample. You will work with conditional probability and Bayes' theorem, binomial and normal distributions, then understand the central limit theorem through simulation. You will build confidence intervals and run hypothesis tests with numpy and scipy, learning to interpret them without misreadings.

What you will be able to do

  • Compute conditional probabilities and apply Bayes' theorem
  • Use the binomial and normal distributions with scipy.stats
  • Explain the central limit theorem and compute a standard error
  • Build and interpret a confidence interval for a mean or a proportion
  • Run a Welch t-test and a chi-square test and interpret the p-value
  • Distinguish statistical significance from practical importance

Syllabus: 5 lessons

    • Compute the probability of an event, a union and an intersection
    • Compute a conditional probability and apply Bayes' theorem

    ProbabilityConditional probabilityBayes' theorem

  1. 02

    Random Variables and Probability Distributions

    20 min
    • Compute the expected value and variance of a discrete random variable
    • Use the binomial and normal distributions with scipy.stats (pmf, cdf, ppf)

    Expected valueBinomial distributionNormal distribution

  2. 03

    Sampling, the Law of Large Numbers and the Central Limit Theorem

    18 min
    • Distinguish population, sample, parameter and statistic
    • Explain the law of large numbers and the central limit theorem through simulation
    • Compute a standard error

    SamplingCentral limit theoremStandard error

  3. 04

    Confidence Intervals

    18 min
    • Build a confidence interval for a mean (Student's t distribution) and for a proportion
    • Correctly interpret a confidence level

    Confidence intervalStudent's t distribution

  4. 05

    Hypothesis Tests and the p-value

    20 min
    • State the null and alternative hypotheses and interpret a p-value
    • Run a Student's t-test (Welch) and a chi-square test with scipy
    • Distinguish type I and type II errors, statistical significance and practical importance

    Hypothesis testp-valuet-testChi-square test

Final project

Statistical Study of a Loyalty Program

A retailer wants to know whether its loyalty program changes purchasing behavior. In Python (with a fixed seed), generate two groups of customers, members and non-members, with an annual purchase amount and a repurchase indicator. Estimate the key metrics with their confidence intervals, test the differences, and write a cautious conclusion that distinguishes significance, effect size and causality.

Deliverables

  • A reproducible Python script (fixed seed) that generates the data and performs all the analyses
  • The 95% confidence intervals of the mean amount (Student's t) and of the repurchase rate (Wilson) for each group
  • A Welch test on the amounts and a chi-square test on repurchase, with hypotheses stated before computing
  • A simulation showing the distribution of the mean amount (CLT)
  • A one-page summary note explaining the results to a non-statistician audience

Assessment criteria

  • The hypotheses H0 and H1 and the alpha threshold are set before the analysis
  • The chosen tests and intervals suit the type of data
  • The p-value is interpreted without misreadings
  • The effect size is reported in business units with its uncertainty
  • The conclusion mentions selection bias (members are not randomly drawn) and does not conclude causality

Frequently asked questions

What is the difference between descriptive and inferential statistics?

Descriptive statistics summarize the observed data; inferential statistics use a sample to draw conclusions about a larger population, quantifying the uncertainty.

What is a p-value, in one sentence?

It is the probability of observing a result at least as extreme as the one obtained if the null hypothesis were true. It is not the probability that the null hypothesis is true.

Which Python tools are used?

numpy for simulation and calculations, pandas for tables, and scipy.stats for probability distributions, confidence intervals and tests.

Does this course prepare you for A/B tests?

Yes: it provides the foundations (standard error, confidence intervals, tests, type I and type II errors) that are explored further in the A/B Testing and Experimentation course.

This course, told for your job

Say what you want to be able to do: “Probability and Inferential Statistics” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.