<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>David Hall</title>
<link>https://econdavidhall.com/posts.html</link>
<atom:link href="https://econdavidhall.com/posts.xml" rel="self" type="application/rss+xml"/>
<description>David&#39;s Blog and Academic Site</description>
<generator>quarto-1.7.32</generator>
<lastBuildDate>Fri, 01 May 2026 07:00:00 GMT</lastBuildDate>
<item>
  <title>Synthetic Control With One Outcome and Many Outcomes</title>
  <link>https://econdavidhall.com/posts/multiple_outcome_scm/</link>
  <description><![CDATA[ 




<section id="synthetic-control-with-multiple-outcomes" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="synthetic-control-with-multiple-outcomes"><span class="header-section-number">1</span> Synthetic Control with Multiple Outcomes</h2>
<section id="can-it-be-useful-for-you" class="level3" data-number="1.1">
<h3 data-number="1.1" class="anchored" data-anchor-id="can-it-be-useful-for-you"><span class="header-section-number">1.1</span> Can it be useful for you?</h3>
<p>I recently presented a paper using the synthetic control method to understand the impact of a California policy. I received a lot of great feedback–even if the feedback made me understand how far I have to go as a presenter, as an economist, and with this paper in particular–and one of the comments was that my synthetic controls had somewhat poor pre-period fits. This is actually quite rare for synthetic controls; in fact, the issue most people point out is that (especially when we have long pre-periods), SCM has a tendency to overfit. Regardless, we got into a discussion of how to alleviate any concerns folks would have over my method. I have multiple <em>related</em> outputs (i.e.&nbsp;a factor model might find some strong common factors across the outcomes), and we discussed what would happen if we used a multiple-outcome synthetic control.</p>
<p>As I learn more about this method, I thought it would be best to write about it. This helps me, selfishly, because I have to feel somewhat confident before putting this on my website. I also thought it might be good to get an overview from someone less statistically nuanced. I might end up putting together a presentation on this for my graduate group brown bag and, if so, will post that here.</p>
<p>This post is meant to be a setup note on the difference between the standard synthetic control method in <a href="https://economics.mit.edu/sites/default/files/publications/Synthetic%20Control%20Methods.pdf">Abadie, Diamond, and Hainmueller (2010)</a> and the newer multi-outcome extensions in <a href="https://doi.org/10.1093/ectj/utag005">Tian, Lee, and Panchenko (2026)</a> and <a href="https://arxiv.org/abs/2311.16260">Sun, Ben-Michael, and Feller (2025)</a>. The goal is not to cover every identification result, but to write down what changes in the implementation. It would be good, prior to presenting this, to briefly go over the proofs in the texts to understand any changes made to our typical assumptions, though they do not change <em>all that</em> much.</p>
</section>
</section>
<section id="setup-and-notation" class="level2" data-number="2">
<h2 data-number="2" class="anchored" data-anchor-id="setup-and-notation"><span class="header-section-number">2</span> Setup and Notation</h2>
<p>Suppose we observe <img src="https://latex.codecogs.com/png.latex?J+1"> units over <img src="https://latex.codecogs.com/png.latex?T"> periods. Unit <img src="https://latex.codecogs.com/png.latex?i=1"> is WOLG, the treated unit. The donor units are indexed by <img src="https://latex.codecogs.com/png.latex?j=2,%5Cdots,J+1">. Treatment begins after period <img src="https://latex.codecogs.com/png.latex?T_0">, so there are <img src="https://latex.codecogs.com/png.latex?T_0"> pre-treatment periods and <img src="https://latex.codecogs.com/png.latex?T_1%20=%20T%20-%20T_0"> post-treatment periods.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?Y_%7Bit%7D(0)"> denote the untreated potential outcome for unit <img src="https://latex.codecogs.com/png.latex?i"> at time <img src="https://latex.codecogs.com/png.latex?t">, and let <img src="https://latex.codecogs.com/png.latex?Y_%7Bit%7D(1)"> denote the treated potential outcome. For the treated unit, we observe</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY_%7B1t%7D%0A=%0A%5Cbegin%7Bcases%7D%0AY_%7B1t%7D(0),%20&amp;%20t%20%5Cleq%20T_0,%20%5C%5C%0AY_%7B1t%7D(1),%20&amp;%20t%20%3E%20T_0.%0A%5Cend%7Bcases%7D%0A"></p>
<p>For donor units, which are never treated, we observe <img src="https://latex.codecogs.com/png.latex?Y_%7Bjt%7D=Y_%7Bjt%7D(0)"> for all <img src="https://latex.codecogs.com/png.latex?t">. The missing object is the post-treatment untreated path for the treated unit:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY_%7B1t%7D(0)%0A%5Cqquad%0A%5Ctext%7Bfor%20%7D%20t%20=%20T_0+1,%5Cdots,T.%0A"></p>
<p>Synthetic control estimates this missing path using a weighted average of donor units:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7BY%7D_%7B1t%7D(0)%0A=%0A%5Csum_%7Bj=2%7D%5E%7BJ+1%7D%0A%5Chat%7Bw%7D_j%20Y_%7Bjt%7D.%0A"></p>
<p>The weights live on the simplex</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CDelta_J%0A=%0A%5Cleft%5C%7B%0Aw%20%5Cin%20%5Cmathbb%7BR%7D%5EJ:%0Aw_j%20%5Cgeq%200,%5C%0A%5Csum_%7Bj=2%7D%5E%7BJ+1%7D%20w_j%20=%201%0A%5Cright%5C%7D.%0A"></p>
<p>The intuition: we are just choosing the best weights to match the pre-treatment outcome while restricting the weights to be non-negative and sum to one. So if you are tired of reading up on difference-in-differences and worrying about negative weights, fear not.</p>
</section>
<section id="standard-synthetic-control" class="level2" data-number="3">
<h2 data-number="3" class="anchored" data-anchor-id="standard-synthetic-control"><span class="header-section-number">3</span> Standard Synthetic Control</h2>
<p>If we match only on the pre-treatment outcome path (something worth being careful about; check out this <a href="https://doi.org/10.1002/pam.22206">cherry-picking article</a>), the standard synthetic control problem chooses donor weights that make the pre-treatment treated outcome look as close as possible to the weighted donor outcome path:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Csum_%7Bt=1%7D%5E%7BT_0%7D%0A%5Cleft(%0AY_%7B1t%7D%0A-%0A%5Csum_%7Bj=2%7D%5E%7BJ+1%7D%20w_j%20Y_%7Bjt%7D%0A%5Cright)%5E2.%0A"></p>
<p>In matrix form, define</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY_%7B1,%5Ctext%7Bpre%7D%7D%0A=%0A%5Cbegin%7Bbmatrix%7D%0AY_%7B11%7D%5C%5C%0A%5Cvdots%5C%5C%0AY_%7B1T_0%7D%0A%5Cend%7Bbmatrix%7D,%0A%5Cqquad%0AY_%7B0,%5Ctext%7Bpre%7D%7D%0A=%0A%5Cbegin%7Bbmatrix%7D%0AY_%7B21%7D%20&amp;%20%5Ccdots%20&amp;%20Y_%7BJ+1,1%7D%5C%5C%0A%5Cvdots%20&amp;%20%5Cddots%20&amp;%20%5Cvdots%5C%5C%0AY_%7B2T_0%7D%20&amp;%20%5Ccdots%20&amp;%20Y_%7BJ+1,T_0%7D%0A%5Cend%7Bbmatrix%7D.%0A"></p>
<p>Then the same problem is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0AY_%7B1,%5Ctext%7Bpre%7D%7D%0A-%0AY_%7B0,%5Ctext%7Bpre%7D%7Dw%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>With the dimensions written underneath, something I tend to do since my econometrics class with George Evans who always paid particular attention to this, the implementation object is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0A%5Cunderset%7BT_0%5Ctimes%201%7D%7BY_%7B1,%5Ctext%7Bpre%7D%7D%7D%0A-%0A%5Cunderset%7BT_0%5Ctimes%20J%7D%7BY_%7B0,%5Ctext%7Bpre%7D%7D%7D%0A%5Cunderset%7BJ%5Ctimes%201%7D%7Bw%7D%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>Once we have <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bw%7D">, the period-specific treatment effect estimate is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7B%5Ctau%7D_%7B1t%7D%0A=%0AY_%7B1t%7D%0A-%0A%5Csum_%7Bj=2%7D%5E%7BJ+1%7D%0A%5Chat%7Bw%7D_jY_%7Bjt%7D,%0A%5Cqquad%0At=T_0+1,%5Cdots,T.%0A"></p>
<p>The average post-treatment effect is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7B%5Ctau%7D%0A=%0A%5Cfrac%7B1%7D%7BT_1%7D%0A%5Csum_%7Bt=T_0+1%7D%5E%7BT%7D%0A%5Chat%7B%5Ctau%7D_%7B1t%7D.%0A"></p>
<p>Then you can get into placebo inference, or there is some work on <a href="https://arxiv.org/pdf/1812.10820v6">t-statistics for SCM</a> I haven’t quite read up on too much.</p>
</section>
<section id="why-multiple-outcomes-help" class="level2" data-number="4">
<h2 data-number="4" class="anchored" data-anchor-id="why-multiple-outcomes-help"><span class="header-section-number">4</span> Why Multiple Outcomes Help</h2>
<p>Standard synthetic control can fit the pre-treatment path very tightly, especially when there are many donor units relative to the number of pre-treatment periods. That can be useful, but it also creates an overfitting concern: the weights can match noise in one outcome rather than the common structure that generates the untreated path. One of the first things we discuss in econometrics courses is that errors exist–we will never be able to model everything. Synthetic control sometimes tries to be an overzealous student in that regard.</p>
<p>The multiple-outcome idea is to use related outcomes to discipline the weight-selection problem. Instead of finding weights that only match one outcome, we estimate a common set of weights that performs well across several outcome series. In the language of the newer papers, this can help focus the fit on shared factors rather than outcome-specific noise.</p>
</section>
<section id="multi-outcome-scm-two-implementations" class="level2" data-number="5">
<h2 data-number="5" class="anchored" data-anchor-id="multi-outcome-scm-two-implementations"><span class="header-section-number">5</span> Multi-Outcome SCM: Two Implementations</h2>
<p>Now suppose there are <img src="https://latex.codecogs.com/png.latex?m"> outcomes. Let</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY_%7Bitk%7D%0A"></p>
<p>denote outcome <img src="https://latex.codecogs.com/png.latex?k"> for unit <img src="https://latex.codecogs.com/png.latex?i"> in period <img src="https://latex.codecogs.com/png.latex?t">, where <img src="https://latex.codecogs.com/png.latex?k=1,%5Cdots,m">. The main implementation change is that we still want one donor weight vector <img src="https://latex.codecogs.com/png.latex?w">, but we use multiple outcomes to choose it.</p>
<p>There are two main ways that we can do this. The first is probably what you were initially considering when you found out people did multiple-outcome synthetic control: find the weights that minimize the distance of a whole host of outcomes. The second is an averaging method that, frankly, sounded odd to me at first but has some perks that I will go over.</p>
<section id="way-1-concatenation" class="level3" data-number="5.1">
<h3 data-number="5.1" class="anchored" data-anchor-id="way-1-concatenation"><span class="header-section-number">5.1</span> Way 1: Concatenation</h3>
<p>The concatenation approach stacks the pre-treatment outcome paths on top of one another. For the treated unit,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY%5EC_%7B1,%5Ctext%7Bpre%7D%7D%0A=%0A%5Cbegin%7Bbmatrix%7D%0AY_%7B1,%5Ctext%7Bpre%7D,1%7D%5C%5C%0A%5Cvdots%5C%5C%0AY_%7B1,%5Ctext%7Bpre%7D,m%7D%0A%5Cend%7Bbmatrix%7D,%0A"></p>
<p>and for the donor units,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AY%5EC_%7B0,%5Ctext%7Bpre%7D%7D%0A=%0A%5Cbegin%7Bbmatrix%7D%0AY_%7B0,%5Ctext%7Bpre%7D,1%7D%5C%5C%0A%5Cvdots%5C%5C%0AY_%7B0,%5Ctext%7Bpre%7D,m%7D%0A%5Cend%7Bbmatrix%7D.%0A"></p>
<p>The minimization problem becomes</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%5E%7BC%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0AY%5EC_%7B1,%5Ctext%7Bpre%7D%7D%0A-%0AY%5EC_%7B0,%5Ctext%7Bpre%7D%7Dw%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>With dimensions, the same object is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%5E%7BC%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0A%5Cunderset%7BmT_0%5Ctimes%201%7D%7BY%5EC_%7B1,%5Ctext%7Bpre%7D%7D%7D%0A-%0A%5Cunderset%7BmT_0%5Ctimes%20J%7D%7BY%5EC_%7B0,%5Ctext%7Bpre%7D%7D%7D%0A%5Cunderset%7BJ%5Ctimes%201%7D%7Bw%7D%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>The practical meaning is simple: instead of asking the donor weights to match one <img src="https://latex.codecogs.com/png.latex?T_0">-length path, we ask them to match one longer <img src="https://latex.codecogs.com/png.latex?mT_0">-length object that contains all the pre-treatment outcome paths.</p>
<p>What’s the issue with this? Well, suppose I had a really noisy outcome or two. The weights can end up chasing that noise rather than the underlying structure of the model. At the same time, I think this method is quite intuitive, so if you do not have to worry about that, then this is maybe the safer route.</p>
</section>
<section id="way-2-average-or-index" class="level3" data-number="5.2">
<h3 data-number="5.2" class="anchored" data-anchor-id="way-2-average-or-index"><span class="header-section-number">5.2</span> Way 2: Average or Index</h3>
<p>The second approach first combines the outcomes into an average or index, then runs the usual synthetic control problem on that constructed outcome. Let <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7BY%7D_%7Bitk%7D"> be the normalized version of outcome <img src="https://latex.codecogs.com/png.latex?k">. Define</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Coverline%7BY%7D_%7Bit%7D%0A=%0A%5Cfrac%7B1%7D%7Bm%7D%0A%5Csum_%7Bk=1%7D%5E%7Bm%7D%0A%5Cwidetilde%7BY%7D_%7Bitk%7D.%0A"></p>
<p>Then construct <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BY%7D_%7B1,%5Ctext%7Bpre%7D%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BY%7D_%7B0,%5Ctext%7Bpre%7D%7D"> exactly as in the standard SCM setup, but using the averaged outcome:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%5E%7BA%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0A%5Coverline%7BY%7D_%7B1,%5Ctext%7Bpre%7D%7D%0A-%0A%5Coverline%7BY%7D_%7B0,%5Ctext%7Bpre%7D%7Dw%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>With dimensions, this is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7Bw%7D%5E%7BA%7D%0A=%0A%5Carg%5Cmin_%7Bw%5Cin%5CDelta_J%7D%0A%5Cleft%5C%7C%0A%5Cunderset%7BT_0%5Ctimes%201%7D%7B%5Coverline%7BY%7D_%7B1,%5Ctext%7Bpre%7D%7D%7D%0A-%0A%5Cunderset%7BT_0%5Ctimes%20J%7D%7B%5Coverline%7BY%7D_%7B0,%5Ctext%7Bpre%7D%7D%7D%0A%5Cunderset%7BJ%5Ctimes%201%7D%7Bw%7D%0A%5Cright%5C%7C%5E2.%0A"></p>
<p>The practical meaning is that the multiple outcomes enter before the SCM step. Once the average or index is built, the weight-selection problem looks like the original one-outcome SCM problem.</p>
<p>What I imagine will be the big hang-up for this method is the index or average used. You may have to defend it or show some robustness to other non-mean-based indices.</p>
</section>
</section>
<section id="normalization" class="level2" data-number="6">
<h2 data-number="6" class="anchored" data-anchor-id="normalization"><span class="header-section-number">6</span> Normalization</h2>
<p>One last thing that matters more than I initially wanted it to: the outcomes need to be put on comparable footing. Otherwise, stable level differences across units or outcomes can end up doing a lot of work in the optimization problem. The math is not being mean; it is just doing exactly what we asked it to do.</p>
<p>The normalization used in these papers is pretty simple. They use demeaned outcomes, where each unit-outcome series is centered by its own pre-treatment mean:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cdot%7BY%7D_%7Bitk%7D%0A=%0AY_%7Bitk%7D%0A-%0A%5Cfrac%7B1%7D%7BT_0%7D%0A%5Csum_%7Bs=1%7D%5E%7BT_0%7D%0AY_%7Bisk%7D.%0A"></p>
<p>So rather than matching on the raw level of each outcome, we are matching on movement relative to that unit’s own pre-period average. This is also why it is sometimes described as an intercept-shifted synthetic control. We let units differ by a stable level difference, but still ask the synthetic control to track the treated unit’s dynamics.</p>
<p>In practice, this means the concatenation or averaging step above is done with <img src="https://latex.codecogs.com/png.latex?%5Cdot%7BY%7D_%7Bitk%7D"> instead of <img src="https://latex.codecogs.com/png.latex?Y_%7Bitk%7D">. Then, when we construct the counterfactual for a specific outcome, we can add the treated unit’s pre-treatment mean back in:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7BY%7D_%7B1tk%7D(0)%0A=%0A%5Cbar%7BY%7D_%7B1%5Ccdot%20k%7D%0A+%0A%5Csum_%7Bj=2%7D%5E%7BJ+1%7D%0A%5Chat%7Bw%7D_j%5Cdot%7BY%7D_%7Bjtk%7D,%0A%5Cqquad%0A%5Cbar%7BY%7D_%7B1%5Ccdot%20k%7D%0A=%0A%5Cfrac%7B1%7D%7BT_0%7D%0A%5Csum_%7Bs=1%7D%5E%7BT_0%7D%0AY_%7B1sk%7D.%0A"></p>
<p>The short version: before estimating the weights, subtract each unit’s pre-treatment average for each outcome. This is not a separate research design choice so much as a practical step that keeps the multiple outcomes from turning into a contest of levels.</p>
</section>
<section id="matrix-size-comparison" class="level2" data-number="7">
<h2 data-number="7" class="anchored" data-anchor-id="matrix-size-comparison"><span class="header-section-number">7</span> Matrix Size Comparison</h2>
<p>So all in all, if you understand the base SCM well, it is a fairly simple jump to the multi-outcome methods described here.</p>
<p>TL;DR:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 13%">
<col style="width: 18%">
<col style="width: 18%">
<col style="width: 18%">
<col style="width: 18%">
<col style="width: 13%">
</colgroup>
<thead>
<tr class="header">
<th>Method</th>
<th style="text-align: right;">Outcomes Used For Weights</th>
<th style="text-align: right;">Treated Pre Matrix</th>
<th style="text-align: right;">Donor Pre Matrix</th>
<th style="text-align: right;">Weight Vector</th>
<th>Main Idea</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Standard SCM</td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?1"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?T_0%5Ctimes%201"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?T_0%5Ctimes%20J"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?J%5Ctimes%201"></td>
<td>Match one treated outcome path</td>
</tr>
<tr class="even">
<td>Multi-outcome concatenation</td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?m"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?mT_0%5Ctimes%201"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?mT_0%5Ctimes%20J"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?J%5Ctimes%201"></td>
<td>Match all outcome paths jointly</td>
</tr>
<tr class="odd">
<td>Multi-outcome average/index</td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?m"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?T_0%5Ctimes%201"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?T_0%5Ctimes%20J"></td>
<td style="text-align: right;"><img src="https://latex.codecogs.com/png.latex?J%5Ctimes%201"></td>
<td>Match an averaged/indexed outcome path</td>
</tr>
</tbody>
</table>
</section>
<section id="conclusion" class="level2" data-number="8">
<h2 data-number="8" class="anchored" data-anchor-id="conclusion"><span class="header-section-number">8</span> Conclusion</h2>
<p>When I have a working paper version of what I’m doing right now, after I implement the feedback I got before, I’ll post it and you can see the results for yourself. For the most part, my results are stable to whether I run many separate single-outcome SCMs or the two different types of multi-outcome SCMs.</p>


</section>

 ]]></description>
  <guid>https://econdavidhall.com/posts/multiple_outcome_scm/</guid>
  <pubDate>Fri, 01 May 2026 07:00:00 GMT</pubDate>
</item>
<item>
  <title>Synthetic Control Placebo Inference in Synthdid</title>
  <link>https://econdavidhall.com/posts/synthdid_placebo_2.24.26/</link>
  <description><![CDATA[ 




<section id="setup" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="setup"><span class="header-section-number">1</span> Setup</h2>
<p>The <a href="https://synth-inference.github.io/synthdid/index.html"><em>synthdid</em> package put out by David Hirshberg</a> is my go-to when it comes to running all things synthetic control. I find it very helpful for both synthetic controls (SC) and synthetic difference-in-differences (SDiD), and even comparing to a base TWFE specification. In a recent project I’ve been working on, typical DiD specifications seem not to capture pre-trends well and I’m getting noisy results. Part of the reason for this is that I am expecting some heterogeneity in results by-state. Instead of trying to run state-specific results, I found myself (with some advising by Ed Rubin) running synthetic controls. This has the advantage of a better pre-period match as well as being better able to visualize the trends in treated states.</p>
<p>As I began to run this, I realized that the synthdid package does not have a built-in way (and I double checked with Kyu Matuzawa) to run inference on syntetic control results. It <em>does</em> have built-in the Arkhangelsky et al.&nbsp;procedure which returns a standard error using the placebo method they derive, but it can only be used for the SDiD specification. See for yourself here:</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(synthdid)</span>
<span id="cb1-2"></span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'california_prop99'</span>)</span>
<span id="cb1-4">setup <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">panel.matrices</span>(california_prop99)</span>
<span id="cb1-5">tau.sc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sc_estimate</span>(setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Y, setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>N0, setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>T0)</span>
<span id="cb1-6"></span>
<span id="cb1-7">se <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">vcov</span>(tau.sc, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">method=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'placebo'</span>))</span>
<span id="cb1-8">se</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>        [,1]
[1,] 11.4213</code></pre>
</div>
<div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">t_stat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(tau.sc) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se</span>
<span id="cb3-2">p_val  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pnorm</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(t_stat)))</span>
<span id="cb3-3">p_val</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>           [,1]
[1,] 0.08583067</code></pre>
</div>
</div>
<p>The p-value I obtain here is off from the original estimate using random inference in the original Abadie et al.&nbsp;2010 paper which obtains a p-value of <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B39%7D%20%5Csim%200.026">. The standard error calculated requires a distributional assumption I think many of us are unwilling to make, or maybe that is just me worrying about what the referees would say were I to implement the above exercise. This would probably be a conservative way to obtain p-values anyhow, but still, I wanted to ensure that I can obtain the p-values using the random inference procedure described by <a href="https://economics.mit.edu/sites/default/files/publications/Synthetic%20Control%20Methods.pdf">Abadie Diamond and Hainmueller, 2010</a>.</p>
</section>
<section id="review" class="level2" data-number="2">
<h2 data-number="2" class="anchored" data-anchor-id="review"><span class="header-section-number">2</span> Review</h2>
<p>As a quick refresher for what we’re doing here, I’ll write in words what the random inference procedure we need to do is, then show you how to implement it with the assumption you’ve created a panel for your synthetic control already. I’m using the notation from the synthdid package in this case.</p>
<p>We observe one treated unit and <img src="https://latex.codecogs.com/png.latex?N_0"> donor units over <img src="https://latex.codecogs.com/png.latex?T"> periods. Let <img src="https://latex.codecogs.com/png.latex?T_0"> denote the number of pre-treatment periods and <img src="https://latex.codecogs.com/png.latex?T_1%20=%20T%20-%20T_0"> the number of post-treatment periods.</p>
<p>Let:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?Y_%7B1t%7D"> denote the outcome for the treated unit<br>
</li>
<li><img src="https://latex.codecogs.com/png.latex?Y_%7Bjt%7D"> denote the outcome for donor unit <img src="https://latex.codecogs.com/png.latex?j%20=%202,%20%5Cdots,%20N_0+1"></li>
</ul>
<section id="pre-treatment-outcomes" class="level3" data-number="2.1">
<h3 data-number="2.1" class="anchored" data-anchor-id="pre-treatment-outcomes"><span class="header-section-number">2.1</span> Pre-treatment Outcomes</h3>
<p>The treated unit’s pre-treatment outcome vector is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AX_1%20=%0A%5Cbegin%7Bpmatrix%7D%0AY_%7B11%7D%20%5C%5C%0A%5Cvdots%20%5C%5C%0AY_%7B1T_0%7D%0A%5Cend%7Bpmatrix%7D%0A"></p>
<p>The donor matrix of pre-treatment outcomes is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AX_0%20=%0A%5Cbegin%7Bpmatrix%7D%0AY_%7B21%7D%20&amp;%20%5Cdots%20&amp;%20Y_%7BN_0+1,1%7D%20%5C%5C%0A%5Cvdots%20&amp;%20%5Cddots%20&amp;%20%5Cvdots%20%5C%5C%0AY_%7B2T_0%7D%20&amp;%20%5Cdots%20&amp;%20Y_%7BN_0+1,T_0%7D%0A%5Cend%7Bpmatrix%7D%0A"></p>
</section>
<section id="weight-selection-problem" class="level3" data-number="2.2">
<h3 data-number="2.2" class="anchored" data-anchor-id="weight-selection-problem"><span class="header-section-number">2.2</span> Weight Selection Problem</h3>
<p>The synthetic control weights <img src="https://latex.codecogs.com/png.latex?w%20=%20(w_2,%20%5Cdots,%20w_%7BN_0+1%7D)'"> solve</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cmin_%7Bw%7D%0A%5Cquad%0A%5Csqrt%7B%0A%5Cleft(%20X_1%20-%20X_0%20w%20%5Cright)'%0AV%0A%5Cleft(%20X_1%20-%20X_0%20w%20%5Cright)%0A%7D%0A"></p>
<p>subject to</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Aw_j%20%5Cge%200%20%5Cquad%20%5Ctext%7Bfor%20all%20%7D%20j%0A"></p>
<p>and</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Csum_%7Bj=2%7D%5E%7BN_0+1%7D%20w_j%20=%201%0A"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?V"> is a positive semi-definite weighting matrix.</p>
</section>
<section id="synthetic-control-path" class="level3" data-number="2.3">
<h3 data-number="2.3" class="anchored" data-anchor-id="synthetic-control-path"><span class="header-section-number">2.3</span> Synthetic Control Path</h3>
<p>Given optimal weights <img src="https://latex.codecogs.com/png.latex?%5Chat%7Bw%7D">, the synthetic outcome for any period <img src="https://latex.codecogs.com/png.latex?t"> is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7BY%7D_%7B1t%7D%5E%7B%5Ctext%7Bsynth%7D%7D%0A=%0A%5Csum_%7Bj=2%7D%5E%7BN_0+1%7D%0A%5Chat%7Bw%7D_j%20Y_%7Bjt%7D%0A"></p>
</section>
<section id="treatment-effect" class="level3" data-number="2.4">
<h3 data-number="2.4" class="anchored" data-anchor-id="treatment-effect"><span class="header-section-number">2.4</span> Treatment Effect</h3>
<p>The treatment effect at time <img src="https://latex.codecogs.com/png.latex?t"> is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7B%5Ctau%7D_%7B1t%7D%0A=%0AY_%7B1t%7D%0A-%0A%5Chat%7BY%7D_%7B1t%7D%5E%7B%5Ctext%7Bsynth%7D%7D%0A"></p>
<p>The average post-treatment effect is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7B%5Ctau%7D%0A=%0A%5Cfrac%7B1%7D%7BT_1%7D%0A%5Csum_%7Bt=T_0+1%7D%5E%7BT%7D%0A%5Cleft(%0AY_%7B1t%7D%0A-%0A%5Chat%7BY%7D_%7B1t%7D%5E%7B%5Ctext%7Bsynth%7D%7D%0A%5Cright)%0A"> ### Inference</p>
<p>The idea behind the randomized inference procedure is to then assign treatment iteratively over each of the donor units and run the same synthetic control procedure. But, importantly, we do this to obtain not the average treatment effect but the mean-square prediction-error.</p>
<p>We can think of this as a numerical representation of how far the treated unit (and, in turn, each iterated donor unit when we pretend it is treated) varies from its synthetic control in the pre- and post-treatment periods. We want a nice pre-treatment fit. If the treatment we are estimating is non-random, we would also expect a large deviance from the post-treatment synthetic control. Taking the ratio of these gets us our RMSPE ratio which we then rank. The higher the rank, the more likely it is that our treated unit did not see deviation at random.</p>
<p>Formally, for each unit <img src="https://latex.codecogs.com/png.latex?i">, define the synthetic control gap</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Chat%7B%5Ctau%7D_%7Bit%7D%0A=%0AY_%7Bit%7D%0A-%0A%5Chat%7BY%7D_%7Bit%7D%5E%7B%5Ctext%7Bsynth%7D%7D.%0A"></p>
<p>We then compute the pre-treatment root mean squared prediction error:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Ctext%7BPre-RMSPE%7D_i%0A=%0A%5Csqrt%7B%0A%5Cfrac%7B1%7D%7BT_0%7D%0A%5Csum_%7Bt=1%7D%5E%7BT_0%7D%0A%5Chat%7B%5Ctau%7D_%7Bit%7D%5E2%0A%7D.%0A"></p>
<p>Similarly, we compute the post-treatment RMSPE:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Ctext%7BPost-RMSPE%7D_i%0A=%0A%5Csqrt%7B%0A%5Cfrac%7B1%7D%7BT_1%7D%0A%5Csum_%7Bt=T_0+1%7D%5E%7BT%7D%0A%5Chat%7B%5Ctau%7D_%7Bit%7D%5E2%0A%7D.%0A"></p>
<p>The object of interest is the ratio</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AR_i%0A=%0A%5Cfrac%7B%5Ctext%7BPost-RMSPE%7D_i%7D%7B%5Ctext%7BPre-RMSPE%7D_i%7D.%0A"></p>
<p>We compute this ratio for the true treated unit and then for each donor unit after iteratively assigning it treatment and re-running the synthetic control procedure.</p>
<p>Let <img src="https://latex.codecogs.com/png.latex?R_1"> denote the ratio for the actual treated unit and let <img src="https://latex.codecogs.com/png.latex?%5C%7BR_j%5C%7D_%7Bj=2%7D%5E%7BN_0+1%7D"> denote the ratios for each placebo unit.</p>
<p>The randomization-based p-value is simply the rank of the treated unit’s ratio among all possible assignments:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ap%0A=%0A%5Cfrac%7B%0A1%20+%20%5Csum_%7Bj=2%7D%5E%7BN_0+1%7D%0A%5Cmathbf%7B1%7D%0A%5C%7B%20R_j%20%5Cge%20R_1%20%5C%7D%0A%7D%7B%0A1%20+%20N_0%0A%7D.%0A"></p>
<p>Intuitively, if the treated unit’s post-treatment deviation is unusually large relative to its pre-treatment fit — compared to what we see when we pretend each donor was treated — then the p-value will be small.</p>
</section>
</section>
<section id="implementing-in-synthdid" class="level2" data-number="3">
<h2 data-number="3" class="anchored" data-anchor-id="implementing-in-synthdid"><span class="header-section-number">3</span> Implementing in synthdid</h2>
<section id="randomization-inference-abadie-style-in-space-placebos" class="level3" data-number="3.1">
<h3 data-number="3.1" class="anchored" data-anchor-id="randomization-inference-abadie-style-in-space-placebos"><span class="header-section-number">3.1</span> Randomization inference (Abadie-style in-space placebos)</h3>
<p>Once you have your synthetic control estimate, the key idea for inference is to <strong>re-run the exact same synthetic control procedure while pretending each donor unit was treated</strong>. This gives us a placebo distribution. If the true treated unit looks unusually “extreme” relative to those placebos, we interpret that as evidence the effect is unlikely to be due to chance.</p>
<p>The subtle but important point is that we don’t rank the raw ATT. Instead, following Abadie et al.&nbsp;(2010), we rank a <strong>fit-adjusted statistic</strong> based on prediction error:</p>
<ol type="1">
<li><p>Compute the synthetic control gap for unit (i): [ <em>{it} = Y</em>{it} - _{it}^{}. ]</p></li>
<li><p>Turn that into a pre-treatment RMSPE and post-treatment RMSPE: [ _i = , _i = . ]</p></li>
<li><p>Take the ratio: [ R_i = . ]</p></li>
</ol>
<p>Intuition: we want a good pre-period fit (small denominator), and if treatment mattered we should see a bigger post-period gap (large numerator). The ratio is a simple way to combine both.</p>
<p>To get a p-value, we compute (R_1) for the treated unit, then compute (R_j) for each donor unit (j) when we pretend it was treated. The p-value is just the rank:</p>
<p>[ p = . ]</p>
</section>
<section id="done-in-synthdid" class="level3" data-number="3.2">
<h3 data-number="3.2" class="anchored" data-anchor-id="done-in-synthdid"><span class="header-section-number">3.2</span> Done in synthdid</h3>
<p>Below is a minimal implementation that assumes you already have a <code>setup</code> object from <code>panel.matrices()</code>.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Assumes you already have: setup &lt;- panel.matrices(...)</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># setup$Y is (N x T), rownames(setup$Y) are unit names, setup$T0 is pre-period length.</span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># This loops over EVERY unit, treats it as "treated" by moving it to the last row,</span></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># runs sc_estimate, computes pre/post RMSE and MSPE ratios, and ranks California.</span></span>
<span id="cb5-5"></span>
<span id="cb5-6"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(synthdid)</span>
<span id="cb5-7"></span>
<span id="cb5-8">sc_placebo_inference <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(setup, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mspe"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmse"</span>)) {</span>
<span id="cb5-9">  stat <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">match.arg</span>(stat)</span>
<span id="cb5-10"></span>
<span id="cb5-11">  Y0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Y</span>
<span id="cb5-12">  T0 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>T0</span>
<span id="cb5-13">  TT <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ncol</span>(Y0)</span>
<span id="cb5-14">  units <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(Y0)</span>
<span id="cb5-15">  N <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(Y0)</span>
<span id="cb5-16"></span>
<span id="cb5-17">  out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb5-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unit =</span> units,</span>
<span id="cb5-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">att =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_mspe =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">post_mspe =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_rmse =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">post_rmse =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ratio_rmse =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ratio_mspe =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb5-26">  )</span>
<span id="cb5-27"></span>
<span id="cb5-28">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq_len</span>(N)) {</span>
<span id="cb5-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reorder Y so unit i is last (treated)</span></span>
<span id="cb5-30">    ord <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setdiff</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq_len</span>(N), i), i)</span>
<span id="cb5-31">    Y <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> Y0[ord, , drop <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>]</span>
<span id="cb5-32"></span>
<span id="cb5-33">    run <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> synthdid<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sc_estimate</span>(Y, N <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, T0)</span>
<span id="cb5-34">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>att[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(run)</span>
<span id="cb5-35"></span>
<span id="cb5-36">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Use the full donor weight vector (not summary(run)$controls display output).</span></span>
<span id="cb5-37">    w_full <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">attr</span>(run, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weights"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>omega</span>
<span id="cb5-38"></span>
<span id="cb5-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># synthetic path and gaps</span></span>
<span id="cb5-40">    y_synth <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">t</span>(w_full) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%*%</span> Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(N <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), , <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">drop =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>])</span>
<span id="cb5-41">    y_tr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(Y[N, ])</span>
<span id="cb5-42">    gap     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> y_tr <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y_synth</span>
<span id="cb5-43"></span>
<span id="cb5-44">    pre_mspe <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(gap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>T0]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb5-45">    post_mspe <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(gap[(T0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>TT]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb5-46">    pre_rmse <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(pre_mspe)</span>
<span id="cb5-47">    post_rmse <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(post_mspe)</span>
<span id="cb5-48"></span>
<span id="cb5-49">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>pre_mspe[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pre_mspe</span>
<span id="cb5-50">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>post_mspe[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> post_mspe</span>
<span id="cb5-51">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>pre_rmse[i]  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pre_rmse</span>
<span id="cb5-52">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>post_rmse[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> post_rmse</span>
<span id="cb5-53">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ratio_rmse[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> post_rmse <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pre_rmse</span>
<span id="cb5-54">    out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ratio_mspe[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> post_mspe <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pre_mspe</span>
<span id="cb5-55">  }</span>
<span id="cb5-56"></span>
<span id="cb5-57">  ratio_vec <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (stat <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mspe"</span>) out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ratio_mspe <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ratio_rmse</span>
<span id="cb5-58">  treated_unit <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Y)[setup<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>N0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb5-59">  R_treated <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> ratio_vec[out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>unit <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> treated_unit]</span>
<span id="cb5-60">  R_placebo <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> ratio_vec[out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>unit <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> treated_unit]</span>
<span id="cb5-61">  p_val <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(R_placebo <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> R_treated, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span></span>
<span id="cb5-62">    (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(R_placebo)))</span>
<span id="cb5-63"></span>
<span id="cb5-64">  table_ranked <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> out[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">order</span>(ratio_vec, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">decreasing =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), ]</span>
<span id="cb5-65">  table_ranked<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rank <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq_len</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(table_ranked))</span>
<span id="cb5-66">  rank_treated <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> table_ranked<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rank[table_ranked<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>unit <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> treated_unit]</span>
<span id="cb5-67"></span>
<span id="cb5-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb5-69">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">treated_unit =</span> treated_unit,</span>
<span id="cb5-70">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">statistic =</span> stat,</span>
<span id="cb5-71">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">R_treated =</span> R_treated,</span>
<span id="cb5-72">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rank_treated =</span> rank_treated,</span>
<span id="cb5-73">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p_val =</span> p_val,</span>
<span id="cb5-74">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">table =</span> table_ranked</span>
<span id="cb5-75">  )</span>
<span id="cb5-76">}</span>
<span id="cb5-77"></span>
<span id="cb5-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Example:</span></span>
<span id="cb5-79">setup <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">panel.matrices</span>(california_prop99)</span>
<span id="cb5-80">res <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sc_placebo_inference</span>(setup, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stat =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mspe"</span>)</span>
<span id="cb5-81">res[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"treated_unit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statistic"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_treated"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rank_treated"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_val"</span>)]</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>$treated_unit
[1] "California"

$statistic
[1] "mspe"

$R_treated
[1] 154.94

$rank_treated
[1] 3

$p_val
[1] 0.07692308</code></pre>
</div>
</div>
<p>The way the code is written is that the very last row in the panel object corresponds to the treated unit. So all we have to do is iterate the observations to the bottom. In other words, take the first observation, move to the bottom, and so on. Then we can use that to calculate the RMSE as we go along.</p>
<p>There <em>are</em> a few differences in the synthdid code that resulted in some differences in the ATT and p-value of the estimate I wrote here. Namely, there is something about ridge-type regularization that makes it so the SC doesn’t produce the same exact weights, and also I don’t include controls here which are in the original paper.</p>
<p>We can confirm this when using the tidysynth package, which has always felt fairly unintuitive to me, but is now making me feel as I look at it that I should’ve used that. Regardless, I feel good about writing a nice little piece on synthetic controls and knowing I can run this manually if computers were ever not a thing.</p>
<div class="cell">
<div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">require</span>(tidysynth)</span></code></pre></div>
<div class="cell-output cell-output-stderr">
<pre><code>Loading required package: tidysynth</code></pre>
</div>
<div class="cell-output cell-output-stderr">
<pre><code>Warning: package 'tidysynth' was built under R version 4.4.3</code></pre>
</div>
<div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smoking"</span>)</span>
<span id="cb10-2"></span>
<span id="cb10-3">smoking_out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span></span>
<span id="cb10-4">  smoking <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-5"></span>
<span id="cb10-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">synthetic_control</span>(</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome =</span> cigsale,</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unit    =</span> state,</span>
<span id="cb10-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time    =</span> year,</span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i_unit  =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"California"</span>,</span>
<span id="cb10-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">i_time  =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1988</span>,</span>
<span id="cb10-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">generate_placebos =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb10-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-14"></span>
<span id="cb10-15">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Outcome-only matching:</span></span>
<span id="cb10-16">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># use the pre-treatment outcome path (or a subset of pre-years) as predictors.</span></span>
<span id="cb10-17">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Here I include every pre-treatment year up through 1988.</span></span>
<span id="cb10-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">generate_predictor</span>(</span>
<span id="cb10-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">time_window =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1970</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1988</span>,</span>
<span id="cb10-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cigsale_pre =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(cigsale, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> T)</span>
<span id="cb10-21">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-22"></span>
<span id="cb10-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">generate_weights</span>(</span>
<span id="cb10-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">optimization_window =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1970</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1988</span>,</span>
<span id="cb10-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">margin_ipop =</span> .<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">02</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sigf_ipop =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bound_ipop =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span>
<span id="cb10-26">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb10-27"></span>
<span id="cb10-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">generate_control</span>()</span>
<span id="cb10-29"></span>
<span id="cb10-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(smoking_out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grab_significance</span>())</span></code></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code># A tibble: 6 × 8
  unit_name     type    pre_mspe post_mspe mspe_ratio  rank fishers_exact_pvalue
  &lt;chr&gt;         &lt;chr&gt;      &lt;dbl&gt;     &lt;dbl&gt;      &lt;dbl&gt; &lt;int&gt;                &lt;dbl&gt;
1 West Virginia Donor      13.6      351.        25.8     1               0.0256
2 Illinois      Donor       9.36     202.        21.6     2               0.0513
3 California    Treated    61.4     1004.        16.3     3               0.0769
4 Missouri      Donor      23.4      324.        13.8     4               0.103 
5 Indiana       Donor      34.8      453.        13.0     5               0.128 
6 South Dakota  Donor       6.92      70.2       10.1     6               0.154 
# ℹ 1 more variable: z_score &lt;dbl&gt;</code></pre>
</div>
</div>
<p>If you read this, thanks!</p>


</section>
</section>

 ]]></description>
  <guid>https://econdavidhall.com/posts/synthdid_placebo_2.24.26/</guid>
  <pubDate>Tue, 24 Feb 2026 08:00:00 GMT</pubDate>
</item>
<item>
  <title>The Newhouse Model of Nonprofit Hospitals</title>
  <link>https://econdavidhall.com/posts/Newhouse_9.5.25/</link>
  <description><![CDATA[ 




<section id="introduction" class="level2" data-number="1">
<h2 data-number="1" class="anchored" data-anchor-id="introduction"><span class="header-section-number">1</span> Introduction</h2>
<p>This post will discuss the theory and contributions of Newhouse’s 1970 model of nonprofit hospitals which can be found <a href="https://www.jstor.org/stable/1807855">here</a> I started reading up on this model after looking at the behavior of substance use disorder (SUD) treatment centers (TCs). You can see more about that in my <a href="../../series/TC_Ownership/index.html">TC Ownership series.</a> This is also part of an overarching — and building —- interest of mine: the non-profit healthcare institution. I’ve found myself revisiting <a href="https://www.sciencedirect.com/science/article/pii/S1574006400800347">Sloan’s chapter in the Handbook of Health Economics</a>.</p>
<p>I’m going to run through some quick motivation then go ahead and introduce/solve the model here. The Newhouse model was one of the first models of overall non-profits. It is much more simple to develop a model of for-profit firms, or even social planners or the individual, because the objective function of these agents is much more clear. For-profits maximize profit (duh), social planners might be trying to maximize tax revenue or the utility of all citizens and individuals maximize their own utility.</p>
<p>The Newhouse model differed in two main ways: first, a strong insight from this model is that the non-profit decision maker (DM) maximizes their utility over some quality-quantity measure. In his paper, Newhouse describes the motivation of the DM in regard to quantity by making the case that society is better off with increased consumption of hospital services, and so an altruistic DM clearly wants to increase overall consumption. Newhouse has this to say about why <em>quality</em> is in the maximand:</p>
<blockquote class="blockquote">
<p><em>To understand why the second element, quality, belongs in the maximand, it is necessary to examine the locus of decision making in a hospital. One characteristic of nonprofit hospitals is that usually control formally resides in a board of trustees or similar group. The board in turn appoints an administrator who is in charge of day-to-day decisions…… If the administrator is not to make a ‘profit,’ his performance cannot be judged by the profit criterion. Therefore, his salary and promotional chances must be a function of some other variable or variables. It seems plausible to assume that the prestige of the institution is prominent among these other variable…… Prestige, in turn, is affected by the size of the institution, but probably even more by the quality of the product produced.</em></p>
</blockquote>
<p>Newhouse goes on to discuss the medical staff’s role in maintaining a high level of quality as well. The issue then becomes how these two aspects of the maximand — quantity and quality of provided services — are weighted and measured. Solving the model from the perspective of the hospital administrator helps us answer this question.</p>
</section>
<section id="assumptions-of-the-model" class="level2" data-number="2">
<h2 data-number="2" class="anchored" data-anchor-id="assumptions-of-the-model"><span class="header-section-number">2</span> Assumptions of the Model</h2>
<p>We start off assuming that there exists a total cost function <img src="https://latex.codecogs.com/png.latex?F"> of quantity supplied <img src="https://latex.codecogs.com/png.latex?Q%5Es"> and quality supplied <img src="https://latex.codecogs.com/png.latex?K%5Es">.</p>
<p><span id="eq-totalcost"><img src="https://latex.codecogs.com/png.latex?%0ATC%20=%20F(Q%5Es,%20K%5Es)%0A%5Ctag%7B1%7D"></span></p>
<p>We also assume there is a function <img src="https://latex.codecogs.com/png.latex?G"> of quantity demanded, as a function of price (given) <img src="https://latex.codecogs.com/png.latex?P"> and quality demanded <img src="https://latex.codecogs.com/png.latex?K%5EP"></p>
<p><img src="https://latex.codecogs.com/png.latex?%0AQ%5Ed%20=%20G(P,%20K%5Ed)%0A"></p>
<p>s.t. <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cpartial%20Q%5Ed%7D%7B%5Cpartial%20P%7D%20%3C%200"> and <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cpartial%20Q%5Ed%7D%7B%5Cpartial%20K%5Ed%7D%20%3E%200"></p>
<p>We assume that non-profit firms make zero profit, thus <img src="https://latex.codecogs.com/png.latex?%5Cpi%20=%200%20%5Ciff%20TR%20=%20TC">. Since <img src="https://latex.codecogs.com/png.latex?TC%20=%20AC%5C*Q%20%5Ciff%20AC%20=%20F%20/%20Q%20=%20f%20(Q%5Es,%20K%5Es)">and $ TR = P Q$ (abusing notation of quantity and quality before establishing equilibrium conditions, sorry), and further assuming that we can solve for an inverse demand function <img src="https://latex.codecogs.com/png.latex?P%20=%20g(Q%5Ed,%20K)">, we have the setup for the breakevn condition which will allow us to <strong>solve for quantity as a function of price.</strong></p>
<p>In particular, we have:</p>
<p><span id="eq-breakeven"><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Baligned%7D%0AAC%20&amp;=%20f(Q%5Es,%20K%5Es)%20%5C%5C%0AP%20&amp;=%20g(Q%5Ed,%20K%5Ed)%20%5C%5C%0AQ%5Ed%20&amp;=%20Q%5Es%20=%20Q%20%5C%5C%0AK%5Ed%20&amp;=%20K%5Es%20=%20K%20%5C%5C%0AP%20&amp;=%20AC%0A%5Cend%7Baligned%7D%0A%5Ctag%7B2%7D"></span></p>
<p>which allows us to obtain equlibrium quality as a function of equilibrium quantity:</p>
<p><img src="https://latex.codecogs.com/png.latex?%20K%20=%20h(Q)"> This sets up the maximization problem, where both quality and quantity are part of the DM problem, and we can solve for them both assuming we havethe quantity-quality tradeoff.</p>
</section>
<section id="dm-problem" class="level2" data-number="3">
<h2 data-number="3" class="anchored" data-anchor-id="dm-problem"><span class="header-section-number">3</span> DM Problem</h2>
<p>The hospital administrator choose <img src="https://latex.codecogs.com/png.latex?K"> and <img src="https://latex.codecogs.com/png.latex?Q"> to maximizes the institutions utility. We subject this to the quantity-quality tradeoff which builds in the zero-profit/break-even condition already.</p>
<p><span id="eq-utility"><img src="https://latex.codecogs.com/png.latex?%0A%5Ctext%7Bmax%20%7D_%7BK,Q%7D%20V%20=%20U(K,%20Q)%20+%20%5Clambda(K%20-%20h(Q))%0A%5Ctag%7B3%7D"></span></p>
<p>we can then get first order conditions</p>
<p><span id="eq-foc-k"><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Cpartial%20%5Cmathcal%7BL%7D%7D%7B%5Cpartial%20K%7D:%20%5Cquad%20U_K(K,Q)%20+%20%5Clambda%20=%200%0A%5Ctag%7B4%7D"></span></p>
<p><span id="eq-foc-q"><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Cpartial%20%5Cmathcal%7BL%7D%7D%7B%5Cpartial%20Q%7D:%20%5Cquad%20U_Q(K,Q)%20-%20%5Clambda%5C,h'(Q)%20=%200%0A%5Ctag%7B5%7D"></span></p>
<p><span id="eq-foc-lambda"><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Cpartial%20%5Cmathcal%7BL%7D%7D%7B%5Cpartial%20%5Clambda%7D:%20%5Cquad%20K%20-%20h(Q)%20=%200%0A%5Ctag%7B6%7D"></span></p>
<p>We can then combine these: substitute <img src="https://latex.codecogs.com/png.latex?%5Clambda"> for <img src="https://latex.codecogs.com/png.latex?-U_K"> from Equation&nbsp;4 into Equation&nbsp;5 to get that</p>
<p><span id="eq-tangency"><img src="https://latex.codecogs.com/png.latex?%0AU_Q(K,Q)%20+%20U_K(K,Q)%5C,h'(Q)%20=%200%0A%5C;%5C;%5CLongleftrightarrow%5C;%5C;%0A-%5Cfrac%7BU_Q(K,Q)%7D%7BU_K(K,Q)%7D%20=%20h'(Q).%0A%5Ctag%7B7%7D"></span></p>
<p>Newhouse discusses some concavity conditions to ensure an interior solution, mostly some second-order conditions.</p>
</section>
<section id="implications" class="level2" data-number="4">
<h2 data-number="4" class="anchored" data-anchor-id="implications"><span class="header-section-number">4</span> Implications</h2>
<p>The optimality condition tells us that the MRS of quantity and quality is equal to the slope of the break-even condition. In economic terms, this condition means the administrator will expand quantity up to the point where the value of treating one more patient (in utility terms) is exactly offset by the reduction in quality that must occur to remain at break-even.</p>
<p>If the break-even locus is steep (large (h’(Q))), then each additional patient requires a substantial reduction in quality, so the hospital leans toward protecting quality. If the locus is relatively flat, the hospital can expand patient volume with only modest quality sacrifices, so output increases. This helps explain observed nonprofit hospital behavior: rather than maximizing profit or output alone, they balance prestige- and reputation-enhancing quality with the social goal of treating more patients.</p>
<p>Newhouse argued this framework accounts for investments in high-cost technology, the provision of uncompensated care, and other behaviors that appear puzzling under a pure profit-maximization model but are consistent with a utility-maximizing nonprofit decision maker.</p>
<p>I had Chat-GPT compare how this might look, the first image is basically just what you would typically think of in a utility maximization problem but with different labels, the</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb1-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span>
<span id="cb1-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tibble)</span>
<span id="cb1-4"></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Parameters (tweak to taste) ----</span></span>
<span id="cb1-6">k0    <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># base quality intercept of break-even</span></span>
<span id="cb1-7">b     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># linear cost/demand pressure on quality as Q increases</span></span>
<span id="cb1-8">c     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># curvature of break-even; &gt;0 makes the locus get steeper in Q</span></span>
<span id="cb1-9">alpha <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># weight on Q in utility U(K,Q) = alpha*ln(Q) + (1-alpha)*ln(K)</span></span>
<span id="cb1-10"></span>
<span id="cb1-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Functions ----</span></span>
<span id="cb1-12">h     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) k0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break-even locus: K as fn of Q</span></span>
<span id="cb1-13">hdash <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>b <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># slope dK/dQ of break-even</span></span>
<span id="cb1-14">Ufun  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q,K) alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>alpha)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(K)</span>
<span id="cb1-15"></span>
<span id="cb1-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MRS = -U_Q/U_K = -(alpha/Q)/((1-alpha)/K) = - (alpha/(1-alpha)) * (K/Q)</span></span>
<span id="cb1-17">MRS   <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q,K) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>alpha)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (K<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Q)</span>
<span id="cb1-18"></span>
<span id="cb1-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Tangency (solve MRS = h'(Q) along K = h(Q)) ----</span></span>
<span id="cb1-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Condition: - (alpha/(1-alpha)) * (h(Q)/Q) = hdash(Q)</span></span>
<span id="cb1-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rearranged root condition: h(Q) - ((1-alpha)/alpha) * Q * (b + 2*c*Q) = 0</span></span>
<span id="cb1-22">root_fn <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>alpha)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>alpha) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (b <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q)</span>
<span id="cb1-23"></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># search interval where K&gt;0 and Q&gt;0; adjust if needed</span></span>
<span id="cb1-25">Q_star <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniroot</span>(root_fn, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">interval =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>root</span>
<span id="cb1-26">K_star <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q_star)</span>
<span id="cb1-27">U_star <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Ufun</span>(Q_star, K_star)</span>
<span id="cb1-28"></span>
<span id="cb1-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Data for plotting ----</span></span>
<span id="cb1-30">Q_grid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb1-31">df     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb1-32">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_grid,</span>
<span id="cb1-33">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q_grid), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># keep K positive for log utility</span></span>
<span id="cb1-34">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(K <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb1-35"></span>
<span id="cb1-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Utility levels for indifference curves (one through the tangency, ± offsets)</span></span>
<span id="cb1-37">u_levels <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(U_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, U_star, U_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>)</span>
<span id="cb1-38"></span>
<span id="cb1-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Make a grid for contours</span></span>
<span id="cb1-40">Q_seq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb1-41">K_seq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb1-42">grid  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expand.grid</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_seq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> K_seq) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-43">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">U =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Ufun</span>(Q, K))</span>
<span id="cb1-44"></span>
<span id="cb1-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Optional: tangent line at (Q*,K*) to visualize tangency ----</span></span>
<span id="cb1-46">slope_tan <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hdash</span>(Q_star)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dK/dQ at the tangency</span></span>
<span id="cb1-47">K_tan     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) K_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> slope_tan<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Q_star)</span>
<span id="cb1-48">tan_df    <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_grid, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">K_tan</span>(Q_grid)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(K <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb1-49"></span>
<span id="cb1-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Plot ----</span></span>
<span id="cb1-51"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-52">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Indifference curves (three levels)</span></span>
<span id="cb1-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_contour</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> grid, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">z =</span> U), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> u_levels, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-54">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Break-even locus</span></span>
<span id="cb1-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> df, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-56">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Tangency point</span></span>
<span id="cb1-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q_star, K_star), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-58">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Tangent line at the optimum</span></span>
<span id="cb1-59">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> tan_df, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"longdash"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-60">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">annotate</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Q_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> K_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb1-61">           <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tangency (Q*, K*)"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">hjust =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-62">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quantity (Q)"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quality (K)"</span>,</span>
<span id="cb1-63">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caption =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Indifference curves: U(K,Q) = alpha ln Q + (1-alpha) ln K (solid: through optimum).</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Break-even locus: K = k0 - b Q - c Q^2. Tangency shows MRS = slope of constraint."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-64">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_cartesian</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-65">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">base_size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://econdavidhall.com/posts/Newhouse_9.5.25/index_files/figure-html/unnamed-chunk-1-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Newhouse choice: the DM picks (Q<em>, K</em>) where the indifference curve is tangent to the break-even locus K = h(Q).</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell" data-layout-align="center">
<details class="code-fold">
<summary>Code</summary>
<div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(dplyr)</span>
<span id="cb2-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(tibble)</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># utility weight (same across panels)</span></span>
<span id="cb2-6">alpha <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span></span>
<span id="cb2-7"></span>
<span id="cb2-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># helper to build one scenario's data</span></span>
<span id="cb2-9">build_scenario <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(b, c, label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">k0 =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>) {</span>
<span id="cb2-10">  h     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) k0 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb2-11">  hdash <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>b <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q</span>
<span id="cb2-12">  Ufun  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q,K) alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>alpha)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log</span>(K)</span>
<span id="cb2-13">  root_fn <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>alpha)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>alpha) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (b <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Q)</span>
<span id="cb2-14">  Q_star  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">uniroot</span>(root_fn, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">interval =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>root,</span>
<span id="cb2-15">                      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(e) <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>)</span>
<span id="cb2-16">  K_star  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q_star)</span>
<span id="cb2-17">  U_star  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Ufun</span>(Q_star, K_star)</span>
<span id="cb2-18"></span>
<span id="cb2-19">  Q_grid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb2-20">  locus  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_grid, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">h</span>(Q_grid), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scenario =</span> label) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(K <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb2-21"></span>
<span id="cb2-22">  Q_seq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb2-23">  K_seq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb2-24">  grid  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expand.grid</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_seq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> K_seq) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">U =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">Ufun</span>(Q, K), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scenario =</span> label)</span>
<span id="cb2-25"></span>
<span id="cb2-26">  slope_tan <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hdash</span>(Q_star)</span>
<span id="cb2-27">  K_tan     <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(Q) K_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> slope_tan<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Q <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Q_star)</span>
<span id="cb2-28">  tan_df    <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_grid, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">K_tan</span>(Q_grid), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scenario =</span> label) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(K <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb2-29"></span>
<span id="cb2-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb2-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">locus =</span> locus,</span>
<span id="cb2-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid  =</span> grid,</span>
<span id="cb2-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ulevels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(U_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, U_star, U_star <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>),</span>
<span id="cb2-34">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">star  =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Q =</span> Q_star, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">K =</span> K_star, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scenario =</span> label),</span>
<span id="cb2-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">tan   =</span> tan_df</span>
<span id="cb2-36">  )</span>
<span id="cb2-37">}</span>
<span id="cb2-38"></span>
<span id="cb2-39">flat   <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">build_scenario</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">b =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">c =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Flat break-even locus"</span>)</span>
<span id="cb2-40">steep  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">build_scenario</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">b =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">c =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Steep break-even locus"</span>)</span>
<span id="cb2-41"></span>
<span id="cb2-42">locus   <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>locus, steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>locus)</span>
<span id="cb2-43">grid    <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>grid, steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>grid)</span>
<span id="cb2-44">stars   <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>star, steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>star)</span>
<span id="cb2-45">tangent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>tan, steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>tan)</span>
<span id="cb2-46"></span>
<span id="cb2-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># map of scenario -&gt; its contour levels</span></span>
<span id="cb2-48">ulevels_by <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb2-49">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Flat break-even locus"</span>  <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ulevels,</span>
<span id="cb2-50">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Steep break-even locus"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ulevels</span>
<span id="cb2-51">)</span>
<span id="cb2-52"></span>
<span id="cb2-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Draw contours separately per scenario</span></span>
<span id="cb2-54"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_contour</span>(</span>
<span id="cb2-56">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> grid <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(scenario <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Flat break-even locus"</span>),</span>
<span id="cb2-57">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">z =</span> U),</span>
<span id="cb2-58">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ulevels, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span></span>
<span id="cb2-59">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-60">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_contour</span>(</span>
<span id="cb2-61">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> grid <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(scenario <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Steep break-even locus"</span>),</span>
<span id="cb2-62">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">z =</span> U),</span>
<span id="cb2-63">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> steep<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>ulevels, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span></span>
<span id="cb2-64">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-65">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> locus, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-66">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> stars, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-67">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> tangent, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(Q, K), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"longdash"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> scenario, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">nrow =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-69">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quantity (Q)"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quality (K)"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-70">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_cartesian</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylim =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-71">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">base_size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span></code></pre></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://econdavidhall.com/posts/Newhouse_9.5.25/index_files/figure-html/unnamed-chunk-2-1.png" class="img-fluid figure-img" width="960"></p>
<figcaption>Flat vs.&nbsp;steep break-even loci. <strong>Example:</strong> When the break-even curve is flatter (left), the nonprofit administrator can expand patient quantity with only modest reductions in quality—think of a community hospital adding beds without cutting staff ratios too sharply. When the curve is steeper (right), each additional patient sharply reduces quality—like a facility where adding beds quickly overwhelms nursing staff—so the nonprofit limits patient volume to preserve care quality.</figcaption>
</figure>
</div>
</div>
</div>
</section>
<section id="extension-and-relevance-to-treatment-centers" class="level2" data-number="5">
<h2 data-number="5" class="anchored" data-anchor-id="extension-and-relevance-to-treatment-centers"><span class="header-section-number">5</span> Extension and Relevance to Treatment Centers</h2>
<p>The question for myself, now, is whether or not this truly applies to treatment centers? What comes to mind are the sort of luxury spa-esque TCs, very high quality with low output. Newhouse’s model does seem to predict these sorts of cases. A possible extension to review is Pauly &amp; Redisch’s <a href="https://www.jstor.org/stable/1803128?seq=1"><em>The Non-For-Profit Hospital as a Physicians’ Cooperative</em>.</a> This paper may be interesting to review in light of the many opioid prescribing papers in health econ literature.</p>
<p>It also brings to mind how we might measure quality. SAMHSA keeps track of service offerings for each TC. Would we consider TCs with a high level of quality those who offer tons of services, or is that a high-quantity TC with possibly low quality in each of these areas? Are TCs that have a high availability of MAT lower quality, since they treat so many individuals? This also ties into the idea of how we might measure treatment itself; in all of this work, I consistently combine different types of treatment, but the heterogeneity of TC characteristics is certainly important to consider.</p>
<p>Regardless, I’m thankful for Newhouse’s contribution — the quantity-quality tradeoff and the model that spurred much work — for allowing me to think of these questions.</p>


</section>

 ]]></description>
  <guid>https://econdavidhall.com/posts/Newhouse_9.5.25/</guid>
  <pubDate>Fri, 05 Sep 2025 07:00:00 GMT</pubDate>
</item>
<item>
  <title>BLP HH EHBI Replication Series</title>
  <link>https://econdavidhall.com/series/BLP HH EHBI Replication/</link>
  <description><![CDATA[ 




<p>This series documents replication work on employer-based health insurance demand and related policy questions.</p>
<section id="series-posts" class="level2">
<h2 class="anchored" data-anchor-id="series-posts">Series Posts</h2>
<div id="listing-blp-series-posts" class="quarto-listing quarto-listing-container-default">
<div class="list quarto-listing-default">
<div class="quarto-post image-right" data-index="0" data-categories="TWVkaWNhaWQlMkNJbnN1cmFuY2U=" data-listing-date-sort="1766044800000" data-listing-file-modified-sort="1771284019661" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="10" data-listing-word-count-sort="1905">
<div class="body">
<h3 class="no-anchor listing-title">
<a href="../../series/BLP HH EHBI Replication/post1_EnhancedPTC/index.html" class="no-external">Enhanced PTC and What We Don’t Know</a>
</h3>
<div class="listing-categories">

<div class="listing-category" onclick="window.quartoListingCategory('TWVkaWNhaWQ='); return false;">Medicaid</div>

<div class="listing-category" onclick="window.quartoListingCategory('SW5zdXJhbmNl'); return false;">Insurance</div>

</div>
<div class="delink listing-description"><a href="../../series/BLP HH EHBI Replication/post1_EnhancedPTC/index.html" class="no-external">
<p>An overview of recent issues in Medicaid and a perspective on what we do not yet know about their impact.</p>
</a></div>
</div>
<div class="metadata">
<a href="../../series/BLP HH EHBI Replication/post1_EnhancedPTC/index.html" class="no-external">
<div class="listing-date">
Dec 18, 2025
</div>
</a>
</div>
</div>
</div>
<div class="listing-no-matching d-none">No matching items</div>
</div>



</section>

 ]]></description>
  <guid>https://econdavidhall.com/series/BLP HH EHBI Replication/</guid>
  <pubDate>Sat, 02 May 2026 00:08:01 GMT</pubDate>
</item>
<item>
  <title>Tracking TC Ownership Series</title>
  <link>https://econdavidhall.com/series/TC_Ownership/</link>
  <description><![CDATA[ 




<p>This series tracks ownership trends in US treatment centers and follows how payment acceptance and service mix differ by ownership type.</p>
<section id="series-posts" class="level2">
<h2 class="anchored" data-anchor-id="series-posts">Series Posts</h2>
<div id="listing-tc-series-posts" class="quarto-listing quarto-listing-container-default">
<div class="list quarto-listing-default">
<div class="quarto-post image-right" data-index="0" data-categories="VEMlMjBPd25lcnNoaXA=" data-listing-date-sort="1754636400000" data-listing-file-modified-sort="1766089199183" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="6" data-listing-word-count-sort="1166">
<div class="body">
<h3 class="no-anchor listing-title">
<a href="../../series/TC_Ownership/post1_trackingTCownership/index.html" class="no-external">Tracking TC Ownership: Descriptive Stats</a>
</h3>
<div class="listing-categories">

<div class="listing-category" onclick="window.quartoListingCategory('VEMlMjBPd25lcnNoaXA='); return false;">TC Ownership</div>

</div>
<div class="delink listing-description"><a href="../../series/TC_Ownership/post1_trackingTCownership/index.html" class="no-external">
<p>Ownership shares by state over time with animated maps.</p>
</a></div>
</div>
<div class="metadata">
<a href="../../series/TC_Ownership/post1_trackingTCownership/index.html" class="no-external">
<div class="listing-date">
Aug 8, 2025
</div>
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="1" data-categories="VEMlMjBPd25lcnNoaXA=" data-listing-date-sort="1755759600000" data-listing-file-modified-sort="1766089199183" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="6" data-listing-word-count-sort="1046">
<div class="body">
<h3 class="no-anchor listing-title">
<a href="../../series/TC_Ownership/post2_servicesbyownershp/index.html" class="no-external">Tracking TC Ownership: Payment Acceptance</a>
</h3>
<div class="listing-categories">

<div class="listing-category" onclick="window.quartoListingCategory('VEMlMjBPd25lcnNoaXA='); return false;">TC Ownership</div>

</div>
<div class="delink listing-description"><a href="../../series/TC_Ownership/post2_servicesbyownershp/index.html" class="no-external">
<p>Charts exploring payment types accepted by ownership.</p>
</a></div>
</div>
<div class="metadata">
<a href="../../series/TC_Ownership/post2_servicesbyownershp/index.html" class="no-external">
<div class="listing-date">
Aug 21, 2025
</div>
</a>
</div>
</div>
<div class="quarto-post image-right" data-index="2" data-categories="VEMlMjBPd25lcnNoaXA=" data-listing-date-sort="1758351600000" data-listing-file-modified-sort="1766089199185" data-listing-date-modified-sort="NaN" data-listing-reading-time-sort="6" data-listing-word-count-sort="1056">
<div class="body">
<h3 class="no-anchor listing-title">
<a href="../../series/TC_Ownership/post3_servicesprovidedbyownership/index.html" class="no-external">Tracking TC Ownership: Service Type</a>
</h3>
<div class="listing-categories">

<div class="listing-category" onclick="window.quartoListingCategory('VEMlMjBPd25lcnNoaXA='); return false;">TC Ownership</div>

</div>
<div class="delink listing-description"><a href="../../series/TC_Ownership/post3_servicesprovidedbyownership/index.html" class="no-external">
<p>Charts exploring service types used by ownership.</p>
</a></div>
</div>
<div class="metadata">
<a href="../../series/TC_Ownership/post3_servicesprovidedbyownership/index.html" class="no-external">
<div class="listing-date">
Sep 20, 2025
</div>
</a>
</div>
</div>
</div>
<div class="listing-no-matching d-none">No matching items</div>
</div>



</section>

 ]]></description>
  <guid>https://econdavidhall.com/series/TC_Ownership/</guid>
  <pubDate>Sat, 02 May 2026 00:08:01 GMT</pubDate>
</item>
</channel>
</rss>
