Statistical Rethinking: A Bayesian Course with Examples in R

Get to know the book Statistical Rethinking, one of the best introductions to Bayesian Statistics!

statistical rethinking a bayesian course with examples in R free pdf

The following is a review of the book Statistical Rethinking: A Bayesian Course with Examples in R and STAN (Chapman & Hall/CRC Texts in Statistical Science) by Richard McElreath.


The book Statistical Rethinking presents a great introduction to statistics in a way that is basic enough to be understandable for people with no previous background on the topic, but not so basic that those who already have a working knowledge of statistics will find boring.

This second edition beautifully outlines the key features of an statistical analysis cycle, from a bottom up approach, beginning with the most important, and many times ignored phase: how to formulate the research/business question in statistical terms.

In Statistical Rethinking, McElreath builds up your knowledge on how to make inferences from data, in a gradual, step by step manner. This will get you confortable with the main theoretical concepts of statistical reasoning while also teaching you to code them using examples in the R programming language.

Compared to other intro to statistics books like Bayesian Statistics: The Fun Way, it is more practical because of this constant programming flow that accompanies the theory. Also it does incorporate some humour into the bundle like Bayesian Statistics: The Fun Way, making it a refreshing and delightful read.

The material covered in the text goes from simple generalized linear models from a Bayesian perspective, to more complex multilevel models, maximum entropy, how to measure errors and handle missing data, and Gaussian process models for spatial and network autocorrelation.

This second edition emphasizes the directed acyclic graph (DAG) approach to causal inference, integrating DAGs into many examples that were not included in the previous text. The new edition also contains new material on the design of prior distributions, splines, ordered categorical predictors, social relations models, cross-validation, importance sampling, instrumental variables, and Hamiltonian Monte Carlo.

Overall, Statistical Rethinking is one of the best statistics books to start with if what you are looking for is going deeper than just the theory, and actually learning the scripting and programming that is actually needed to implement these model-based statistics.

Contents and features

Some of the key characteristics of Statistical Rethinking are:

  • It integrates working code into the main text, giving both theoretical and practical insights to the covered topics.
  • It illustrates concepts through worked data analysis examples that allow the reader to see real use cases of the learned problems.
  • It focuses first on building an understanding of the concepts and assumptions, and then goes on to explain how they are reflected in code.
  • Despite being a somehow introductory text that avoids deep mathematical reasoning, it offers more detailed explanations of the mathematics in optional sections.
  • It presents code examples of using the dagitty R package to analyse causal graphs and provides the rethinking R package by the author on the following GitHub Repo. The explicit use of this specific package instead of more common R packages in our opinion could have been avoided to provide a more general framework.

There is also a series of lectures on YouTube that are a perfect accompaniment to the book: we recommend going through both hand to hand to get the highest possible understanding of the concepts.

This text presents an introduction to statistics, similar to other books like Introduction to Statistical Learning. If what you are looking for is a more advanced text, or one that is more oriented towards Machine Learning, we recommend going for a book like The Elements of Statistical Learning (The Bible of Machine Learning).

Also, if you don’t like R, and want to learn Statistics in a practical manner with another language (Python for example) take a look at Practical Statistics for Data Scientist.


Statistical Rethinking is a great introduction to Bayesian Statistics and one of the best statistics books for this purpose. One of the things that makes it so great is the use of many amazing examples that showcase real use cases of Bayesian Statistics for topics like Machine Learning.

With these applied problems and the work the author does of breaking down the concepts in an easily digestible way, Statistical Thinking has become a must have in collection of textbooks of any renown statistician!

Lastly, if you appreciate when a technical book provides a historical perspective on the topics, covering them from their origin, and also includes hints of sarcasm and humour from time to time, you will love Statistical Rethinking. Find it at the best price on Amazon here:

Statistical Rethinking: A Bayesian Course with Examples in R and STAN (Chapman & Hall/CRC Texts in Statistical Science)
  • Hardcover Book
  • McElreath, Richard (Author)
  • English (Publication Language)
  • 594 Pages - 03/16/2020 (Publication Date) - Chapman and Hall/CRC (Publisher)

Thanks for reading How to Learn Machine Learning, and have a fantastic day!

statistical rethinking pdf