{"id":843,"date":"2023-01-20T13:58:48","date_gmt":"2023-01-20T13:58:48","guid":{"rendered":"https:\/\/www.allendowney.com\/blog\/?p=843"},"modified":"2023-01-20T13:58:48","modified_gmt":"2023-01-20T13:58:48","slug":"resampling-for-logistic-regression","status":"publish","type":"post","link":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/","title":{"rendered":"Resampling for Logistic Regression"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">A <a href=\"https:\/\/www.reddit.com\/r\/statistics\/comments\/10ayfm5\/q_parametric_bootstrap_for_logistic_regression\/\">recent question on Reddit<\/a> asked about using resampling with logistic regression. The responses suggest two ways to do it, one parametric and one non-parametric. I implemented both of them and then invented a third, which is  hybrid of the two.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/allendowney.github.io\/ElementsOfDataScience\/resample_logit.html\">You can read the details of the implementation in the extended version of this article.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/colab.research.google.com\/github\/AllenDowney\/ElementsOfDataScience\/blob\/master\/examples\/resample_logit.ipynb\">Or you can click here to run the Jupyter notebook on Colab<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Different ways of computing sampling distributions \u2013 and the statistics derived from them, like standard errors and confidence intervals \u2013 yield different results. None of them are right or wrong; rather, they are based on different modeling assumptions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this example, it is easy to implement multiple models and compare the results. If they were substantially different, we would need to think more carefully about the modeling assumptions they are based on and choose the one we think is the best description of the data-generating process.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But in this example, the differences are small enough that they probably don\u2019t matter in practice. So we are free to choose whichever is easiest to implement, or fastest to compute, or convenient in some other way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is a common error to presume that the result of an analytic method is uniquely correct, and that results from computational methods like resampling are approximations to it. Analytic methods are often fast to compute, but they are always based on modeling assumptions and often based on approximations, so they are no more correct than computational methods.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A recent question on Reddit asked about using resampling with logistic regression. The responses suggest two ways to do it, one parametric and one non-parametric. I implemented both of them and then invented a third, which is hybrid of the two. You can read the details of the implementation in the extended version of this article. Or you can click here to run the Jupyter notebook on Colab Different ways of computing sampling distributions \u2013 and the statistics derived from&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/\"> 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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_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},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-843","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Resampling for Logistic Regression - 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\/2023\/01\/20\/resampling-for-logistic-regression\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Resampling for Logistic Regression - Probably Overthinking It\" \/>\n<meta property=\"og:description\" content=\"A recent question on Reddit asked about using resampling with logistic regression. The responses suggest two ways to do it, one parametric and one non-parametric. I implemented both of them and then invented a third, which is hybrid of the two. You can read the details of the implementation in the extended version of this article. Or you can click here to run the Jupyter notebook on Colab Different ways of computing sampling distributions \u2013 and the statistics derived from... Read More Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/\" \/>\n<meta property=\"og:site_name\" content=\"Probably Overthinking It\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-20T13:58:48+00:00\" \/>\n<meta name=\"author\" content=\"Allen B. Downey\" \/>\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=\"Allen B. Downey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/\"},\"author\":{\"name\":\"Allen B. Downey\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"headline\":\"Resampling for Logistic Regression\",\"datePublished\":\"2023-01-20T13:58:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/\"},\"wordCount\":252,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/\",\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/\",\"name\":\"Resampling for Logistic Regression - Probably Overthinking It\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#website\"},\"datePublished\":\"2023-01-20T13:58:48+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/2023\\\/01\\\/20\\\/resampling-for-logistic-regression\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Resampling for Logistic Regression\"}]},{\"@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\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\"},\"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\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/#\\\/schema\\\/person\\\/4e5bfb2e9af6c3446cb0031a7bf83207\",\"name\":\"Allen B. Downey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\",\"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\":\"Allen B. Downey\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/probably_logo.png\"},\"sameAs\":[\"https:\\\/\\\/www.allendowney.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/allendowney\\\/\",\"https:\\\/\\\/x.com\\\/AllenDowney\",\"https:\\\/\\\/github.com\\\/AllenDowney\",\"https:\\\/\\\/bsky.app\\\/profile\\\/allendowney.bsky.social\",\"https:\\\/\\\/allendowney.github.io\\\/Portfolio\\\/\",\"https:\\\/\\\/greenteapress.com\\\/wp\\\/\"],\"url\":\"https:\\\/\\\/www.allendowney.com\\\/blog\\\/author\\\/allen-downey\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Resampling for Logistic Regression - 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\/2023\/01\/20\/resampling-for-logistic-regression\/","og_locale":"en_US","og_type":"article","og_title":"Resampling for Logistic Regression - Probably Overthinking It","og_description":"A recent question on Reddit asked about using resampling with logistic regression. The responses suggest two ways to do it, one parametric and one non-parametric. I implemented both of them and then invented a third, which is hybrid of the two. You can read the details of the implementation in the extended version of this article. Or you can click here to run the Jupyter notebook on Colab Different ways of computing sampling distributions \u2013 and the statistics derived from... Read More Read More","og_url":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/","og_site_name":"Probably Overthinking It","article_published_time":"2023-01-20T13:58:48+00:00","author":"Allen B. Downey","twitter_card":"summary_large_image","twitter_creator":"@AllenDowney","twitter_site":"@AllenDowney","twitter_misc":{"Written by":"Allen B. Downey","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/#article","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/"},"author":{"name":"Allen B. Downey","@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"headline":"Resampling for Logistic Regression","datePublished":"2023-01-20T13:58:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/"},"wordCount":252,"publisher":{"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/","url":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/","name":"Resampling for Logistic Regression - Probably Overthinking It","isPartOf":{"@id":"https:\/\/www.allendowney.com\/blog\/#website"},"datePublished":"2023-01-20T13:58:48+00:00","breadcrumb":{"@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allendowney.com\/blog\/2023\/01\/20\/resampling-for-logistic-regression\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allendowney.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Resampling for Logistic Regression"}]},{"@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\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207"},"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":["Person","Organization"],"@id":"https:\/\/www.allendowney.com\/blog\/#\/schema\/person\/4e5bfb2e9af6c3446cb0031a7bf83207","name":"Allen B. Downey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png","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":"Allen B. Downey"},"logo":{"@id":"https:\/\/www.allendowney.com\/blog\/wp-content\/uploads\/2025\/03\/probably_logo.png"},"sameAs":["https:\/\/www.allendowney.com\/","https:\/\/www.linkedin.com\/in\/allendowney\/","https:\/\/x.com\/AllenDowney","https:\/\/github.com\/AllenDowney","https:\/\/bsky.app\/profile\/allendowney.bsky.social","https:\/\/allendowney.github.io\/Portfolio\/","https:\/\/greenteapress.com\/wp\/"],"url":"https:\/\/www.allendowney.com\/blog\/author\/allen-downey\/"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/843","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=843"}],"version-history":[{"count":2,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/843\/revisions"}],"predecessor-version":[{"id":847,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/posts\/843\/revisions\/847"}],"wp:attachment":[{"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/media?parent=843"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/categories?post=843"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allendowney.com\/blog\/wp-json\/wp\/v2\/tags?post=843"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}