{"id":630,"date":"2024-09-20T10:45:44","date_gmt":"2024-09-20T14:45:44","guid":{"rendered":"https:\/\/ozer.gt\/log\/?p=630"},"modified":"2024-09-20T10:49:52","modified_gmt":"2024-09-20T14:49:52","slug":"discrepancies-in-standard-errors-r-vs-python","status":"publish","type":"post","link":"https:\/\/ozer.gt\/log\/2024\/09\/20\/discrepancies-in-standard-errors-r-vs-python\/","title":{"rendered":"Discrepancies in standard errors R vs. Python"},"content":{"rendered":"<p>You may have modeled (or asked your data science team to model) the same data in R and Python. Why? Most data science teams use both R and Python, with team members specializing in one or the other. So, this could be a model changing hands. Or maybe you wanted to make sure the package implementation behaved as intended. You may also have needed better computational efficiency (R <em>fixest<\/em> can be much faster than Python <em>linearmodels<\/em> on panel data).<\/p>\n<p>For whatever reason, when you run models in R and Python, you may have run into the following situation: The parameter estimates are the same, but the standard errors (and p-values) are different. The data and the model are exactly the same. So you can&#8217;t explain why, and you don&#8217;t know which standard error \/ statistical significance test to trust and report to the business.<\/p>\n<p>If you&#8217;re curious about the most common reason, check out another previously missing section now published in the Causal Book, <a href=\"https:\/\/causalbook.com\/-\/Comparison+of+standard+errors+in+R+fixest+vs.+Python+linearmodels\">here<\/a>. We now discuss this as part of our exercise on applying the same instrumental variable model in R vs. Python.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may have modeled (or asked your data science team to model) the same data in R and Python. Why? Most data science teams use both R and Python, with team members specializing in one or the other. So, this could be a model changing hands. Or maybe you wanted to make sure the package [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-630","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/posts\/630","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/comments?post=630"}],"version-history":[{"count":10,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/posts\/630\/revisions"}],"predecessor-version":[{"id":640,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/posts\/630\/revisions\/640"}],"wp:attachment":[{"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/media?parent=630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/categories?post=630"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ozer.gt\/log\/wp-json\/wp\/v2\/tags?post=630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}