Statistics
“Statistical Rethinking is a fun and inspiring look at the hows, whats, and whys
of statistical modeling. This is a rare and valuable book that combines readable
explanations, computer code, and active learning.”
—Andrew Gelman, Columbia University
Statistical Rethinking: A Bayesian Course with Examples in R and Stan builds
your knowledge of and confidence in statistical modeling. Reflecting the need
for even minor programming in today’s model-based statistics, the book pushes
you to perform step-by-step calculations that are usually automated. This unique
computational approach ensures that you understand enough of the details to
make reasonable choices and interpretations in your own modeling work.
The text presents generalized linear multilevel models from a Bayesian perspective,
relying on a simple logical interpretation of Bayesian probability and maximum
entropy. It covers from the basics of regression to multilevel models. The author
also discusses measurement error, missing data, and Gaussian process models
for spatial and network autocorrelation.
Features
•
Integrates code fully into the main text, allowing you to implement the code
and compare results
Illustrates many concepts through worked data analysis examples
•
• Presents full explanations of the code, enabling you to diagnose and fix
problems
• Explains important and unusual programming tricks
• Shows how the same mathematical statistical model can sometimes be
implemented in different ways
• Offers more detailed explanations of the mathematics in optional sections
• Provides the R package on the author’s website and GitHub
K23919
w w w . c r c p r e s s . c o m
Texts in Statistical Science
Statistical
Rethinking
A Bayesian Course with
Examples in R and Stan
Richard McElreath
S
t
a
t
i
s
t
i
c
a
l
R
e
t
h
i
n
k
i
n
g
M
c
E
l
r
e
a
t
h
K23919_cover.indd 1
11/6/15 10:27 AM
Statistical
Rethinking
A Bayesian Course with
Examples in R and Stan
CHAPMAN & HALL/CRC
Texts in Statistical Science Series
Series Editors
Francesca Dominici, Harvard School of Public Health, USA
Julian J. Faraway, University of Bath, UK
Martin Tanner, Northwestern University, USA
Jim Zidek, University of British Columbia, Canada
Statistical Theory: A Concise Introduction
F. Abramovich and Y. Ritov
Practical Multivariate Analysis, Fifth Edition
A. Afifi, S. May, and V.A. Clark
Practical Statistics for Medical Research
D.G. Altman
Interpreting Data: A First Course
in Statistics
A.J.B. Anderson
Introduction to Probability with R
K. Baclawski
Linear Algebra and Matrix Analysis for
Statistics
S. Banerjee and A. Roy
Mathematical Statistics: Basic Ideas and
Selected Topics, Volume I, Second Edition
P. J. Bickel and K. A. Doksum
Mathematical Statistics: Basic Ideas and
Selected Topics, Volume II
P. J. Bickel and K. A. Doksum
Analysis of Categorical Data with R
C. R. Bilder and T. M. Loughin
Statistical Methods for SPC and TQM
D. Bissell
Introduction to Probability
J. K. Blitzstein and J. Hwang
Bayesian Methods for Data Analysis,
Third Edition
B.P. Carlin and T.A. Louis
Second Edition
R. Caulcutt
The Analysis of Time Series: An Introduction,
Sixth Edition
C. Chatfield
Introduction to Multivariate Analysis
C. Chatfield and A.J. Collins
Problem Solving: A Statistician’s Guide,
Second Edition
C. Chatfield
Statistics for Technology: A Course in Applied
Statistics, Third Edition
C. Chatfield
Bayesian Ideas and Data Analysis: An
Introduction for Scientists and Statisticians
R. Christensen, W. Johnson, A. Branscum,
and T.E. Hanson
Modelling Binary Data, Second Edition
D. Collett
Modelling Survival Data in Medical Research,
Third Edition
D. Collett
Introduction to Statistical Methods for
Clinical Trials
T.D. Cook and D.L. DeMets
Applied Statistics: Principles and Examples
D.R. Cox and E.J. Snell
Multivariate Survival Analysis and Competing
Risks
M. Crowder
Statistical Analysis of Reliability Data
M.J. Crowder, A.C. Kimber,
T.J. Sweeting, and R.L. Smith
An Introduction to Generalized
Linear Models, Third Edition
A.J. Dobson and A.G. Barnett
Nonlinear Time Series: Theory, Methods, and
Applications with R Examples
R. Douc, E. Moulines, and D.S. Stoffer
Introduction to Optimization Methods and
Their Applications in Statistics
B.S. Everitt
Extending the Linear Model with R:
Generalized Linear, Mixed Effects and
Nonparametric Regression Models
J.J. Faraway
Linear Models with R, Second Edition
J.J. Faraway
A Course in Large Sample Theory
T.S. Ferguson
Multivariate Statistics: A Practical
Approach
B. Flury and H. Riedwyl
Readings in Decision Analysis
S. French
Markov Chain Monte Carlo:
Stochastic Simulation for Bayesian Inference,
Second Edition
D. Gamerman and H.F. Lopes
Bayesian Data Analysis, Third Edition
A. Gelman, J.B. Carlin, H.S. Stern, D.B. Dunson,
A. Vehtari, and D.B. Rubin
Multivariate Analysis of Variance and
Repeated Measures: A Practical Approach for
Behavioural Scientists
D.J. Hand and C.C. Taylor
Practical Longitudinal Data Analysis
D.J. Hand and M. Crowder
Logistic Regression Models
J.M. Hilbe
Richly Parameterized Linear Models:
Additive, Time Series, and Spatial Models
Using Random Effects
J.S. Hodges
Statistics for Epidemiology
N.P. Jewell
Stochastic Processes: An Introduction,
Second Edition
P.W. Jones and P. Smith
The Theory of Linear Models
B. Jørgensen
Principles of Uncertainty
J.B. Kadane
Graphics for Statistics and Data Analysis with R
K.J. Keen
Mathematical Statistics
K. Knight
Introduction to Multivariate Analysis:
Linear and Nonlinear Modeling
S. Konishi
Nonparametric Methods in Statistics with SAS
Applications
O. Korosteleva
Modeling and Analysis of Stochastic Systems,
Second Edition
V.G. Kulkarni
Exercises and Solutions in Biostatistical Theory
L.L. Kupper, B.H. Neelon, and S.M. O’Brien
Exercises and Solutions in Statistical Theory
L.L. Kupper, B.H. Neelon, and S.M. O’Brien
Design and Analysis of Experiments with R
J. Lawson
Design and Analysis of Experiments with SAS
J. Lawson
A Course in Categorical Data Analysis
T. Leonard
Statistics for Accountants
S. Letchford
Introduction to the Theory of Statistical
Inference
H. Liero and S. Zwanzig
Statistical Theory, Fourth Edition
B.W. Lindgren
Stationary Stochastic Processes: Theory and
Applications
G. Lindgren
Statistics for Finance
E. Lindström, H. Madsen, and J. N. Nielsen
The BUGS Book: A Practical Introduction to
Bayesian Analysis
D. Lunn, C. Jackson, N. Best, A. Thomas, and
D. Spiegelhalter
Introduction to General and Generalized
Linear Models
H. Madsen and P. Thyregod
Time Series Analysis
H. Madsen
Pólya Urn Models
H. Mahmoud
Randomization, Bootstrap and Monte Carlo
Methods in Biology, Third Edition
B.F.J. Manly
Introduction to Randomized Controlled
Clinical Trials, Second Edition
J.N.S. Matthews
Statistical Rethinking: A Bayesian Course with
Examples in R and Stan
R. McElreath
Statistical Methods in Agriculture and
Experimental Biology, Second Edition
R. Mead, R.N. Curnow, and A.M. Hasted
Statistics in Engineering: A Practical Approach
A.V. Metcalfe
Statistical Inference: An Integrated Approach,
Second Edition
H. S. Migon, D. Gamerman, and
F. Louzada
Beyond ANOVA: Basics of Applied Statistics
R.G. Miller, Jr.
A Primer on Linear Models
J.F. Monahan
Applied Stochastic Modelling, Second Edition
B.J.T. Morgan
Elements of Simulation
B.J.T. Morgan
Probability: Methods and Measurement
A. O’Hagan
Introduction to Statistical Limit Theory
A.M. Polansky
Applied Bayesian Forecasting and Time Series
Analysis
A. Pole, M. West, and J. Harrison
Statistics in Research and Development,
Time Series: Modeling, Computation, and
Inference
R. Prado and M. West
Introduction to Statistical Process Control
P. Qiu
Sampling Methodologies with Applications
P.S.R.S. Rao
A First Course in Linear Model Theory
N. Ravishanker and D.K. Dey
Essential Statistics, Fourth Edition
D.A.G. Rees
Stochastic Modeling and Mathematical
Statistics: A Text for Statisticians and
Quantitative Scientists
F.J. Samaniego
Statistical Methods for Spatial Data Analysis
O. Schabenberger and C.A. Gotway
Bayesian Networks: With Examples in R
M. Scutari and J.-B. Denis
Large Sample Methods in Statistics
P.K. Sen and J. da Motta Singer
Spatio-Temporal Methods in Environmental
Epidemiology
G. Shaddick and J.V. Zidek
Decision Analysis: A Bayesian Approach
J.Q. Smith
Analysis of Failure and Survival Data
P. J. Smith
Applied Statistics: Handbook of GENSTAT
Analyses
E.J. Snell and H. Simpson
Applied Nonparametric Statistical Methods,
Fourth Edition
P. Sprent and N.C. Smeeton
Data Driven Statistical Methods
P. Sprent
Generalized Linear Mixed Models:
Modern Concepts, Methods and Applications
W. W. Stroup
Survival Analysis Using S: Analysis of
Time-to-Event Data
M. Tableman and J.S. Kim
Applied Categorical and Count Data Analysis
W. Tang, H. He, and X.M. Tu
Elementary Applications of Probability Theory,
Second Edition
H.C. Tuckwell
Introduction to Statistical Inference and Its
Applications with R
M.W. Trosset
Understanding Advanced Statistical Methods
P.H. Westfall and K.S.S. Henning
Statistical Process Control: Theory and
Practice, Third Edition
G.B. Wetherill and D.W. Brown
Generalized Additive Models:
An Introduction with R
S. Wood
Epidemiology: Study Design and
Data Analysis, Third Edition
M. Woodward
Practical Data Analysis for Designed
Experiments
B.S. Yandell
Texts in Statistical Science
Statistical
Rethinking
A Bayesian Course with
Examples in R and Stan
Richard McElreath
Max Planck Institute for Evolutionary Anthropology
Leipzig, Germany
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2016 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business
No claim to original U.S. Government works
Version Date: 20150910
International Standard Book Number-13: 978-1-4822-5346-7 (eBook - PDF)
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the valid-
ity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or uti-
lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy-
ing, microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com