<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Scott's Mixtape Substack: Difference-in-Differences]]></title><description><![CDATA[This section is a dedicated space for all the writings I’ve produced over the years on the topic of difference-in-differences, which is a very popular method in causal inference. Since I write so much about this method, I decided to create a tab solely devoted to it to help people find this material.   It's a comprehensive collection of explainers and simulations designed to help you understand and navigate the emerging literature on diff-in-diff.]]></description><link>https://causalinf.substack.com/s/difference-in-differences</link><image><url>https://substackcdn.com/image/fetch/$s_!tCBR!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F515eb550-03a3-427c-ac1b-7cf640e822d0_1067x1067.png</url><title>Scott&apos;s Mixtape Substack: Difference-in-Differences</title><link>https://causalinf.substack.com/s/difference-in-differences</link></image><generator>Substack</generator><lastBuildDate>Thu, 09 Jul 2026 17:55:21 GMT</lastBuildDate><atom:link href="https://causalinf.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[scott cunningham]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[scunning@gmail.com]]></webMaster><itunes:owner><itunes:email><![CDATA[scunning@gmail.com]]></itunes:email><itunes:name><![CDATA[scott cunningham]]></itunes:name></itunes:owner><itunes:author><![CDATA[scott cunningham]]></itunes:author><googleplay:owner><![CDATA[scunning@gmail.com]]></googleplay:owner><googleplay:email><![CDATA[scunning@gmail.com]]></googleplay:email><googleplay:author><![CDATA[scott cunningham]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[More covariates and diff-in-diff -- this time with a lot of bold and italics!]]></title><description><![CDATA[Okay, so in previous posts I laid out this thing I keep running into.]]></description><link>https://causalinf.substack.com/p/more-covariates-and-diff-in-diff</link><guid isPermaLink="false">https://causalinf.substack.com/p/more-covariates-and-diff-in-diff</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Thu, 09 Jul 2026 14:01:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OEaC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Okay, so in previous posts I laid out this thing I keep running into. A person will more or less say this:</p><blockquote><p>If I run diff-in-diff without covariates, and find a number, but then run it with covariates and find a different number, this is bad and diff-in-diff is invalid.</p></blockquote><p>It&#8217;s a gut check, vibe thing for sure.  Of course, though, there is such a thing as &#8220;conditional parallel trends&#8221; and I gave an example a month ago.  My example was assume two groups &#8212; males and females &#8212; each of whom are on different earnings, <em>Y</em>, trends. But there are <strong>two trends</strong> in outcomes per group.  And they are this:</p><ol><li><p><strong>Y(0) trends</strong>.  These are the trends in earnings if untreated.  Say &#8220;high school only trends in earnings&#8221;. </p></li><li><p><strong>Y(1) trends</strong>.  These are the trends in earnings if treated.  So &#8220;college educated worker earnings trends&#8221;.</p></li></ol><p>See for diff-in-diff, since the target parameter is the ATT, then you have to ask yourself &#8212; which of those two random variables are we concerned about?  And the answer is <em>whichever one is missing</em>.  And for the ATT, we are missing this one:</p><blockquote><p>Missing counterfactual: E[Y(0)|D=1]</p></blockquote><p>We are missing the <strong>Y(0)</strong> trend, and we are missing it for a population of people who were treated which in this case is the college educated workers.  </p><p>But for diff-in-diff it&#8217;s even more narrow than that.  The diff-in-diff recall is a 2x2, or as I like to say &#8220;four averages and three subtractions.  Well guess what the parallel trends equation is? The parallel trends equation is itself a 2x2.  It is interestingly itself &#8220;four averages and three subtractions&#8221;.  In fact, in many cases best I can tell, the calculation to estimate a treatment effect has a selection bias term that is simply the same calculation measured on the missing counterfactual.  So when you calculate diff-in-diff:</p><blockquote><p>DiD = Delta Y_1 - Delta Y_0</p></blockquote><p>where Delta Y_1 is &#8220;after minus before earnings for the college educated workers&#8221;, and Delta Y_0 is &#8220;after minus before earnings for the high school educated workers.&#8221;  Guess what that equals:</p><blockquote><p>DiD = ATT + PT equation</p></blockquote><p>The left hand side is as I said Delta Y_1 - Delta Y_0.  But you know what the parallel trends (PT) equation is?</p><blockquote><p>PT equation = Delta Y(0)_1 - Delta Y(0)_0</p></blockquote><p>A lot of people don&#8217;t this, but did you know that the parallel trends equation is <em>itself</em> a diff-in-diff?  That&#8217;s right.  The bias of diff-in-diff <strong>is another diff-in-diff</strong>. It&#8217;s just that it&#8217;s a diff-in-diff on Y(0), which recall is &#8220;trends in earnings if high school only for the college educated worker&#8221; minus &#8220;trends in earnings if high school only for the high school only worker&#8221;.  </p><p>That&#8217;s what makes it a selection bias term.  Because selection bias for estimates of the ATT are simply the original calculation, measured in realized outcome Y, but this time for Y(0), which is missing for the treatment group!</p><p>But isn&#8217;t it interesting still?  It&#8217;s interesting to me that we say &#8220;parallel trends&#8221; but really what it actually is simply <em>another diff-in-diff</em>!  </p><p>Well look at it again close.  The <em>bias</em><strong> </strong>is <em>differences</em> in <strong>average</strong> Y(0) trends for two groups.  What does that mean? Well, for one, it means this:</p><blockquote><p>Average Y(0) trend for treatment group does not equal average Y(0) for control group</p></blockquote><p>I meant that&#8217;s what it means <strong>literally</strong>.  It means the means of two group&#8217;s Y(0) trends (after minus before in the Y(0) outcome) is not the same.  It does not mean the trends in Y are not the same, because differences. in the trends in Y is literally the diff-in-diff calculation and if there is any treatment effect, then under parallel trends that difference <strong>is the ATT</strong>. No, this is an <strong>imbalance </strong>in <strong>counterfactual Y(0) trends</strong>. Counterfactual because Y(0) &#8212; &#8220;high school only earnings&#8221; &#8212; is missing for the treatment group (college educated) the period after they got their college degree because the period after they got their college degree, their Y became Y(1) <em>not Y(0)</em>.</p><p>So, this is <strong>exactly</strong> why parallel trends is <strong>entirely a question</strong> about covariates.  Why?  Because what are the covariates that are responsible for trends in Y(0) and <strong>are those covariates unequally distributed across the two groups</strong>.</p><p>Apologies for yelling with a bunch of <strong>bold</strong> and <em>italics</em> but I get excited!  </p><p>Anyway, so here is my example.  <em>All high school educated </em>males earn +10 dollars year to year.  They get raises, in other words. But <em>high school educated females</em> earn +8 dollars a year. What did I just write down?  <strong>Trends</strong> <strong>in Y(0)</strong> for two groups &#8212; males and females. </p><p>Okay so that&#8217;s &#8220;heterogeneous group trends in Y(0)&#8221;.  That is not imbalance. Imbalance is about the college educated workers versus the high school educated workers in Y(0).  And if the males are just as equal in the treatment group than in the control group, then that covariate is <strong>irrelevant</strong> to a parallel trends violation.  Why? Because watch. Let&#8217;s say 40% of all college educated workers are male and 40% of all high school educated workers are male.  Then check this out:</p><blockquote><p>College educated trend is: 0.4 x 10 + 0.6 x 8 =8.8 </p><p>High school educated trend is 0.4 x 10 + 0.6 x 8 =8.8 </p></blockquote><p>And thus 8.8 - 8.8 = 0.  Why does that matter? <strong>Because the difference in the mean trend in Y(0) in D=1 and D=0 along those dimensions is balanced and thus parallel trends holds</strong>.</p><p>You know what that means? That means even with heterogenous trends in Y(0) by observable groups, you actually <em>do not need to control for sex</em>.  Because sex is balanced and even though there are heterogenous trend by sex, they&#8217;re <strong>neutered</strong>, they&#8217;re <strong>canceled out</strong> because of the balance. </p><p>That&#8217;s exactly the same reason why in an RCT you don&#8217;t have to control for covariates unless the randomization is conditional on those covariates <em>or</em> if those covariates are so deeply correlated with the outcome that including them can reduce the standard errors. My old colleague, Rebecca Thornton, would say that a lot when she would explain this to her students and it just always stuck with me that she was saying it.  It&#8217;s the same though with diff-in-diff.  It&#8217;s the exact same thing. Just because you have covariates that are predictive of trends or even cause those trends is not enough of a justification to condition on it in a model.</p><p>And in fact, I would caution you from doing that, especially if you are using Callaway and Sant&#8217;Anna. Why? Because you have to <strong>pay for these covariates</strong>.  They are not free. There is no such thing as a free lunch. In CS, you often are incorporating these covariates into the model with a propensity score and logistic regressions actually need a fair amount of treated units per covariate.  Sometimes as many as 7 or 10 treated units per covariate.  Well, in state level panel data, the US only has 50 states in the first place! So how quickly does that collapse you think into the curse of dimensionality and make it such that you really are getting nonsensical coefficients on the logit (which btw are suppressed anyway as output in most of the CS packages I know of  so you don&#8217;t even <em>see first hand</em> those coefficients anyway). </p><p>But let&#8217;s say you use regression adjustment.  Well, just know that if you&#8217;re using regression adjustment, you don&#8217;t really get out of jail with the curse there either. The curse is always there. It&#8217;s just that if you use covariates in OLS specifications, you&#8217;re going to be identifying off the functional form because if you have the curse of dimensionality happening, you&#8217;re going to be projecting  &#8212; OLS recall is the best linear <strong>predictor</strong> &#8212; into a space <em>where there is no data</em>. So you better be pretty confident about that regression specification and its functional form because it&#8217;s going to be imputing the Y(0) trend for the treated group off the Y(0) <em>fitted trend</em> for the control group. Dropping even one polynomial or one interaction will be technically an incorrect specification and can land you anywhere &#8212; especially in 2026 when <strong>no one is willing to relax a belief in heterogeneity</strong><em>.</em></p><p>So, what then do we do? Here&#8217;s what we do. </p><ol><li><p>We check if the covariates that we think are causing the Y(0) trends are <strong>balanced</strong> for the treatment and control group at baseline, and then</p></li><li><p>We estimate a propensity score, plot the histogram, check the distribution, see if there is both overlap <strong>and</strong> if the max value of the propensity score in the control group is <strong>almost 1</strong>. Because if it is almost 1, then the inverse probability weight will <strong>explode</strong>. </p></li></ol><p>Why? Because the weight in a diff-in-diff with inverse probability weights, which the original Abadie 2005 Restud had (&#8220;Semi Parametric Diff-in-Diff&#8221;) and the Sant&#8217;Anna and Zhao 2020 and Callaway and Sant&#8217;Anna 2021 also have, is equal to p(x)/[ 1- p(x) ], and that weight <em>only applies to the control group in diff-in-diff. </em><strong>Why only the control group?</strong> Because, we are estimating the ATT, and <em>nothing is wrong with the treatment group&#8217;s outcome</em>.  We are only missing the counterfactual for the treated group, and we are using the control group to get it as the control group is the only group that has the Y(0). </p><p>Well, check out what happens to that weight if the propensity score for the control group is &#8220;almost 1&#8221;. Assume it is 0.999, which you can easily get with a lot of heterogeneity in those Xs, weak to no support for some of them, and a large sample of control units. 0.999/[0.001] = 999.  </p><p>What&#8217;s 999?  That&#8217;s the weight on a single unit&#8217;s outcome.  A single unit&#8217;s first difference outcome in diff-in-diff using IPW will become that outcome <strong>times 999</strong>. That is an outlier, it has massive leverage over the estimate.  And you need to check it! You need to know if it&#8217;s there because that single observation could literally flip the sign or drive it to who knows where. What if that one unit is Elon Musk!  </p><p>We talk about this in section <a href="https://psantanna.com/files/DiD_JEL.pdf">4.2 of our </a><em><a href="https://psantanna.com/files/DiD_JEL.pdf">Journal of Economic Literature</a></em>.  I encourage you to read it closely. I&#8217;m still not quite ready yet to go through my empirical example to show you <strong>conclusively</strong> in my opinion about how to convincingly show you, without a simulation mind you, that correcting for covariates matter, but also <em>how</em> you correct for covariates matters just as much, but I am going to.  Just wanted to get that rant out of my system first!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p>]]></content:encoded></item><item><title><![CDATA[When should you control for covariates in your diff-in-diff design?]]></title><description><![CDATA[Today&#8217;s post will share some pictures from Berlin, but also pick up where an earlier post on covariates in diff-in-diff left off.]]></description><link>https://causalinf.substack.com/p/when-should-you-control-for-covariates</link><guid isPermaLink="false">https://causalinf.substack.com/p/when-should-you-control-for-covariates</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 17 Jun 2026 10:12:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!a8Mc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Today&#8217;s post will share some pictures from Berlin, but also pick up where an earlier post on covariates in diff-in-diff left off. This time, I just wanted to blend formalism with some thoughts I have.  I will show you the derivation for when covariate imbalance will break parallel trends and when it won&#8217;t. And then I&#8217;ll just share my opinions on critiquing the weakness of a diff in diff. So if you are interested in either check it out.</p><p>But I also flipped a coin  3x (or had python do it anyway), and it came up two heads out of three which means this&#8217;ll be paywalled. Thank you again for your support!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o0jr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o0jr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o0jr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!o0jr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!o0jr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14a707b9-41ac-49b1-a95b-c88f56ccfb6c_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>Leaving Berlin</h3><p>Guten tag! After four days and three nights in beautiful Berlin. I am heading to the airport where I&#8217;ll hop on a plane to Pisa &#8212; back to Tuscany! I just left there! &#8212; and then book it over to Lucca. I spent two weeks in Lucca, Italy last year and had such a nice time. I&#8217;ll be presenting my paper on discretion and the behavior of AI agents. Ask IMT about it and see if they&#8217;ll let you peek your head in!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-PLT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-PLT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-PLT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6918450,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-PLT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-PLT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F160f744d-e757-466a-9292-e1dac19425e5_5712x4284.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T0mg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T0mg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T0mg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2937682,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T0mg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!T0mg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445dedd5-60ee-43cf-a28e-c608753b0c62_4032x3024.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T50G!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T50G!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!T50G!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!T50G!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!T50G!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T50G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6286737,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T50G!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!T50G!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!T50G!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!T50G!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a6c479-8412-4050-9b8b-c5679e020f3c_5712x4284.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sZh0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sZh0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sZh0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:6992860,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sZh0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sZh0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9499d0b-1778-4a36-ba7d-f242b1d54085_5712x4284.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zwCn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zwCn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zwCn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2704427,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zwCn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zwCn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7b8e550c-ae24-4234-bcab-28edc105e5e7_4032x3024.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But I had an absolutely fantastic time at the Berlin School of Economics. I presented at DIW Berlin, and met new people. It was really amazing. We are talking about doing it again next year even.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a8Mc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a8Mc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a8Mc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg" width="1456" height="1941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1941,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2952844,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/202382072?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a8Mc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a8Mc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a074b9-7c93-4a3f-be0b-e48818e2d9f0_4032x3024.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But for now, I move on. I have two more things before I&#8217;m done and head to San Sebasti&#225;n in the Basque Country, known for its fabulous concha bay, amazing food and synthetic control. This weeks it&#8217;s IMT in Lucca, and then starting this weekend, Belgium, to KU Leuven. </p><p>But let me pause there, because what I want to do now is pick up on a substack from last week and show you formally the situations where it is mandatory to include coverages in a difference-in-differences. </p><p>The core reason is that you need the covariates to satisfy conditional parallel trends, which we discuss in section 4 of our JEL. There&#8217;s three separate bias terms though. And they are:</p><ol><li><p>The covariates you need to satisfy conditional parallel trends are imbalanced between treatment and control. </p></li><li><p>Heterogenous treatment effects across the dimensions of those covariates.</p></li><li><p>Conditional parallel trends is based on time INVARIANT covariates.</p></li></ol><div><hr></div><h3>Selection on levels versus selection on trends </h3><p>It&#8217;s quite common to hear someone say that they don&#8217;t need to control for covariates because everything that determines the outcome that doesn&#8217;t change over time gets deleted with the first difference. Or, put another way, it&#8217;s getting absorbed in the unit fixed effect.</p><p>But this is not accurate. Diff-in-diff is robust to variables that determine Y(0), the level of the outcome, but recall the bias of diff-in-diff: it is not based on level differences. It is based on trend differences in Y(0).</p><p>Thus if you need them to satisfy conditional parallel trends, then of course deleting them won&#8217;t help. You&#8217;ll need to figure out a way to keep them in.</p><div><hr></div><h3>Imbalance in covariates with changing returns on Y(0) over time</h3><p>Well related to that time invariant case is the more general problem: imbalance. And this time I want to show you formally what happens, as last time it was only a simple numerical example. But I enjoy working from the regression equation to the formal depiction of the problem and I bet others do as well.</p><p>Let&#8217;s start out with a two people model. Since we are including covariates, we cannot simply write it down as four averages and three subtractions, so let&#8217;s instead write it down as a two way fixed effects regression with additive covariates to illustrate the problem with &#8220;changing returns to the covariate over time&#8221;.  Here is that regression in the first period, period 1.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Y(0)_{1,i} = \\alpha_i + \\tau_1 + \\beta_1 X_{1,i} + \\varepsilon_{1,i} &quot;,&quot;id&quot;:&quot;HEYBHXRFVW&quot;}" data-component-name="LatexBlockToDOM"></div><p>And here it is in period 2.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Y(0)_{2,i} = \\alpha_i + \\tau_t + \\beta_2 X_{2,i} + \\varepsilon_{2,i}&quot;,&quot;id&quot;:&quot;PFZEVGIXQW&quot;}" data-component-name="LatexBlockToDOM"></div><p>So notice that I put subscripts 1 and 2 on \beta. What does that mean? That means that the effect in period 1, \beta_1, may or may not be what it became later in period 2, \beta_2.</p>
      <p>
          <a href="https://causalinf.substack.com/p/when-should-you-control-for-covariates">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Vertical regression and selection bias in diff-in-diff (plus some pictures of Pisa and Stresa Italy)]]></title><description><![CDATA[First part of this is pictures of Italy &#8212; namely Pisa where I was first of the week and now Stresa on Lake Maggiore where I am now.]]></description><link>https://causalinf.substack.com/p/vertical-regression-and-selection</link><guid isPermaLink="false">https://causalinf.substack.com/p/vertical-regression-and-selection</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Fri, 12 Jun 2026 09:54:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!O8Jk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff900b2ea-87eb-4eb7-a6a8-1a5d2c77b511_4032x3024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>First part of this is pictures of Italy &#8212; namely Pisa where I was first of the week and now Stresa on Lake Maggiore where I am now.  The second part is about parallel trends and how it is actually just another form of selection bias, which is to say, it is a gap in expected Y(0) only this time it is the gap in expected first differences. And I flipped a&#8230;</em></p>
      <p>
          <a href="https://causalinf.substack.com/p/vertical-regression-and-selection">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Diff-in-diff can be written down six ways!]]></title><description><![CDATA[The other day I wrote a short (for me) substack post about when covariate imbalance across treatment and control will mechanically break parallel trends.]]></description><link>https://causalinf.substack.com/p/diff-in-diff-can-be-written-down</link><guid isPermaLink="false">https://causalinf.substack.com/p/diff-in-diff-can-be-written-down</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Thu, 04 Jun 2026 05:55:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4MAM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F541fd776-70a8-481d-8ed1-d4a30adf6000_567x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The other day I wrote a short (for me) substack post about when covariate imbalance across treatment and control will mechanically break parallel trends. Before I move into covariates, I wanted to just lay out some things connecting diff-in-diff to regressions. I want to because it&#8217;ll make my discussion of covariates and bias easier. </p><p>So while this will &#8230;</p>
      <p>
          <a href="https://causalinf.substack.com/p/diff-in-diff-can-be-written-down">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Should I Include Covariates in Diff-in-Diff?]]></title><description><![CDATA[I have heard the following enough times that it has registered.]]></description><link>https://causalinf.substack.com/p/should-i-include-covariates-in-diff</link><guid isPermaLink="false">https://causalinf.substack.com/p/should-i-include-covariates-in-diff</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Mon, 01 Jun 2026 12:50:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OEaC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have heard the following enough times that it has registered.  And it happens among people who are usually fairly seasoned researchers.  So both the frequency and the speaker has made me think it&#8217;s probably a common enough belief.  And that is this:</p><blockquote><p>If I include covariates, and my diff-in-diff estimates change, then I do not believe the diff-in-diff estimates.</p></blockquote><p>It comes in many forms, but that&#8217;s usually it in a nutshell.  And today I want to just write what is probably going to be the first of a few substacks on it, but I&#8217;m going to try and be brief, which will require doing a couple of these.  But first, I flipped a coin 3 times, it came up head all three times, and therefore this will be paywalled (eventually below it will be).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dX3X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dX3X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dX3X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/caceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19591,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/200111788?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dX3X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!dX3X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcaceec1e-ea11-40d9-bf0f-8dab36726555_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Thanks again for your support!  If you&#8217;re dying to learn more about the importance of including covariates in diff-in-diff, then consider becoming a paying subscriber!  At $5/month, which is the absolute bare minimum Substack allows me to charge, it&#8217;s a steal!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>Why do you include covariates in diff-in-diff?</h3><p>It is well known that diff-in-diff has one key assumption called parallel trends.  And if you satisfy it, you don&#8217;t need to include any covariates as controls.  Let me start with an illustration of what it means to satisfy parallel trends.  Our outcome will be earnings, and I will have compare college educated workers (our treatment group) with high school only workers (out control group). We will represent untreated potential outcome as Y(0) and the treated outcome as Y(1), and therefore a treatment effect as Y(1) - Y(0).  </p><p>First, let&#8217;s say that men&#8217;s high school only earnings grows +10 a year, but female&#8217;s high school only earnings grow +8 a year (euros, dollars, pounds, anything).  We can write this as: </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Y_{it}(0)\n=\n\\alpha\n+\n10t \\cdot M_i\n+\n8t \\cdot (1-M_i)\n+\n\\varepsilon_{it}&quot;,&quot;id&quot;:&quot;URLVLHSSHL&quot;}" data-component-name="LatexBlockToDOM"></div><p>where <em>M</em> is a dummy variable equalling 1 if biologically male and 0 if biological female, <em>alpha</em> is a level constant that can be different for males and females if we wanted, and the <em>epsilon</em> is in expectation zero.  Hence when <em>M=1</em>, then <em>E[Y(0)] </em> grows at a rate of 10, and when <em>M=0</em>, then <em>E[Y(0)]</em> grows at a rate of 8. Notice that this is an outcome model.  It states that there is a &#8220;return&#8221; to being a male, a &#8220;return&#8221; to being a female, but that it is not the same.</p><p>But subtly, notice also that that return is the same whether you are treated or not.  If you are treated, then of course we never see <em>Y(0)</em>.  We only see <em>Y(1)</em>. But that just means that for college educated workers, <em>Y(0)</em> is counterfactual. </p><p>And in this outcome model, we are saying that high school only males have different trends than females &#8212; not just different levels (i.e., alpha) but trends.  </p><div><hr></div><h3>Balanced </h3><p>Second, let&#8217;s say that 75% of our college educated workers are males and 75% of our high school educated workers are males.  First, let&#8217;s take a first difference for everyone in the sample. </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\Delta Y_{it}(0)=8+2M_i+\\Delta\\varepsilon_{it}&quot;,&quot;id&quot;:&quot;QXGHXCAYGQ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>When we take expectations, we get:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;E[\\Delta Y_{it}(0)]=8+2M_i&quot;,&quot;id&quot;:&quot;TDKCCHWJLN&quot;}" data-component-name="LatexBlockToDOM"></div><p>Note that the <em>alpha</em> dropped out because it was a constant for each person <em>i</em>.  So even if we allowed males and females to make different baseline earnings, the first difference wipes them out. It just doesn&#8217;t wipe out the effect of sex on <em>trends</em>.  That&#8217;s the key here. </p><p>Now, recall I said that the two groups were balanced.  75% of the treatment group was male and 75% of the control group was male.  This means that we can can calculate using that equation the trend in average earnings for both groups, and since it does not depend on treatment status, the trend will be the same. And it will be 9.5.  And that is because 8+2 x 0.75 = 8 + 1.5 = 9.5. </p><p>So the two groups are balanced, they both grow at 9.5, and thus the college group and the high school group satisfy <em>unconditional parallel trends</em> and as a result, <em> you do not need to control for sex</em> in your diff-in-diff. You do not because every 2x2 is equal to this:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;2 \\times 2 = ATT + PT_{bias}&quot;,&quot;id&quot;:&quot;AUGTRDLRJG&quot;}" data-component-name="LatexBlockToDOM"></div><p>And since we just showed that there isn&#8217;t a parallel trends bias, the 2x2 is an unbiased and consistent estimate of the ATT.  Done.</p>
      <p>
          <a href="https://causalinf.substack.com/p/should-i-include-covariates-in-diff">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[TWFE Continuous Decompositions: The regression never changes. The question does.]]></title><description><![CDATA[The continuous-treatment DiD paper I&#8217;ve been working through for a series of posts has been primarily focused, not on the causal parameters and not on the estimators, but rather on two-way fixed effects (TWFE) and Frisch-Waugh-Lovell (FWL).]]></description><link>https://causalinf.substack.com/p/twfe-continuous-decompositions-the</link><guid isPermaLink="false">https://causalinf.substack.com/p/twfe-continuous-decompositions-the</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Thu, 23 Apr 2026 10:26:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OEaC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The continuous-treatment DiD paper I&#8217;ve been working through for a series of posts has been primarily focused, not on the causal parameters and not on the estimators, but rather on two-way fixed effects (TWFE) and Frisch-Waugh-Lovell (FWL).  I have been narrowly interested in the decomposition weights of TWFE that <a href="https://psantanna.com/files/CGBS_v4.pdf">Callaway, Goodman-Bacon and Sant&#8217;Anna (&#8230;</a></p>
      <p>
          <a href="https://causalinf.substack.com/p/twfe-continuous-decompositions-the">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[TWFE Continuous Diff-in-Diff Decomposition: Weights Applied To Outcomes]]></title><description><![CDATA[In the last couple of substacks, I walked us through the decomposition of the two-way fixed effects (TWFE) estimator when the treatment is continuous and the design is difference-in-differences. I even made a shiny app to illustrate it, which you can check out here]]></description><link>https://causalinf.substack.com/p/twfe-continuous-diff-in-diff-decomposition</link><guid isPermaLink="false">https://causalinf.substack.com/p/twfe-continuous-diff-in-diff-decomposition</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 22 Apr 2026 11:15:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aFRI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91ab828c-76e7-4271-a2ad-f740a179b9f6_3446x1707.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the last couple of substacks, I walked us through the decomposition of the two-way fixed effects (TWFE) estimator when the treatment is continuous and the design is difference-in-differences.<a href="https://www.scunning.com/baconplus/">  I even made a shiny app to illustrate it, which you can check out here</a>. We learned this formula:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\beta^{\\text{twfe}} \\;=\\; \\int_{d_L}^{d_U} \\underbrace{\\frac{(l - E[D]) \\cdot f_D(l)}{\\text{Var}(D)}}_{w^{\\text{lev}}(l)} \\cdot [m(l) - m(0)]\\, dl&quot;,&quot;id&quot;:&quot;BTNMRUEXKI&quot;}" data-component-name="LatexBlockToDOM"></div><p>This is going to be the core formula that I&#8217;m going to learn best even though it is only one of the four decompositions that the authors report in <a href="https://psantanna.com/files/CGBS_v4.pdf">their paper</a> (Table 1). </p><p>Notice then that the TWFE coefficient basically has four distinct pieces:</p><ol><li><p><strong>integrating over doses</strong>.  The TWFE is a weighted average over the support of the treatment dosage. That uses the density <em>f_D(l) </em>to map out support over <em>l</em>, the treatment dosage values. </p></li><li><p><strong>the weight</strong>.  There&#8217;s three pieces to the weight. There&#8217;s the re-centering of the dose, <em>l-E[D]</em>.  This takes a particular unit&#8217;s dosage and subtracts the mean over the entire sample. So maybe my dose is 0.1 but the mean 1, then the recentering would be 0.1-1 or -0.9. Notice there that the recentering introduces a negative value though &#8212; if you are below the mean, that is mechanically negative.  </p></li><li><p><strong>variance</strong>.  And last, the variance of the dose itself rescales the weight.  </p></li><li><p><strong>long differenced outcomes</strong>.  The last piece is <em>m(l)-m(0)</em>, where <em>m()</em> is the outcome of interest. </p></li></ol><p>Today what I want to do is fairly straightforward.  I want to use our dataset <a href="https://www.aeaweb.org/articles?id=10.1257/app.20140350">Lu &amp; Yu (2015)</a>, estimate two-way fixed effects, report that, and then reconstruct the same coefficient using the weighted average of the differenced <em>m(l)-m(0)</em>, where the weights are those scaled recentered doses I just mentioned.</p><p>But first, I flipped a coin three times, and once again, it came up heads twice.  As this is primarily a diff-in-diff post today, and less so a Claude Code post, I&#8217;m going to paywall it. But maybe today consider becoming a paying subscriber!   But as a teaser, here&#8217;s the video of the updated shiny app so that you can see what&#8217;s below.</p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;4080373e-4b3d-4675-9cc3-b595a37c3fe0&quot;,&quot;duration&quot;:null}"></div><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iES6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iES6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!iES6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!iES6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!iES6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iES6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/195008403?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iES6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!iES6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!iES6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!iES6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc8ddff5-1cd9-4183-b26a-b503c7546a8e_567x480.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>
      <p>
          <a href="https://causalinf.substack.com/p/twfe-continuous-diff-in-diff-decomposition">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Decomposing the TWFE regression coefficient with continuous treatment dosage using FWL]]></title><description><![CDATA[Part 1!]]></description><link>https://causalinf.substack.com/p/decomposing-the-twfe-regression-coefficient</link><guid isPermaLink="false">https://causalinf.substack.com/p/decomposing-the-twfe-regression-coefficient</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 15 Apr 2026 11:54:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!VSX9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Technically, today&#8217;s post has nothing to do with Claude Code. It&#8217;s purely algebraic Frisch-Waugh-Lovell, and thus because it&#8217;s about continuous treatment diff-in-diff, it fits under the diff-in-diff banner, and therefore is subject to my randomized paywall.  So I flipped a coin three times, it came up heads twice, therefore it&#8217;s paywalled. And so paywalled it shall be.  But first, let me tell you what you&#8217;re going to be missing if you are not a paying subscriber.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hPdh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hPdh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hPdh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/194251623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hPdh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!hPdh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F44de40eb-b2a1-4545-a62f-e40865cb6cc5_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;m going to walk us through the FWL decomposition of a TWFE regression coefficient.  The TWFE regression coefficient is a regression of some outcome onto unit and time fixed effects for two periods and a continuous dosage variable.  Think of the dose as the minimum wage.  We are not, in other words, just thinking of whether a municipality raises the minimum wage &#8212; which would be a binary treatment. We are thinking about <em>how much</em> which is a continuous measure of treatment.  So when I say &#8220;dosage&#8221;, I mean &#8220;a particular value of some treatment&#8221;.  This is the decomposition in Table 1 of <a href="https://psantanna.com/files/CGBS_v4.pdf">Callaway, Goodman-Bacon and Sant&#8217;Anna</a> (CBS).  </p><p>Thanks again for all your support. Today is the day that you may want to become a subscriber because today is the day that we try to figure out what&#8217;s under the hood for TWFE with continuous dose.  </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>TWFE Regression and FWL</h3><p>I&#8217;m going to be in this section going from a regression formula, which you can think of as the population regression from which we will get a best linear predictor (BLP) population coefficient estimated with two-way fixed effects (TWFE), to one of the four decompositions in Table 1 of CBS. This part is slow because I need to master this for my own sake, and I need the steps spelled out for me, and I&#8217;m using the substack to basically go slow. </p><p>So let&#8217;s start with the regression itself. </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;y_{i,t} = &#945;_i + &#946;^{twfe} D_i \\cdot Post_t + &#955;_t + &#949;_{i,t}&quot;,&quot;id&quot;:&quot;LJGYQDHOWN&quot;}" data-component-name="LatexBlockToDOM"></div><p>where <em>i</em> indexes units, <em>t</em> indexes pre and post, <em>D</em> is the continuous time-invariant dose, and <em>Post</em> is a dummy that turns on in period 2. The &#8220;time-invariant&#8221; is operationalizing a two-period diff-in-diff where at baseline, <em>Post=0</em>, it cancels out entirely, and it&#8217;s canceling out for the comparison unit too, <em>D=0</em>. But for treated units in the post period, the dose &#8220;turns on&#8221;.  They have more general extensions, but we start with this dosage group, <em>D</em>, times <em>T</em>, as that&#8217;s the equivalent of the <em>2x2</em> for those who know the modern diff-in-diff literature. </p><p>We start by using Frisch-Waugh-Lovell to residualize the beta coefficient (technically once calculated this becomes the BLP). You can see <a href="https://www.scunning.com/files/gov2001/slides/11a_ovb_interactions.pdf">my lectures on FWL</a> from earlier this week in my Gov 2001 class at Harvard on probability and statistics, also, if you want to see more about it, but FWL partials out covariates and turns a multi-variate regression slope into a univariate one.  In our case the covariates are the time and unit fixed effects. So with some algebra expressing various demeaning, that regression coefficient is:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;{\\;\\beta^{\\text{twfe}} \\;=\\; \\frac{\\sum_i (D_i - \\bar{D})(\\Delta y_i - \\overline{\\Delta y})}{\\sum_i (D_i - \\bar{D})^2} \\;=\\; \\frac{\\widehat{\\text{Cov}}(D_i,\\, \\Delta y_i)}{\\widehat{\\text{Var}}(D_i)}.\\;}&quot;,&quot;id&quot;:&quot;KGJGARXGUX&quot;}" data-component-name="LatexBlockToDOM"></div><p>That&#8217;s the BLP regression coefficient with a continuous <em>D x Post</em> interaction having been residualized by FWL into a univariate slope, like I said and it is mechanically nothing more than the OLS slope of the unit-level first difference on the dose. I don&#8217;t have a visual of this itself, but I do have a visualization of this with two covariates (creating a BLP that is a plane) that through FWL becomes a univariate slope from my Gov 2001 lecture slides this week, just so you can see. By allegory, the left picture here would be the multivariate regression coefficient from the first equation (note that the slope of the plane is the same for all covariate values, hence &#8220;holding constant&#8221;) and the picture on the right is the univariate slope itself.  All that FWL does is rip out the slope and recast it, but in our case it will also lead us to the decompositions we care about.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VSX9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VSX9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 424w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 848w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 1272w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VSX9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png" width="1456" height="828" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:828,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:180481,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/194251623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VSX9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 424w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 848w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 1272w, https://substackcdn.com/image/fetch/$s_!VSX9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11b2dc8a-fa08-4a06-80d9-579f0a785199_1509x858.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here is the decomposition I&#8217;m focused on from Table 1 of CBS. For today, I will <em>only</em> be targeting the &#8220;Levels&#8221; row though.  That&#8217;s row 2 for the positive dose weights (column 1) and the zero dose weights (column 2).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ItDs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ItDs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 424w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 848w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 1272w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ItDs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png" width="1456" height="522" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:522,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114484,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/194251623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!ItDs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 424w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 848w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 1272w, https://substackcdn.com/image/fetch/$s_!ItDs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42817433-19d7-4fb1-94c7-95c6b233da59_1629x584.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So, picking back up where I left off, to get to our levels decomposition, I start by conditioning on <em>D</em> by iterated expectations which causes the dose distribution to split into its point mass at zero, weight <em>P(D=0)</em>, and its continuous part on the density of <em>D </em>on the positive support range (note: dose cannot become negative; just only 0 or &gt;0).  </p>
      <p>
          <a href="https://causalinf.substack.com/p/decomposing-the-twfe-regression-coefficient">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Many Logits of Callaway and Sant'Anna and Why It Matters for Your Covariates]]></title><description><![CDATA[There&#8217;s a collection of thoughts crossing my mind that I&#8217;d like to share today.]]></description><link>https://causalinf.substack.com/p/the-many-logits-of-callaway-and-santanna</link><guid isPermaLink="false">https://causalinf.substack.com/p/the-many-logits-of-callaway-and-santanna</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 01 Apr 2026 11:40:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!gLy8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>There&#8217;s a collection of thoughts crossing my mind that I&#8217;d like to share today.  Hopefully this is useful for everyone.  Per my usual, since this is not a direct Claude Code post, I flip coins as to whether to immediately paywall it.  And it&#8217;s again two heads vs one tails, and therefore it&#8217;s paywalled, about 30-40% of the way down.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gLy8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gLy8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gLy8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1225f452-873f-4a21-be5b-70752d92ea87_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/192252476?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gLy8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!gLy8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1225f452-873f-4a21-be5b-70752d92ea87_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So thank you again for your support of me and this substack.  It is greatly appreciated.  </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3>Callaway and Sant&#8217;Anna Difference-in-Differences</h3><p>One of the most poplar new diff-in-diff estimators is Callaway and Sant&#8217;anna.  It has over 11,000 cites and in the APE data from the Social Catalyst Lab, it is the most common estimator chose by AI Agents. It&#8217;s used when there are multiple treatment periods or &#8220;staggered adoption&#8221;.</p><p>It&#8217;s a straightforward estimator in many ways.  Unlike two-way fixed effects, where all of the data is processed once using matrix calculations to solve for a single coefficient, CS as its often called estimates smaller building block coefficients, one at a time, and then takes weighted averages of them once you&#8217;ve completed doing them. These coefficients are called 2x2s and when assumptions hold they map onto something called the group-time ATT, or ATT(g,t). The ATT(g,t) is a population estimand, as they say, which in a sampling framework means if you had all the data, you&#8217;d calculate it like this:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bwAR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bwAR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 424w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 848w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 1272w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bwAR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png" width="692" height="155" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:155,&quot;width&quot;:692,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20222,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/192252476?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bwAR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 424w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 848w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 1272w, https://substackcdn.com/image/fetch/$s_!bwAR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F90eab37c-8cfa-4eca-a82a-9ae0d4ff51f8_692x155.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>The capital G is a dummy variable indicating whether you are in a group, <em>g</em>.  The &#8220;p-hat&#8221; is the propensity score (in this case estimated with logit), the C is a dummy indicating you are <em>not</em> treated.  And Y is the outcome.  </p>
      <p>
          <a href="https://causalinf.substack.com/p/the-many-logits-of-callaway-and-santanna">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Diff in Diff: Some Thoughts About Parallel Trends ]]></title><description><![CDATA[I won&#8217;t make this long.]]></description><link>https://causalinf.substack.com/p/diff-in-diff-some-thoughts-about</link><guid isPermaLink="false">https://causalinf.substack.com/p/diff-in-diff-some-thoughts-about</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Thu, 26 Mar 2026 11:32:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!uQ61!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I won&#8217;t make this long. Can I explain why parallel trends breaks down using a simple example about compositions of groups?  I&#8217;m going to try. I flipped a coin and it came up heads twice. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uQ61!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uQ61!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uQ61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19428,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/192194007?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uQ61!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!uQ61!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6863386e-724e-4b9a-87f4-257840dcc9df_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Thanks again everyone for your support! This is a labor of love and I hope you enjoy this post. It&#8217;ll be paywalled unless you&#8217;re a subscriber due to the randomization of the paywall I use for my non-Claude code series. Enjoy!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><p><strong>Broken Parallel Trends</strong></p><p>When there are two groups, one treated and one untreated, and two time periods, then we know the work of the control group in difference-in-differences. It is to impute the untreated potential outcome (ie the counterfactual) for the treatment group. And it does that using two things:</p><ol><li><p>It uses its own first difference to replace the counterfactual with its own observed value.</p></li><li><p>And it&#8217;s accurate if parallel trends holds.</p></li></ol><p>All the rest is details. They matter but if you have to distill it to something memorable that&#8217;s it. Take the first difference, and impute, which is legal to do if parallel trends.</p><p>So when is that not going to work? Well it won&#8217;t work if you don&#8217;t have a control group of course. That&#8217;s one thing. It won&#8217;t work if you don&#8217;t have two periods. And it won&#8217;t work if parallel trends is not true.</p><p>Let&#8217;s focus on the last one. Why is parallel trends broken in the first place?</p><p>You can really over explain this. Or let me say it another way. There are many ways to talk about this, all fruitful and needed, but I want to talk about it using covariates. I&#8217;ll use this as my example: biological men and biological women. </p>
      <p>
          <a href="https://causalinf.substack.com/p/diff-in-diff-some-thoughts-about">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Revisiting Falsification and Pre-trends in Diff-in-Diff]]></title><description><![CDATA[Today&#8217;s post is paywalled because I flipped three coins using python and it came up heads every time.]]></description><link>https://causalinf.substack.com/p/revisiting-falsification-and-pre</link><guid isPermaLink="false">https://causalinf.substack.com/p/revisiting-falsification-and-pre</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Thu, 15 Jan 2026 12:42:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!sbio!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb5aaf852-ea4f-429f-898c-4de003c5961c_1328x705.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Today&#8217;s post is paywalled because I flipped three coins using python and it came up heads every time. Please consider becoming a subscribing member of the substack where you can expect more overwritten articles about AI, pop culture, love, Claude Code and diff-in-diff, as well as pictures of me and my kids!</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yD7R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yD7R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yD7R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df0c092a-081c-4606-9a45-8b97d1a98110_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19591,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/184645201?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yD7R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!yD7R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf0c092a-081c-4606-9a45-8b97d1a98110_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://causalinf.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Scott's Mixtape Substack is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><p><strong>Obligatory introduction</strong></p><p>I regularly think about the purpose of pre-trends in diff-in-diff. And it&#8217;s probably because the new estimators allow one, via different syntax choices in econometricians&#8217; own papers and authored R and Stata code, to pick different ways to calculate the pre-trends.  So I thought I&#8217;d just post a short substack today, not so much arguing there is a right or wrong way to do these pre-trends (though I have a strong opinion), but to offer up my own beliefs about <em>why</em> we do pre-trend tests in the first place.</p><p><strong>Falsifiable Hypotheses</strong></p><p>I think, personally, that the reason we put up pre-trend tests in diff-in-diff is the same reason we look at things like covariate balance and re-estimating our models on the pre-treatment period (even outside of a diff-in-diff).  And that is because we are trying to provide evidence for the <em>identifying assumptions</em>.  I&#8217;m putting this under a heading of <em>falsifiability</em> because I want to link the somewhat a-theoretical approach to causal inference in the Rubin potential outcomes tradition with something more akin to falsifiability in the Popper-Friedman tradition of scientific theories.</p><p>Under the Popper-Friedman tradition of falsifiability being a key part of <em>any</em> scientific theory, what you are typically doing is looking &#8220;out of sample&#8221; at the logical consequences of the model, but empirically &#8212; not theoretically.  So if the comparative statics of the model does something like &#8220;and not only should you see effects here, they should be precisely something else over here&#8221;.  You can see that in Einstein&#8217;s theory of relativity even &#8212; his &#8220;model of reality&#8221; made an extremely precise prediction about the bending of light around large objects. And astronomers and physicists only managed to work this out several years after its publication with an ingenious natural experiment approach using an eclipse.  I wrote about this in the <a href="https://mixtape.scunning.com/09-difference_in_differences#abortion-legalization-and-long-term-gonorrhea-incidence">first edition of the Mixtape (in the triple diff subsection where I discuss the third chapter of my dissertation &#8212; the most illogical place to put this admittedly)</a>.  Check out this cool picture my friend Seth Hahne drew for me in the book too.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!coyC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!coyC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 424w, https://substackcdn.com/image/fetch/$s_!coyC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 848w, https://substackcdn.com/image/fetch/$s_!coyC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 1272w, https://substackcdn.com/image/fetch/$s_!coyC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!coyC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic" width="1456" height="840" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2585450,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/184645201?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!coyC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 424w, https://substackcdn.com/image/fetch/$s_!coyC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 848w, https://substackcdn.com/image/fetch/$s_!coyC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 1272w, https://substackcdn.com/image/fetch/$s_!coyC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F78d65153-8e82-4479-83a0-b77d022e6b85_7722x4456.heic 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>
      <p>
          <a href="https://causalinf.substack.com/p/revisiting-falsification-and-pre">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA["Diff-in-Diff: A Practitioner's Guide" JEL Github Repo is now up]]></title><description><![CDATA[For the first CodeChella in the summer of 2020, I had someone make this design to illustrate difference-in-differences concepts.]]></description><link>https://causalinf.substack.com/p/diff-in-diff-a-practitioners-guide</link><guid isPermaLink="false">https://causalinf.substack.com/p/diff-in-diff-a-practitioners-guide</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 10 Dec 2025 08:45:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ro82!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c7665ef-e40b-45ee-8a48-e5f685c6eec9_1412x1369.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For the first CodeChella in the summer of 2020, I had someone make this design to illustrate difference-in-differences concepts. See if you can spot the treatment, the missing Y(0), the 2&#215;2, the no-anticipation and parallel trends assumptions, the untreated comparison group. You might even find a little covariate imbalance hiding in there.</p><p>I mention this&#8230;</p>
      <p>
          <a href="https://causalinf.substack.com/p/diff-in-diff-a-practitioners-guide">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Dropping treated units from the control, or what does Justin Bieber have to do with avoiding vanilla TWFE?]]></title><description><![CDATA[I remember vaguely maybe 6-7 years ago struggling to understand fixed effects and diff in diff from a traditional perspective.]]></description><link>https://causalinf.substack.com/p/dropping-treated-units-from-the-control</link><guid isPermaLink="false">https://causalinf.substack.com/p/dropping-treated-units-from-the-control</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Fri, 01 Aug 2025 13:09:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OEaC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I remember vaguely maybe 6-7 years ago struggling to understand fixed effects and diff in diff from a traditional perspective.  I saw diff in diff as really about just comparing trends. Take two groups, calculate their trends, and subtract one from the other. Hence the name: difference in the differences.</p><p>It was then eye opening for me to see a table in <a href="https://www.amazon.com/Sex-Consequences-Abortion-Economics-Fertility-ebook/dp/B08K3V1RWK/ref=mp_s_a_1_1?crid=35UMQ2QU96R02&amp;dib=eyJ2IjoiMSJ9.1lNOJ96SVAON09kvkmb3Zg.3BSkp8KCfrVSkCI4mTWYNQ-p-lG86IZD47OiuFZg4t4&amp;dib_tag=se&amp;keywords=sex+and+consequences+levine&amp;qid=1754053394&amp;sprefix=sex+and+consewuences+levine%2Caps%2C140&amp;sr=8-1">&#8230;</a></p>
      <p>
          <a href="https://causalinf.substack.com/p/dropping-treated-units-from-the-control">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[A Design Argument to not use TWFE with Differential Timing Diff-in-Diff]]></title><description><![CDATA[Short post today, but I&#8217;m going to make a short argument in favor of the newer diff-in-diff estimators, not based on heterogenous treatment effects, but on the basis of design.]]></description><link>https://causalinf.substack.com/p/a-design-argument-to-not-use-twfe</link><guid isPermaLink="false">https://causalinf.substack.com/p/a-design-argument-to-not-use-twfe</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 30 Jul 2025 21:31:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OEaC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Short post today, but I&#8217;m going to make a short argument in favor of the newer diff-in-diff estimators, not based on heterogenous treatment effects, but on the basis of <strong>design</strong>. </p><p>When you take a design approach to causal inference, you are thinking very carefully ex ante about how you would try and replicate the randomized trial.  And in the randomized tr&#8230;</p>
      <p>
          <a href="https://causalinf.substack.com/p/a-design-argument-to-not-use-twfe">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Continuous diff in diff, regressions and the 2x2]]></title><description><![CDATA[This is more of a journal entry than a substack.]]></description><link>https://causalinf.substack.com/p/continuous-diff-in-diff-regressions</link><guid isPermaLink="false">https://causalinf.substack.com/p/continuous-diff-in-diff-regressions</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Mon, 07 Jul 2025 11:41:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0DJW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb24305a1-b951-41a7-8723-dce4b87b11d3_3088x2316.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is more of a journal entry than a substack. So your mileage may vary as to whether this is useful or even necessary. Wish us luck &#8212; I&#8217;ve rented a boat for us. We are both excited. I will be focused on being a safe dad and let her have most of the fun.</p>
      <p>
          <a href="https://causalinf.substack.com/p/continuous-diff-in-diff-regressions">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Some Stylized Facts About Econometrics Citations Patterns, Diff-in-Diff Citation Patterns and Software Downloads]]></title><description><![CDATA[Or, "How I couldn't go to sleep and stayed up to 2am doing fake research and rejected all my theories about something no one else but me probably cares about"]]></description><link>https://causalinf.substack.com/p/some-stylized-facts-about-econometrics</link><guid isPermaLink="false">https://causalinf.substack.com/p/some-stylized-facts-about-econometrics</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Fri, 27 Jun 2025 12:13:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6Rs4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd53e831a-a107-46b9-96aa-0280bfabee95_2602x1892.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It likely goes without saying, but I'll say it anyway as maybe some of the readers don&#8217;t know this.  But since 2018, a series of econometrics papers on difference-in-differences have absolutely exploded in popularity in economics. What started as a revision to practice has &#8212; separate that alone &#8212; become a peculiar citation phenomenon unlike anything I h&#8230;</p>
      <p>
          <a href="https://causalinf.substack.com/p/some-stylized-facts-about-econometrics">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Simple Power of The 2x2: Personal Reflection on Difference-in-Differences]]></title><description><![CDATA[This is a bit of a rambling post.]]></description><link>https://causalinf.substack.com/p/the-simple-power-of-the-2x2-personal</link><guid isPermaLink="false">https://causalinf.substack.com/p/the-simple-power-of-the-2x2-personal</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Mon, 31 Mar 2025 14:19:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Qcir!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16274662-af6b-4d56-aede-6c691f335f8e_567x480.heic" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This is a bit of a rambling post.  It starts out about diff-in-diff, but then gets personal, and then gets back to diff-in-diff. Which means I started out wanting to write one thing, and then wrote something else.  But I have made myself sick again, and just probably wrote through it this morning seeing stars in my mind. </em></p><p><em>And yet the discipline is to pay&#8230;</em></p>
      <p>
          <a href="https://causalinf.substack.com/p/the-simple-power-of-the-2x2-personal">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Long Differences, Short Gaps, and the Principle of Falsification in Event Studies]]></title><description><![CDATA[This is part 3 in a series I started back in December 2024 on event study construction under differential timing using tools like csdid, did_multiplegt, and did_imputation. You can read part 1 here and part 2 here. In this post, I want to make a straightforward argument: when you&#8217;re plotting event studies, you should use]]></description><link>https://causalinf.substack.com/p/long-differences-short-gaps-and-the</link><guid isPermaLink="false">https://causalinf.substack.com/p/long-differences-short-gaps-and-the</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 26 Mar 2025 15:01:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!jGD6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5711366e-8365-4794-8934-e42905a9e1e6_567x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is part 3 in a series I started back in December 2024 on event study construction under differential timing using tools like <strong>csdid</strong>, <strong>did_multiplegt</strong>, and <strong>did_imputation</strong>. You can read <a href="https://causalinf.substack.com/p/short-gap-versus-long-differences">part 1 here</a> and <a href="https://causalinf.substack.com/p/short-gap-versus-long-differences-693">part 2 here</a>.  In this post, I want to make a straightforward argument: when you&#8217;re plotting event studies, you should use <strong>long differences</strong>, not short gap&#8230;</p>
      <p>
          <a href="https://causalinf.substack.com/p/long-differences-short-gaps-and-the">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Walking Through Practitioners Guide (Baker, et al. 2025)]]></title><description><![CDATA[I thought I would start walking readers through our new paper, &#8220;Difference-in-Differences: A Practitioner&#8217;s Guide&#8221; by Baker, et al.]]></description><link>https://causalinf.substack.com/p/walking-through-practitioners-guide</link><guid isPermaLink="false">https://causalinf.substack.com/p/walking-through-practitioners-guide</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Mon, 24 Mar 2025 15:49:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/yzuj14hzCaw" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I thought I would start walking readers through our new paper, &#8220;<a href="https://arxiv.org/abs/2503.13323">Difference-in-Differences: A Practitioner&#8217;s Guide&#8221; by Baker, et al. (2025)</a>.  We are hoping that this paper may get accepted after a few rounds at the journal, and in the meantime, I&#8217;m going to just do some simple &#8220;open access&#8221; walk through.  I have not yet figured out how to make a post <em>per&#8230;</em></p>
      <p>
          <a href="https://causalinf.substack.com/p/walking-through-practitioners-guide">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Designing your diff in diff with a checklist, step 2: counting the treated counties ]]></title><description><![CDATA[This series is based on how a set of instructions I give my students when undertaking any studying using diff in diff.]]></description><link>https://causalinf.substack.com/p/designing-your-diff-in-diff-with</link><guid isPermaLink="false">https://causalinf.substack.com/p/designing-your-diff-in-diff-with</guid><dc:creator><![CDATA[scott cunningham]]></dc:creator><pubDate>Wed, 05 Mar 2025 08:49:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!4-YK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>This series is based on how a set of instructions I give my students when undertaking any studying using diff in diff. It&#8217;s a checklist which I find helps us all be on the same page, speaking the same language, go slow, and in the process, learn a lot of things even if the actual work has not yet been completed. </em></p><p><em>This substack is about step 2 in the checklist.</em> <em>At the end, I provide code for this step in Stata, R <strong>and python</strong> &#8212; which was a first for me, but Cosmos came through (for the most part) after much weeping and gnashing of teeth. Let&#8217;s start!</em></p><div><hr></div><p>I remember once having a conversation with someone talking about their study, which used diff in diff. I asked them how many units were treated in each cohort. They did not know the answer so we moved on.  With datasets so large, it didn&#8217;t surprise me that they didn&#8217;t seem to know that detail off the top of their head.  What surprised me was that they&#8217;d never sought to know before my question.  </p><p>Causal inference has a few core pieces that make it a different task than other forms of data science. The first is the use of potential outcomes to describe a target parameter. In the earlier steps, where I discussed weighting, that was important. But then there is the idea of the &#8220;treatment assignment mechanism&#8221;, or what had been called selection by others. Why are some units treated but not others? </p><p>I guess I see knowing who is treated and who is not treated and when to be a key step in thinning about the treatment assignment mechanism. If you can&#8217;t name them, if you can&#8217;t see them, and count them, then how can you make such basic arguments like the treatment assignment was random or selected on observables?</p><p>This step in the checklist is simple but it fits with a larger goal which is to ascertain the treatment assignment mechanism. One of our goals is to make a realistic claim as to why the units in your dataset did and did not get treated. And step 2 in this checklist will simply be you counting and reporting your treatment population.  By doing this, you can put a name to a face for when later you try to think carefully about the mechanisms assigning treatment. But also by doing this, you will create an exhibit you can share with coauthors that together will help you piece together basic facts about your study. So only thing we are going to do is make a table in Stata, R and python with the goal being that the creation of the table is automated so you don&#8217;t have to be copying and pasting stuff by hand. </p><p>But before we do, <a href="https://colab.research.google.com/drive/1hgGIY6inbM5HjdoCdI9imGtd4OmpIxub">let&#8217;s flip three coins and see how many come up heads to figure out whether the post will be paywalled.</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4-YK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4-YK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4-YK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png" width="567" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:567,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19591,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://causalinf.substack.com/i/158341097?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4-YK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 424w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 848w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 1272w, https://substackcdn.com/image/fetch/$s_!4-YK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c405e6c-12c9-4b4d-9fae-02263695c914_567x480.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Heads</strong>! So then this post will be paywalled, after a brief free window below. Thank you though everyone for supporting this substack. </p><div><hr></div><p><strong>What Will I Count?</strong></p><p>Sometimes different units adopt treatment at different times while some never did at all. Some even might have been already treated before our dataset began. Those are the only categories possible: already treated, never treated and eventually treated. Those three categories exhaustively describe all possible treatment categories.</p><p>When one jumps immediately into analysis, without figuring out which panel unit is in which of those three categories, they run the risk of driving fasters than their headlights can illuminate the road.  After all, already treated units as controls has the potential to create bias, so at minimum knowing how many of those little fellas are there is a good idea.  Or maybe there are obvious spillovers between treated and control and maybe that only becomes obvious when you see who will be potentially a control.  </p><p>I did a similar post as this one last June 2024, but in that post I focused on <strong>state-level crime data</strong> and the state roll out of concealed carry laws.  You can see below that old post which has a front page with the table in question.  As you can see, I was able to not just list all the treated states by cohort, I was also able to list their names.  That is part of the value, I think, of working with the most aggregated datasets &#8212; you can go beyond counting.  You can also name names.  </p><div class="digest-post-embed" data-attrs="{&quot;nodeId&quot;:&quot;e8515c84-e415-4c61-be9a-9c0510784fc6&quot;,&quot;caption&quot;:&quot;I am going to continue walking us through Pedro Sant&#8217;Anna&#8217;s difference-in-differences checklist (&#8220;Pedros checklist&#8221;) with a focus on step 2. It&#8217;s pretty straightforward, but still as I wanted to show code, I thought I&#8217;d make it just one substack entry rather than combine it with step 3. Step 2 is &#8220;Document how many units are treated in each cohort.&#8221;&quot;,&quot;cta&quot;:null,&quot;showBylines&quot;:true,&quot;showDescription&quot;:true,&quot;showImage&quot;:true,&quot;size&quot;:&quot;lg&quot;,&quot;isEditorNode&quot;:true,&quot;title&quot;:&quot;Step (2) of Pedro's DiD checklist: documenting how many units are in each cohort&quot;,&quot;publishedBylines&quot;:[{&quot;id&quot;:30226164,&quot;name&quot;:&quot;scott cunningham&quot;,&quot;bio&quot;:&quot;Economist and Professor at Baylor University, author of Causal Inference: the Mixtape. &quot;,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f4a358d-6ee9-492b-8c5d-92a11d68396a_768x1024.jpeg&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:100}],&quot;post_date&quot;:&quot;2024-06-16T10:43:22.663Z&quot;,&quot;cover_image&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2a08e98-94ab-4781-8bfe-5f711708a3e6_1854x973.heic&quot;,&quot;cover_image_alt&quot;:null,&quot;canonical_url&quot;:&quot;https://causalinf.substack.com/p/step-2-of-pedros-did-checklist-documenting&quot;,&quot;section_name&quot;:&quot;Pedro's Diff-in-Diff Checklist&quot;,&quot;video_upload_id&quot;:null,&quot;id&quot;:145596454,&quot;type&quot;:&quot;newsletter&quot;,&quot;reaction_count&quot;:24,&quot;comment_count&quot;:5,&quot;publication_id&quot;:null,&quot;publication_name&quot;:&quot;Scott's Mixtape Substack&quot;,&quot;publication_logo_url&quot;:&quot;https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F515eb550-03a3-427c-ac1b-7cf640e822d0_1067x1067.png&quot;,&quot;belowTheFold&quot;:true,&quot;youtube_url&quot;:null,&quot;show_links&quot;:null,&quot;feed_url&quot;:null}"></div><p>But at the county level, it&#8217;s not possible to make a table with all the county names and make it readable too, or at least I&#8217;m not sure how to do it myself. That&#8217;s because in the US, we have over 3,000 counties.  So if those treatment dates above are accurate, just listing the names of the counties is probably going to be impossible.  </p><p>So what I&#8217;ll be doing here is have a table that simply counts the number of treatment units by cohort, with the caveat that you may want to create a table of state names like I did there, too.  The main reason being states adopted concealed carry laws, and so selection happened at that level.   </p><p><strong>Building the Table</strong></p><p>The table should be so easy to read that it is nearly impossible to misinterpret. It is incredibly easy to make a table that is difficult to read and easily misinterpreted so our task is the opposite. It should stand on its own two feet and exist as its own object that someone could understand even without reading the paper, which means titles and labels are important.  Here&#8217;s what we want to include:</p>
      <p>
          <a href="https://causalinf.substack.com/p/designing-your-diff-in-diff-with">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>