{"id":201,"date":"2019-04-01T14:27:51","date_gmt":"2019-04-01T14:27:51","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=201"},"modified":"2019-04-01T14:27:53","modified_gmt":"2019-04-01T14:27:53","slug":"local-regression-in-python","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/","title":{"rendered":"Local regression in Python"},"content":{"rendered":"\n<p>I love data visualization make-overs (<a href=\"https:\/\/www.allendowney.com\/blog\/2019\/01\/30\/data-visualization-for-academics\/\">like this one I wrote a few months ago<\/a>), but sometimes the tone can be too negative (<a href=\"https:\/\/www.allendowney.com\/blog\/2019\/01\/30\/data-visualization-for-academics\/\">like this one I wrote a few months ago<\/a>).<\/p>\n\n\n\n<p>Sarah Leo, a data journalist at <em>The Economist<\/em>, has found the perfect solution: re-making your own visualizations.  <a href=\"https:\/\/twitter.com\/MissSarahLeo\/status\/1110957479897325568\">Here&#8217;s her tweet<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png\" alt=\"\" class=\"wp-image-202\" width=\"374\" height=\"432\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png 747w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23-260x300.png 260w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23-234x270.png 234w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/figure>\n\n\n\n<p>And <a href=\"https:\/\/medium.economist.com\/mistakes-weve-drawn-a-few-8cdd8a42d368\">here&#8217;s the link to the article<\/a>, which you should go read before you come back here.<\/p>\n\n\n\n<p>One of her examples is the noisy line plot on the left, which shows polling results over time.  <\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/1_9GzHVtm4y_LeVmFCjqV3Ww.png\" alt=\"\" class=\"wp-image-203\" width=\"400\" height=\"209\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/1_9GzHVtm4y_LeVmFCjqV3Ww.png 800w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/1_9GzHVtm4y_LeVmFCjqV3Ww-300x157.png 300w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/1_9GzHVtm4y_LeVmFCjqV3Ww-768x401.png 768w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/1_9GzHVtm4y_LeVmFCjqV3Ww-517x270.png 517w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><figcaption><br><\/figcaption><\/figure>\n\n\n\n<p>Here&#8217;s Leo&#8217;s explanation of what&#8217;s wrong and why:<\/p>\n\n\n\n<p><em>Instead of plotting the individual polls with a smoothed curve to show the trend, we connected the actual values of each individual poll. This happened, primarily, because our in-house charting tool does not plot smoothed lines. Until fairly recently, we were less comfortable with statistical software (like R) that allows more sophisticated visualisations. Today, all of us are able to plot a polling chart like the redesigned one above.<\/em><\/p>\n\n\n\n<p>This confession made me realize that I am in the same boat they were in: I know about local regression, but I don&#8217;t use it because I haven&#8217;t bothered to learn the tools.<\/p>\n\n\n\n<p>Fortunately, filling this gap in my toolkit took less than an hour.  The StatsModels library provides <a href=\"https:\/\/www.statsmodels.org\/dev\/generated\/statsmodels.nonparametric.smoothers_lowess.lowess.html\">lowess<\/a>, which computes <a href=\"https:\/\/en.wikipedia.org\/wiki\/Local_regression\">locally weighted scatterplot smoothing.<\/a><\/p>\n\n\n\n<p>I grabbed <a href=\"http:\/\/infographics.economist.com\/databank\/Economist_brexit.csv\">the data from <em>The Economist<\/em><\/a> and read it into a Pandas DataFrame. Then I wrote the following function, which takes a Pandas Series, computes a LOWESS, and returns a Pandas Series with the results:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from statsmodels.nonparametric.smoothers_lowess import lowess\n\ndef make_lowess(series):\n    endog = series.values\n    exog = series.index.values\n\n    smooth = lowess(endog, exog)\n    index, data = np.transpose(smooth)\n\n    return pd.Series(data, index=pd.to_datetime(index)) <\/code><\/pre>\n\n\n\n<p>And here&#8217;s what the results look like:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"264\" src=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/image.png\" alt=\"\" class=\"wp-image-204\" srcset=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/image.png 376w, https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/image-300x211.png 300w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/figure>\n\n\n\n<p>The smoothed lines I got look a little different from the ones in <em>The Economist<\/em> article.  In general the results depends on the parameters we give LOWESS.  You can <a href=\"https:\/\/gist.github.com\/818f6153ef316aee80467c51faee80f8\">see all the details in this Jupyter notebook<\/a>.<\/p>\n\n\n\n<p>Thanks to Sarah Leo for inspiring me to learn to use LOWESS, and for providing the data I used to replicate the results.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I love data visualization make-overs (like this one I wrote a few months ago), but sometimes the tone can be too negative (like this one I wrote a few months ago). Sarah Leo, a data journalist at The Economist, has found the perfect solution: re-making your own visualizations. Here&#8217;s her tweet. And here&#8217;s the link to the article, which you should go read before you come back here. One of her examples is the noisy line plot on the left,&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\"> 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":[18,17,16],"class_list":["post-201","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-local-regression","tag-lowess","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Local regression in Python - 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\/2019\/04\/01\/local-regression-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Local regression in Python - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"I love data visualization make-overs (like this one I wrote a few months ago), but sometimes the tone can be too negative (like this one I wrote a few months ago). Sarah Leo, a data journalist at The Economist, has found the perfect solution: re-making your own visualizations. Here&#8217;s her tweet. And here&#8217;s the link to the article, which you should go read before you come back here. One of her examples is the noisy line plot on the left,... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-01T14:27:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-01T14:27:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.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=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\"},\"author\":{\"name\":\"AllenDowney\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Local regression in Python\",\"datePublished\":\"2019-04-01T14:27:51+00:00\",\"dateModified\":\"2019-04-01T14:27:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\"},\"wordCount\":334,\"publisher\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png\",\"keywords\":[\"local regression\",\"lowess\",\"python\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\",\"url\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\",\"name\":\"Local regression in Python - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png\",\"datePublished\":\"2019-04-01T14:27:51+00:00\",\"dateModified\":\"2019-04-01T14:27:53+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage\",\"url\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png\",\"contentUrl\":\"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png\",\"width\":747,\"height\":863},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.allendowney.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Local regression in Python\"}]},{\"@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":"Local regression in Python - 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\/2019\/04\/01\/local-regression-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Local regression in Python - Probably Overthinking It","og_description":"I love data visualization make-overs (like this one I wrote a few months ago), but sometimes the tone can be too negative (like this one I wrote a few months ago). Sarah Leo, a data journalist at The Economist, has found the perfect solution: re-making your own visualizations. Here&#8217;s her tweet. And here&#8217;s the link to the article, which you should go read before you come back here. One of her examples is the noisy line plot on the left,... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/","og_site_name":"Probably Overthinking It","article_published_time":"2019-04-01T14:27:51+00:00","article_modified_time":"2019-04-01T14:27:53+00:00","og_image":[{"url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.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":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/"},"author":{"name":"AllenDowney","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Local regression in Python","datePublished":"2019-04-01T14:27:51+00:00","dateModified":"2019-04-01T14:27:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/"},"wordCount":334,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png","keywords":["local regression","lowess","python"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/","url":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/","name":"Local regression in Python - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png","datePublished":"2019-04-01T14:27:51+00:00","dateModified":"2019-04-01T14:27:53+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#primaryimage","url":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png","contentUrl":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2019\/04\/Screenshot-at-2019-04-01-09-49-23.png","width":747,"height":863},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2019\/04\/01\/local-regression-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Local regression in Python"}]},{"@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":1551,"url":"https:\/\/www.allendowney.com\/blog\/2025\/05\/22\/my-very-busy-week\/","url_meta":{"origin":201,"position":0},"title":"My very busy week","author":"AllenDowney","date":"May 22, 2025","format":false,"excerpt":"I'm not sure who scheduled ODSC and PyConUS during the same week, but I am unhappy with their decisions. Last Tuesday I presented a talk and co-presented a workshop at ODSC, and on Thursday I presented a tutorial at PyCon. If you would like to follow along with my very\u2026","rel":"","context":"In \"bayesian statistics\"","block_context":{"text":"bayesian statistics","link":"https:\/\/www.allendowney.com\/blog\/tag\/bayesian-statistics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/foMbacbuAQk\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":586,"url":"https:\/\/www.allendowney.com\/blog\/2021\/04\/30\/whats-new-in-think-bayes-2\/","url_meta":{"origin":201,"position":1},"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":972,"url":"https:\/\/www.allendowney.com\/blog\/2023\/07\/08\/backlash-of-homophobia\/","url_meta":{"origin":201,"position":2},"title":"Backlash of Homophobia?","author":"AllenDowney","date":"July 8, 2023","format":false,"excerpt":"Last week I published an excerpt from Probably Overthinking It that showed a long-term decline in homophobic responses to questions in the General Social Survey, starting around 1990 and continuing in the most recent data. Then I heard from a friend that Gallup published an article just a few weeks\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\/2023\/07\/lowess-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2023\/07\/lowess-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2023\/07\/lowess-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1627,"url":"https:\/\/www.allendowney.com\/blog\/2025\/10\/22\/the-foundation-fallacy\/","url_meta":{"origin":201,"position":3},"title":"The Foundation Fallacy","author":"AllenDowney","date":"October 22, 2025","format":false,"excerpt":"At Olin College recently, I met with a group from the Kyiv School of Economics who are creating a new engineering program. I am very impressed with the work they are doing, and their persistence despite everything happening in Ukraine. As preparation for their curriculum design process, they interviewed engineers\u2026","rel":"","context":"In \"engineering education\"","block_context":{"text":"engineering education","link":"https:\/\/www.allendowney.com\/blog\/tag\/engineering-education\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/10\/image-2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1449,"url":"https:\/\/www.allendowney.com\/blog\/2024\/12\/04\/multiple-regression-with-statsmodels\/","url_meta":{"origin":201,"position":4},"title":"Multiple Regression with StatsModels","author":"AllenDowney","date":"December 4, 2024","format":false,"excerpt":"This is the third is a series of excerpts from Elements of Data Science which available from Lulu.com and online booksellers. It's from Chapter 10, which is about multiple regression. You can read the complete chapter here, or run the Jupyter notebook on Colab. In the previous chapter we used\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\/12\/ecc1aef34032bb07cf1639367d00ddbe2fc8a8ed7532628b9ddddafed10f7f38.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1541,"url":"https:\/\/www.allendowney.com\/blog\/2025\/04\/06\/announcing-think-stats-3e\/","url_meta":{"origin":201,"position":5},"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":[]}],"_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/201","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=201"}],"version-history":[{"count":10,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":214,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/201\/revisions\/214"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}