{"id":180,"date":"2024-08-05T08:56:58","date_gmt":"2024-08-05T08:56:58","guid":{"rendered":"https:\/\/www.endogeneity.net\/?page_id=180"},"modified":"2026-04-04T14:38:10","modified_gmt":"2026-04-04T14:38:10","slug":"heckman-treatment-estimate-approach","status":"publish","type":"page","link":"https:\/\/www.endogeneity.net\/?page_id=180","title":{"rendered":"Heckman Treatment Estimate Approach"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--link_hover_color: var(--awb-color5);--link_color: var(--awb-color5);--awb-background-blend-mode:multiply;--awb-border-color:var(--awb-color1);--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-padding-top:50.156000000000006px;--awb-padding-bottom:0px;--awb-padding-top-small:70px;--awb-padding-right-small:40px;--awb-padding-bottom-small:0px;--awb-padding-left-small:40px;--awb-margin-bottom-medium:0px;--awb-margin-bottom-small:60px;--awb-background-color:#ffffff;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-center fusion-flex-content-wrap\" style=\"max-width:1248px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-padding-bottom-medium:0px;--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:85px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-margin-bottom-small:44px;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1 fusion-text-no-margin\" style=\"--awb-content-alignment:center;--awb-text-color:var(--awb-color1);--awb-margin-right:15%;--awb-margin-bottom:0px;--awb-margin-left:15%;\"><p style=\"text-align: left;\"><span style=\"color: #000000;\"><strong>Heckman Treatment Correction<\/strong><\/span><\/p>\n<p style=\"text-align: left; color: #000000;\">The Heckman treatment correction addresses endogeneity arising from treatment selection \u2014 situations where a binary predictor (treatment vs. no treatment) is not randomly assigned but driven by unobserved factors that also affect the outcome.<\/p>\n<p style=\"text-align: left;\"><strong style=\"color: #000000;\">When to Use It<\/strong><\/p>\n<p style=\"text-align: left; color: #000000;\">Use the Heckman treatment correction when:<\/p>\n<ul style=\"text-align: left;\">\n<li><span style=\"color: #000000;\">The focal predictor is binary (e.g., exposed vs. not exposed, adopted vs. not adopted)<\/span><\/li>\n<li><span style=\"color: #000000;\">Assignment to treatment is non-random and likely driven by unobserved factors<\/span><\/li>\n<li><span style=\"color: #000000;\">Those same unobserved factors plausibly affect the outcome<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left; color: #000000;\">This makes it the IV approach of choice for treatment selection \u2014 the specific form of endogeneity where unobserved characteristics determine who receives the treatment.<\/p>\n<p style=\"text-align: left;\"><strong style=\"color: #000000;\">How It Works<\/strong><\/p>\n<p style=\"text-align: left; color: #000000;\">Step 1: Model the Treatment Decision<\/p>\n<p style=\"text-align: left; color: #000000;\">Estimate a probit regression that predicts the probability of receiving the treatment (scoring &#8220;1&#8221; on the binary predictor). This first-stage model should include:<\/p>\n<ul style=\"text-align: left;\">\n<li><span style=\"color: #000000;\">All exogenous controls and fixed effects from the outcome equation<\/span><\/li>\n<li><span style=\"color: #000000;\">At least one strong and valid instrument \u2014 a variable that predicts treatment assignment but has no direct effect on the outcome<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left; color: #000000;\">From this probit model, compute the Inverse Mills Ratio (IMR) \u2014 a correction term that captures the bias introduced by non-random treatment assignment.<\/p>\n<p style=\"text-align: left; color: #000000;\">Step 2: Estimate the Outcome Equation<\/p>\n<p style=\"text-align: left; color: #000000;\">Include the Inverse Mills Ratio from Step 1 as an additional control variable in the outcome regression. The instrument is excluded from this stage. The IMR absorbs the correlation between the treatment decision and the error term, correcting for selection bias.<\/p>\n<p style=\"text-align: left; color: #000000;\">If the IMR is statistically significant, this indicates that treatment selection is indeed endogenous and that the correction is doing meaningful work.<\/p>\n<p style=\"text-align: left; color: #000000;\">Standard errors must be corrected via bootstrapping, since the second stage uses a generated regressor from the first stage.<\/p>\n<p style=\"text-align: left;\"><strong style=\"color: #000000;\">Requirements<\/strong><\/p>\n<ul style=\"text-align: left;\">\n<li><span style=\"color: #000000;\">A binary endogenous predictor (treatment indicator)<\/span><\/li>\n<li><span style=\"color: #000000;\">At least one strong instrumental variable (significantly predicts treatment assignment)<\/span><\/li>\n<li><span style=\"color: #000000;\">At least one valid instrumental variable (affects the outcome only through the treatment)<\/span><\/li>\n<li><span style=\"color: #000000;\">The first stage must include the same controls and fixed effects as the outcome equation<\/span><\/li>\n<li><span style=\"color: #000000;\">Bootstrapped standard errors to account for the generated Inverse Mills Ratio<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><strong style=\"color: #000000;\">Implementing the Heckman Treatment Estimate Approach<\/strong><\/p>\n<p style=\"text-align: left;\"><span style=\"color: #000000;\">The <\/span><em><strong style=\"color: #000000;\">etregress<\/strong> <\/em><span style=\"color: #000000;\">command can be used to implement the Heckman Treatment Estimate with the following code in <\/span><strong style=\"color: #000000;\">Stata<\/strong><span style=\"color: #000000;\"> (<\/span><a style=\"color: #000000;\" href=\"https:\/\/www.stata.com\/manuals\/causaletregress.pdf\">https:\/\/www.stata.com\/manuals\/causaletregress.pdf<\/a><span style=\"color: #000000;\">).<\/span><\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:15%;margin-bottom:0px;margin-left:15%;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\">\/\/estimate the parameters of the endogenous treatment-regression model\n\netregress Outcome Controls (treat = Predictor Instrument Controls)<\/textarea><\/div><div class=\"fusion-text fusion-text-2 fusion-text-no-margin\" style=\"--awb-content-alignment:center;--awb-text-color:var(--awb-color1);--awb-margin-right:15%;--awb-margin-bottom:0px;--awb-margin-left:15%;\"><p style=\"text-align: left;\"><span style=\"color: #000000;\"><br \/>\n<\/span><span style=\"color: #000000;\">The <i><b>sampleSelection <\/b><\/i>package can be used to implement the Heckman Treatment Estimate with the following code in <b>R<\/b> (https:\/\/cran.r-project.org\/web\/packages\/sampleSelection\/index.html).<\/span><\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-2 > .CodeMirror, .fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters {background-color:var(--awb-color1);}.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters { background-color: var(--awb-color2); }.fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-linenumber { color: var(--awb-color8); }<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-2 fusion-syntax-highlighter-theme-light\" style=\"opacity:0;margin-top:0px;margin-right:15%;margin-bottom:0px;margin-left:15%;font-size:14px;border-width:1px;border-style:solid;border-color:var(--awb-color3);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_2\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_2\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_2\" data-readOnly=\"nocursor\" data-lineNumbers=\"1\" data-lineWrapping=\"\" data-theme=\"default\">#load the sampleSelection package\n\nlibrary (sampleSelection)\n\n#outcome and treatment selection equations\n\nmodel_HTE <- treatreg(\n\nformula = Outcome ~ Controls,\n\ntreat.formula = Predictor ~ Instrument + Controls,\n\ndata = Dataset\n\n)\n\n#obtain the estimates\n\nsummary(model_HTE)<\/textarea><\/div><div class=\"fusion-text fusion-text-3 fusion-text-no-margin\" style=\"--awb-content-alignment:center;--awb-text-color:var(--awb-color1);--awb-margin-right:15%;--awb-margin-bottom:0px;--awb-margin-left:15%;\"><p style=\"text-align: left;\"><span style=\"color: #000000;\"><b>\u00a0<\/b><\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"color: #000000;\"><b>References<\/b><\/span><\/p>\n<ul>\n<li style=\"text-align: left;\"><span style=\"color: #000000;\">Heckman, James J. (1979), \u201cSample Selection Bias as a Specification Error,\u201d Econometrica: Journal of the Econometric Society, 47, 153-161.<\/span><\/li>\n<\/ul>\n<\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"100-width.php","meta":{"footnotes":""},"class_list":["post-180","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/pages\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=180"}],"version-history":[{"count":8,"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/pages\/180\/revisions"}],"predecessor-version":[{"id":504,"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=\/wp\/v2\/pages\/180\/revisions\/504"}],"wp:attachment":[{"href":"https:\/\/www.endogeneity.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}