{"id":1397,"date":"2024-10-22T17:44:54","date_gmt":"2024-10-22T17:44:54","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=1397"},"modified":"2024-10-22T17:44:54","modified_gmt":"2024-10-22T17:44:54","slug":"think-stats-3rd-edition","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/","title":{"rendered":"Think Stats 3rd Edition"},"content":{"rendered":"\n<p>I am excited to announce that I have started work on a third edition of <em>Think Stats<\/em>, to be published by O&#8217;Reilly Media in 2025. At this point the content is mostly settled, and I am revising chapters to get them ready for technical review.<\/p>\n\n\n\n<p>If you want to start reading now, <a href=\"https:\/\/allendowney.github.io\/ThinkStats\/\">the current draft is here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What&#8217;s new?<\/h2>\n\n\n\n<p>For the third edition, I started by moving the book into Jupyter notebooks. This change has one immediate benefit \u2013 you can read the text, run the code, and work on the exercises all in one place. And the notebooks are designed to work on Google Colab, so you can get started without installing anything.<\/p>\n\n\n\n<p>The move to notebooks has another benefit \u2013 the code is more visible. In the first two editions, some of the code was in the book and some was in supporting files available online. In retrospect, it\u2019s clear that splitting the material in this way was not ideal, and it made the code more complicated than it needed to be. In the third edition, I was able to simplify the code and make it more readable.<\/p>\n\n\n\n<p>Since the last edition was published, I\u2019ve developed a library called <code><a href=\"https:\/\/github.com\/AllenDowney\/empiricaldist\/\">empiricaldist<\/a><\/code> that provides objects that represent statistical distributions. This library is more mature now, so the updated code makes better use of it.<\/p>\n\n\n\n<p>When I started this project, NumPy and SciPy were not as widely used, and Pandas even less, so the original code used Python data structures like lists and dictionaries. This edition uses arrays and Pandas structures extensively, and makes more use of functions these libraries provide. I assume readers have some familiarity with these tools, but I explain each feature when it first appears.<\/p>\n\n\n\n<p>The third edition covers the same topics as the original, in almost the same order, but the text is substantially revised. Some of the examples are new; others are updated with new data. I\u2019ve developed new exercises, revised some of the old ones, and removed a few. I think the updated exercises are better connected to the examples, and more interesting.<\/p>\n\n\n\n<p>Since the first edition, this book has been based on the thesis that many ideas that are hard to explain with math are easier to explain with code. In this edition, I have doubled down on this idea, to the point where there is almost no mathematical notation, only code.<\/p>\n\n\n\n<p>Overall, I think these changes make <em>Think Stats<\/em> a better book. To give you a taste, here&#8217;s an excerpt from <a href=\"https:\/\/allendowney.github.io\/ThinkStats\/chap12.html\">Chapter 12: Time Series Analysis<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Multiplicative Model<\/h2>\n\n\n\n<p>The additive model we used in the previous section is based on the assumption that the time series is well modeled as the <em>sum<\/em> of a long-term trend, a seasonal component, and a residual component \u2013 which implies that the magnitude of the seasonal component and the residuals does not vary over time.<\/p>\n\n\n\n<p>As an example that violates this assumption, let\u2019s look at small-scale solar electricity production since 2014.<\/p>\n\n\n\n<pre id=\"codecell45\" class=\"wp-block-preformatted\">solar = elec[\"United States : small-scale solar photovoltaic\"].dropna()\nsolar.plot(label=\"solar\")\ndecorate(ylabel=\"GWh\")\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"254\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\" alt=\"_images\/86539269db9ce2568bf7bb6e80c25d37c5d8ddc93ba8de6352e857d8bb148cec.png\" class=\"wp-image-1400\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png 442w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5-300x172.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<p>Over this interval, total production has increased several times over. And it\u2019s clear that the magnitude of seasonal variation has increased as well.<\/p>\n\n\n\n<p>If suppose that the magnitudes of seasonal and random variation are proportional to the magnitude of the trend, that suggests an alternative to the additive model in which the time series is the <em>product<\/em> of a trend, a seasonal component, and a residual component.<\/p>\n\n\n\n<p>To try out this multiplicative model, we\u2019ll split this series into training and test sets.<\/p>\n\n\n\n<pre id=\"codecell46\" class=\"wp-block-preformatted\">training, test = split_series(solar)\n<\/pre>\n\n\n\n<p>And call <code>seasonal_decompose<\/code> with the <code>model=multiplicative<\/code> argument.<\/p>\n\n\n\n<pre id=\"codecell47\" class=\"wp-block-preformatted\">decomposition = seasonal_decompose(training, model=\"multiplicative\", period=12)\n<\/pre>\n\n\n\n<p>Here\u2019s what the results look like.<\/p>\n\n\n\n<pre id=\"codecell48\" class=\"wp-block-preformatted\">plot_decomposition(training, decomposition)\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"367\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-9.png\" alt=\"_images\/eff587bb6527bbf770da7f8e33ab451633af92b85cc8dd6c2c1d44ccaacd37ed.png\" class=\"wp-image-1404\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-9.png 441w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-9-300x250.png 300w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-9-324x270.png 324w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/figure>\n\n\n\n<p>Now the seasonal and residual components are multiplicative factors. So, it looks like the seasonal component varies from about 25% below the trend to 25% above. And the residual component is usually less than 5% either way, with the exception of some larger factors in the first period.<\/p>\n\n\n\n<pre id=\"codecell49\" class=\"wp-block-preformatted\">trend = decomposition.trend\nseasonal = decomposition.seasonal\nresid = decomposition.resid\n<\/pre>\n\n\n\n<p>The <em>R<\/em>\u00b2 value of this model is very high.<\/p>\n\n\n\n<pre id=\"codecell50\" class=\"wp-block-preformatted\">rsquared = 1 - resid.var() \/ training.var()\nrsquared\n<\/pre>\n\n\n\n<pre id=\"codecell51\" class=\"wp-block-preformatted\">0.9999999992978134\n<\/pre>\n\n\n\n<p>The production of a solar panel is almost entirely a function of the sunlight it\u2019s exposed to, so it makes sense that it follows an annual cycle so closely.<\/p>\n\n\n\n<p>To predict the long term trend, we\u2019ll use a quadratic model.<\/p>\n\n\n\n<pre id=\"codecell52\" class=\"wp-block-preformatted\">months = range(len(training))\ndata = pd.DataFrame({\"trend\": trend, \"months\": months}).dropna()\nresults = smf.ols(\"trend ~ months + I(months**2)\", data=data).fit()\n<\/pre>\n\n\n\n<p>In the Patsy formula, the term <code>\"I(months**2)\"<\/code> adds a quadratic term to the model, so we don\u2019t have to compute it explicitly. Here are the results.<\/p>\n\n\n\n<pre id=\"codecell53\" class=\"wp-block-preformatted\">display_summary(results)\n<\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><\/td><th>coef<\/th><th>std err<\/th><th>t<\/th><th>P&gt;|t|<\/th><th>[0.025<\/th><th>0.975]<\/th><\/tr><tr><th>Intercept<\/th><td>766.1962<\/td><td>13.494<\/td><td>56.782<\/td><td>0.000<\/td><td>739.106<\/td><td>793.286<\/td><\/tr><tr><th>months<\/th><td>22.2153<\/td><td>0.938<\/td><td>23.673<\/td><td>0.000<\/td><td>20.331<\/td><td>24.099<\/td><\/tr><tr><th>I(months ** 2)<\/th><td>0.1762<\/td><td>0.014<\/td><td>12.480<\/td><td>0.000<\/td><td>0.148<\/td><td>0.205<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>R-squared:<\/td><td>0.9983<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The p-values of the linear and quadratic terms are very low, which suggests that the quadratic model captures more information about the trend than a linear model would \u2013 and the <em>R<\/em>\u00b2 value is very high.<\/p>\n\n\n\n<p>Now we can use the model to compute the expected value of the trend for the past and future.<\/p>\n\n\n\n<pre id=\"codecell54\" class=\"wp-block-preformatted\">months = range(len(solar))\ndf = pd.DataFrame({\"months\": months})\npred_trend = results.predict(df)\npred_trend.index = solar.index\n<\/pre>\n\n\n\n<p>Here\u2019s what it looks like.<\/p>\n\n\n\n<pre id=\"codecell55\" class=\"wp-block-preformatted\">pred_trend.plot(color=\"0.8\", label=\"quadratic model\")\ntrend.plot(color=\"C1\")\ndecorate(ylabel=\"GWh\")\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"255\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-6.png\" alt=\"_images\/a5a5c42d8344c1c9773f46a0e41736b2243856990ad79cc4ee351ece33e24300.png\" class=\"wp-image-1401\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-6.png 442w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-6-300x173.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<p>The quadratic model fits the past trend well. Now we can use the seasonal component from the decomposition to predict the seasonal component.<\/p>\n\n\n\n<pre id=\"codecell56\" class=\"wp-block-preformatted\">monthly_averages = seasonal.groupby(seasonal.index.month).mean()\npred_seasonal = monthly_averages[pred_trend.index.month]\npred_seasonal.index = pred_trend.index\n<\/pre>\n\n\n\n<p>Finally, to compute \u201cretrodictions\u201d for past values and predictions for the future, we multiply the trend and the seasonal component.<\/p>\n\n\n\n<pre id=\"codecell57\" class=\"wp-block-preformatted\">pred = pred_trend * pred_seasonal\n<\/pre>\n\n\n\n<p>Here is the result along with the training data.<\/p>\n\n\n\n<pre id=\"codecell58\" class=\"wp-block-preformatted\">training.plot(label=\"training\")\npred.plot(alpha=0.6, color=\"0.6\", label=\"prediction\")\ndecorate(ylabel=\"GWh\")\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"254\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-7.png\" alt=\"_images\/388e99505acc1f95283d9016e2a7d4839822a519bc821b9b6ec1a56f41aa3cdf.png\" class=\"wp-image-1402\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-7.png 442w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-7-300x172.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<p>The retrodictions fit the training data well and the predictions seem plausible \u2013 now let\u2019s see if they turned out to be accurate. Here are the predictions along with the test data.<\/p>\n\n\n\n<pre id=\"codecell59\" class=\"wp-block-preformatted\">future = pred[test.index]\nfuture.plot(ls=\"--\", color=\"0.6\", label=\"prediction\")\n\ntest.plot(label=\"actual\")\ndecorate(ylabel=\"GWh\")\n<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"254\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-8.png\" alt=\"_images\/662c539d178eeda1c2b6a51234899f683bbe5fe20d981e1897d20811f7d0efd0.png\" class=\"wp-image-1403\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-8.png 442w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-8-300x172.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/figure>\n\n\n\n<p>For the first three years, the predictions are very good. After that, it looks like actual growth exceeded expectations.<\/p>\n\n\n\n<p>In this example, seasonal decomposition worked well for modeling and predicting solar production, but in the previous example, it was not very effective for nuclear production. In the next section, we\u2019ll try a different approach, autoregression.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am excited to announce that I have started work on a third edition of Think Stats, to be published by O&#8217;Reilly Media in 2025. At this point the content is mostly settled, and I am revising chapters to get them ready for technical review. If you want to start reading now, the current draft is here. What&#8217;s new? For the third edition, I started by moving the book into Jupyter notebooks. This change has one immediate benefit \u2013 you&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1397","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Think Stats 3rd Edition - Probably Overthinking It<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Think Stats 3rd Edition - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"I am excited to announce that I have started work on a third edition of Think Stats, to be published by O&#8217;Reilly Media in 2025. At this point the content is mostly settled, and I am revising chapters to get them ready for technical review. If you want to start reading now, the current draft is here. What&#8217;s new? For the third edition, I started by moving the book into Jupyter notebooks. This change has one immediate benefit \u2013 you... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-22T17:44:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\" \/>\n<meta name=\"author\" content=\"AllenDowney\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:site\" content=\"@AllenDowney\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"AllenDowney\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\"},\"author\":{\"name\":\"AllenDowney\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Think Stats 3rd Edition\",\"datePublished\":\"2024-10-22T17:44:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\"},\"wordCount\":929,\"publisher\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\",\"url\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\",\"name\":\"Think Stats 3rd Edition - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\",\"datePublished\":\"2024-10-22T17:44:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage\",\"url\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\",\"contentUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png\",\"width\":442,\"height\":254},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.allendowney.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Think Stats 3rd Edition\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#website\",\"url\":\"https:\/\/www.allendowney.com\/blog\/\",\"name\":\"Probably Overthinking It\",\"description\":\"Data science, Bayesian Statistics, and other ideas\",\"publisher\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\",\"name\":\"Probably Overthinking It\",\"url\":\"https:\/\/www.allendowney.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png\",\"contentUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png\",\"width\":714,\"height\":784,\"caption\":\"Probably Overthinking It\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/AllenDowney\",\"https:\/\/www.linkedin.com\/in\/allendowney\/\",\"https:\/\/bsky.app\/profile\/allendowney.bsky.social\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207\",\"name\":\"AllenDowney\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g\",\"caption\":\"AllenDowney\"},\"url\":\"https:\/\/www.allendowney.com\/blog\/author\/allendowney_6dbrc4\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Think Stats 3rd Edition - Probably Overthinking It","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/","og_locale":"en_US","og_type":"article","og_title":"Think Stats 3rd Edition - Probably Overthinking It","og_description":"I am excited to announce that I have started work on a third edition of Think Stats, to be published by O&#8217;Reilly Media in 2025. At this point the content is mostly settled, and I am revising chapters to get them ready for technical review. If you want to start reading now, the current draft is here. What&#8217;s new? For the third edition, I started by moving the book into Jupyter notebooks. This change has one immediate benefit \u2013 you... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/","og_site_name":"Probably Overthinking It","article_published_time":"2024-10-22T17:44:54+00:00","og_image":[{"url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png","type":"","width":"","height":""}],"author":"AllenDowney","twitter_card":"summary_large_image","twitter_creator":"@AllenDowney","twitter_site":"@AllenDowney","twitter_misc":{"Written by":"AllenDowney","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/"},"author":{"name":"AllenDowney","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Think Stats 3rd Edition","datePublished":"2024-10-22T17:44:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/"},"wordCount":929,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage"},"thumbnailUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/","url":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/","name":"Think Stats 3rd Edition - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage"},"thumbnailUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png","datePublished":"2024-10-22T17:44:54+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#primaryimage","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/10\/image-5.png","width":442,"height":254},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2024\/10\/22\/think-stats-3rd-edition\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Think Stats 3rd Edition"}]},{"@type":"WebSite","@id":"https:\/\/www.allendowney.com\/blog\/#website","url":"https:\/\/www.allendowney.com\/blog\/","name":"Probably Overthinking It","description":"Data science, Bayesian Statistics, and other ideas","publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allendowney.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.allendowney.com\/blog\/#organization","name":"Probably Overthinking It","url":"https:\/\/www.allendowney.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","width":714,"height":784,"caption":"Probably Overthinking It"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/AllenDowney","https:\/\/www.linkedin.com\/in\/allendowney\/","https:\/\/bsky.app\/profile\/allendowney.bsky.social"]},{"@type":"Person","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207","name":"AllenDowney","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fb01b3a7f7190bea1bbf7f0852e686c2f8c03b099222df2ce4bc7926f15bcb43?s=96&d=mm&r=g","caption":"AllenDowney"},"url":"https:\/\/www.allendowney.com\/blog\/author\/allendowney_6dbrc4\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1541,"url":"https:\/\/www.allendowney.com\/blog\/2025\/04\/06\/announcing-think-stats-3e\/","url_meta":{"origin":1397,"position":0},"title":"Announcing Think Stats 3e","author":"AllenDowney","date":"April 6, 2025","format":false,"excerpt":"The third edition of Think Stats is on its way to the printer! You can preorder now from Bookshop.org and Amazon (those are affiliate links), or if you can't wait to get a paper copy, you can read the free, online version here. Here's the new cover, still featuring a\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/04\/image-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/04\/image-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/04\/image-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/04\/image-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1655,"url":"https:\/\/www.allendowney.com\/blog\/2025\/11\/04\/think-dsp-second-edition\/","url_meta":{"origin":1397,"position":1},"title":"Think DSP second edition","author":"AllenDowney","date":"November 4, 2025","format":false,"excerpt":"I have started work on a second edition of Think DSP! You can see the current draft here. I started this project in part because of this announcement: Once in a while, a few of the Scicloj friends will meet to learn about signal processing, following the Think DSP book\u2026","rel":"","context":"In \"DSP\"","block_context":{"text":"DSP","link":"https:\/\/www.allendowney.com\/blog\/tag\/dsp\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1229,"url":"https:\/\/www.allendowney.com\/blog\/2024\/02\/15\/think-python-third-edition\/","url_meta":{"origin":1397,"position":2},"title":"Think Python third edition!","author":"AllenDowney","date":"February 15, 2024","format":false,"excerpt":"I am happy to announce the third edition of Think Python, which will be published by O'Reilly Media later this year. You can read the online version of the book here. I've posted the Preface and the first four chapters -- more on the way soon! You can read the\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/02\/image.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":451,"url":"https:\/\/www.allendowney.com\/blog\/2020\/06\/03\/think-dsp-v1-1\/","url_meta":{"origin":1397,"position":3},"title":"Think DSP v1.1","author":"AllenDowney","date":"June 3, 2020","format":false,"excerpt":"For the last week or so I have been working on an update to Think DSP. The latest version is available now from Green Tea Press. Here are some of the changes I made: Running on Colab All notebooks now run on Colab. Judging by my inbox, many readers find\u2026","rel":"","context":"In \"digital signal processing\"","block_context":{"text":"digital signal processing","link":"https:\/\/www.allendowney.com\/blog\/tag\/digital-signal-processing\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":586,"url":"https:\/\/www.allendowney.com\/blog\/2021\/04\/30\/whats-new-in-think-bayes-2\/","url_meta":{"origin":1397,"position":4},"title":"What&#8217;s new in Think Bayes 2?","author":"AllenDowney","date":"April 30, 2021","format":false,"excerpt":"I'm happy to report that the second edition of Think Bayes is available for preorder now. What's new in the second edition? I wrote a new Chapter 1 that introduces conditional probability using the Linda the Banker problem and data from the General Social Survey.I added new chapters on survival\u2026","rel":"","context":"In \"bayesian statistics\"","block_context":{"text":"bayesian statistics","link":"https:\/\/www.allendowney.com\/blog\/tag\/bayesian-statistics\/"},"img":{"alt_text":"Cover of Think Bayes second edition","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2021\/04\/think_bayes_2e_cover.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1334,"url":"https:\/\/www.allendowney.com\/blog\/2024\/07\/17\/elements-of-data-science\/","url_meta":{"origin":1397,"position":5},"title":"Elements of Data Science","author":"AllenDowney","date":"July 17, 2024","format":false,"excerpt":"I'm excited to announce the launch of my newest book, Elements of Data Science. As the subtitle suggests, it is about \"Getting started with Data Science and Python\". Order now from Lulu.com and get 20% off! I am publishing this book myself, which has one big advantage: I can print\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2024\/07\/image.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/comments?post=1397"}],"version-history":[{"count":3,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1397\/revisions"}],"predecessor-version":[{"id":1405,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/1397\/revisions\/1405"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=1397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=1397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=1397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}