think_stats.pdf

(11099 KB) Pobierz
2n
d
Ed
Think
Stats
EXPLOR ATORY
DATA ANALYSIS
Allen B. Downey
iti
on
Think Stats
If you know how to program, you have the skills to turn data into knowledge
using tools of probability and statistics. This concise introduction shows
you how to perform statistical analysis computationally, rather than
mathematically, with programs written in Python.
By working with a single case study throughout this thoroughly revised
book, you’ll learn the entire process of exploratory data analysis—from
collecting data and generating statistics to identifying patterns and testing
hypotheses. You’ll explore distributions, rules of probability, visualization,
and many other tools and concepts.
New chapters on regression, time series analysis, survival analysis, and
analytic methods will enrich your discoveries.
Thisisthemost
comprehensiveintroduc-
tiontothePythondata
analysisstackonthe
market.Practitioners
whowanttobrushup
ontheirtechnicalskills
bylearningaboutthe
toolsavailablefora
modernprogramming
languagewillalso
benefitfromthisbook.
Thisisanexcellent
modernstatistics
textbook.
Develop an understanding of probability and statistics by
writing and testing code
Run experiments to test statistical behavior, such as generating
samples from several distributions
Use simulations to understand concepts that are hard to grasp
mathematically
Import data from most sources with Python, rather than rely
on data that’s cleaned and formatted for statistics tools
Use statistical inference to answer questions about real-world
data
—Skipper Seabold
author of
StatsModels
Allen Downey
is a Professor of Computer Science at Olin College of Engineering.
He has taught computer science at Wellesley College, Colby College, and UC
Berkeley. He earned a PhD in Computer Science from UC Berkeley, and master’s
and bachelor’s degrees from MIT.
STATISTICS PROGR AMMING
Twitter: @oreillymedia
facebook.com/oreilly
US $34.99
CAN $36.99
ISBN: 978-1-491-90733-7
SECOND EDITION
Think Stats
Allen B. Downey
Think Stats, Second Edition
by Allen B. Downey
Copyright © 2015 Allen B. Downey. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/
institutional sales department: 800-998-9938 or
corporate@oreilly.com.
Editors:
Mike Loukides and Meghan Blanchette
Production Editor:
Melanie Yarbrough
Copyeditor:
Marta Justak
Proofreader:
Amanda Kersey
October 2014:
Second Edition
Indexer:
Allen B. Downey
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Illustrator:
Rebecca Demarest
Revision History for the Second Edition:
2014-10-09:
First release
See
http://oreilly.com/catalog/errata.csp?isbn=9781491907337
for release details.
The O’Reilly logo is a registered trademarks of O’Reilly Media, Inc.
Think Stats,
second edition, the cover
image of an archerfish, and related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While the publisher and the author have used good faith efforts to ensure that the information and instruc‐
tions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors
or omissions, including without limitation responsibility for damages resulting from the use of or reliance
on this work. Use of the information and instructions contained in this work is at your own risk. If any code
samples or other technology this work contains or describes is subject to open source licenses or the intel‐
lectual property rights of others, it is your responsibility to ensure that your use thereof complies with such
licenses and/or rights.
Think Stats is available under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported
License.
The author maintains an online version at
http://thinkstats2.com.
ISBN: 978-1-491-90733-7
[LSI]
Table of Contents
Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
1. Exploratory Data Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
A Statistical Approach
The National Survey of Family Growth
Importing the Data
DataFrames
Variables
Transformation
Validation
Interpretation
Exercises
Glossary
Representing Histograms
Plotting Histograms
NSFG Variables
Outliers
First Babies
Summarizing Distributions
Variance
Effect Size
Reporting Results
Exercises
Glossary
Pmfs
2
2
3
4
6
7
8
9
11
12
16
16
17
19
20
22
23
23
24
25
25
27
2. Distributions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3. Probability Mass Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
iii
Zgłoś jeśli naruszono regulamin