<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>sdid | Carlos Mendez</title><link>https://carlos-mendez.org/tag/sdid/</link><atom:link href="https://carlos-mendez.org/tag/sdid/index.xml" rel="self" type="application/rss+xml"/><description>sdid</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© 2018–2026 Carlos Mendez. All rights reserved.</copyright><lastBuildDate>Sun, 07 Jun 2026 00:00:00 +0000</lastBuildDate><image><url>https://carlos-mendez.org/media/icon_huedfae549300b4ca5d201a9bd09a3ecd5_79625_512x512_fill_lanczos_center_3.png</url><title>sdid</title><link>https://carlos-mendez.org/tag/sdid/</link></image><item><title>Synthetic Difference-in-Differences (SDID) in Stata: Re-evaluating California's Proposition 99</title><link>https://carlos-mendez.org/post/stata_sdid/</link><pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate><guid>https://carlos-mendez.org/post/stata_sdid/</guid><description>&lt;h2 id="1-overview">1. Overview&lt;/h2>
&lt;p>In November 1988 California voters passed &lt;strong>Proposition 99&lt;/strong>, which raised the cigarette excise tax by 25 cents a pack and funded a large anti-smoking campaign. Did it actually reduce smoking? This is the textbook question of &lt;strong>comparative case study&lt;/strong> research: a single, large unit (California) adopts a policy, and we want the causal effect even though we can never observe the California that &lt;em>did not&lt;/em> pass Proposition 99.&lt;/p>
&lt;p>This tutorial builds up to &lt;strong>synthetic difference-in-differences (SDID)&lt;/strong>, the estimator of Arkhangelsky, Athey, Hsiao, Imbens, and Wager (2021), and applies it with the &lt;code>sdid&lt;/code> command of Clarke, Pailañir, Athey, and Imbens (2024). SDID is best understood as the marriage of two older ideas:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Difference-in-differences (DiD)&lt;/strong> — compare California&amp;rsquo;s before/after change to the before/after change of &lt;em>all&lt;/em> control states.&lt;/li>
&lt;li>&lt;strong>Synthetic control (SC)&lt;/strong> — build a &amp;ldquo;synthetic California&amp;rdquo; as a weighted average of control states that tracks California before the policy.&lt;/li>
&lt;/ul>
&lt;p>SDID keeps the best of both: like SC it chooses &lt;strong>unit weights&lt;/strong> so the comparison group resembles California, and like DiD it allows a &lt;strong>constant level gap&lt;/strong> between California and its comparison group (a unit fixed effect). It then adds one more ingredient SC lacks — &lt;strong>time weights&lt;/strong> that emphasize the pre-policy years most predictive of the post-policy period.&lt;/p>
&lt;p>A second theme runs through the whole tutorial, and it is worth stating up front. As Clarke et al. (2024) put it, &lt;em>along with SDID, the &lt;code>sdid&lt;/code> command implements standard synthetic control and difference-in-differences in an &lt;strong>identical framework&lt;/strong>, allowing estimation, inference, and graphical output in a computationally efficient way.&lt;/em> We will show this concretely: the &lt;strong>same command&lt;/strong>, changing only one option, reproduces the raw difference-in-differences and the classic synthetic control — and we cross-check the latter against the dedicated &lt;code>synth2&lt;/code> command.&lt;/p>
&lt;h3 id="learning-objectives">Learning objectives&lt;/h3>
&lt;p>By the end you will be able to:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Derive&lt;/strong> the SDID estimator as a weighted two-way fixed-effects regression and read its unit-weight and time-weight optimization problems.&lt;/li>
&lt;li>&lt;strong>Distinguish&lt;/strong> SDID from the original DiD and SC — conceptually (which weights, which fixed effects) and quantitatively (on the same data).&lt;/li>
&lt;li>&lt;strong>Estimate&lt;/strong> the effect of Proposition 99 with &lt;code>sdid&lt;/code>, and reproduce DiD and SC from the very same command.&lt;/li>
&lt;li>&lt;strong>Compare&lt;/strong> the SDID synthetic against a classical synthetic control fit with &lt;code>synth2&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Conduct&lt;/strong> valid inference when there is a single treated unit, using placebo (permutation) methods — and recognize when other procedures (bootstrap, jackknife) do and do not apply.&lt;/li>
&lt;/ul>
&lt;h3 id="what-we-are-estimating">What we are estimating&lt;/h3>
&lt;p>Throughout, the estimand is the &lt;strong>average treatment effect on the treated (ATT)&lt;/strong> — the effect of Proposition 99 &lt;em>on California&lt;/em>, over the post-1988 period:&lt;/p>
&lt;p>$$
\tau = \frac{1}{N_{tr}\, T_{post}} \sum_{i:\, W_i = 1}\ \sum_{t &amp;gt; T_{pre}} \left[\, Y_{it}(1) - Y_{it}(0) \,\right]
$$&lt;/p>
&lt;p>In words: average, over treated units and post-treatment years, the difference between the outcome with the policy, $Y_{it}(1)$, and the outcome that &lt;em>would have occurred&lt;/em> without it, $Y_{it}(0)$. Here there is exactly one treated unit ($N_{tr} = 1$, California), and $Y_{it}(0)$ is never observed after 1988 — every method in this tutorial is a different way of &lt;strong>imputing that missing counterfactual&lt;/strong>. Because California was &lt;em>not&lt;/em> randomly assigned to treatment, this is an &lt;strong>observational&lt;/strong> design: identification rests on assumptions (a stable comparison group, no large contemporaneous shocks unique to California) rather than on randomization.&lt;/p>
&lt;h3 id="key-concepts-at-a-glance">Key concepts at a glance&lt;/h3>
&lt;details>
&lt;summary>&lt;b>Counterfactual&lt;/b> — what California's smoking would have been without Proposition 99.&lt;/summary>
&lt;p>Every estimator here is a recipe for the dashed line &amp;ldquo;California if the policy had never passed.&amp;rdquo; DiD, SC, and SDID disagree only about how to build it.&lt;/p>
&lt;/details>
&lt;details>
&lt;summary>&lt;b>Unit weights (ω)&lt;/b> — how much each control state counts toward the synthetic California.&lt;/summary>
&lt;p>DiD gives every control the same weight ($1/N_{co}$). SC and SDID instead pick weights so the weighted controls reproduce California&amp;rsquo;s pre-policy outcome path. SC concentrates weight on a handful of states; SDID spreads it more widely.&lt;/p>
&lt;/details>
&lt;details>
&lt;summary>&lt;b>Time weights (λ)&lt;/b> — how much each pre-policy year counts.&lt;/summary>
&lt;p>This is SDID&amp;rsquo;s signature. Rather than treat every pre-1989 year equally, SDID up-weights the pre-period years that best predict the post-period — here, 1986–1988. SC and DiD have no time weights.&lt;/p>
&lt;/details>
&lt;details>
&lt;summary>&lt;b>Unit fixed effects (α)&lt;/b> — a constant level gap between California and its synthetic comparison.&lt;/summary>
&lt;p>DiD and SDID include them, so the comparison group only needs to move &lt;em>in parallel&lt;/em> with California, not sit at the same level. Classic SC omits them and instead tries to match California&amp;rsquo;s level outright.&lt;/p>
&lt;/details>
&lt;details>
&lt;summary>&lt;b>Placebo inference&lt;/b> — how we get a standard error with only one treated unit.&lt;/summary>
&lt;p>We pretend, one at a time, that a control state was &amp;ldquo;treated,&amp;rdquo; re-estimate the effect, and build the distribution of these placebo effects. If California&amp;rsquo;s real effect is extreme relative to that distribution, it is unlikely to be noise.&lt;/p>
&lt;/details>
&lt;hr>
&lt;h2 id="2-the-proposition-99-case-study">2. The Proposition 99 case study&lt;/h2>
&lt;p>We use the canonical dataset distributed with the &lt;code>sdid&lt;/code> package (originally from Abadie, Diamond, and Hainmueller 2010, and used by Arkhangelsky et al. 2021). It is a &lt;strong>strongly balanced panel&lt;/strong>: 39 US states observed annually from 1970 to 2000, with one outcome — annual cigarette sales in &lt;strong>packs per capita&lt;/strong>. California is the single treated unit; the policy bites from &lt;strong>1989&lt;/strong> onward. The remaining 38 states (which did not pass comparable large-scale tobacco programs in this window) form the &lt;strong>donor pool&lt;/strong>.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Variable&lt;/th>
&lt;th>Role&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>state&lt;/code>&lt;/td>
&lt;td>unit id&lt;/td>
&lt;td>39 US states (California + 38 controls)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>year&lt;/code>&lt;/td>
&lt;td>time id&lt;/td>
&lt;td>1970–2000 (19 pre-, 12 post-treatment years)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>packspercapita&lt;/code>&lt;/td>
&lt;td>outcome $Y_{it}$&lt;/td>
&lt;td>annual cigarette pack sales per capita&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>treated&lt;/code>&lt;/td>
&lt;td>treatment $W_{it}$&lt;/td>
&lt;td>1 for California in 1989–2000, else 0&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>One feature matters for a fair comparison: this panel contains &lt;strong>only the outcome&lt;/strong> — no income, price, or demographic covariates. That is deliberate here. It means synthetic control and SDID see &lt;em>exactly the same information&lt;/em> (California&amp;rsquo;s and the donors&amp;rsquo; pre-period smoking paths), so any difference in their answers comes from the &lt;strong>estimator&lt;/strong>, not from a different set of predictors.&lt;/p>
&lt;pre>&lt;code class="language-mermaid">graph LR
POOL[&amp;quot;&amp;lt;b&amp;gt;Donor pool&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;38 control states&amp;lt;br/&amp;gt;Utah, Nevada, Montana, …&amp;quot;]
CA[&amp;quot;&amp;lt;b&amp;gt;California&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;treated 1989&amp;quot;]
SYN[&amp;quot;&amp;lt;b&amp;gt;Synthetic California&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;counterfactual Y(0)&amp;quot;]
POOL --&amp;gt;|weighted average ω| SYN
CA --&amp;gt;|compare after 1989| SYN
style POOL fill:#6a9bcc,stroke:#141413,color:#fff
style CA fill:#d97757,stroke:#141413,color:#fff
style SYN fill:#00d4c8,stroke:#141413,color:#141413
&lt;/code>&lt;/pre>
&lt;p>Let us first look at the data with no model at all — California against the simple average of the 38 control states.&lt;/p>
&lt;pre>&lt;code class="language-stata">use prop99_example.dta, clear
describe
encode state, gen(id)
xtset id year
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text">Contains data from prop99_example.dta
Observations: 1,209
Variables: 4
-------------------------------------------------------------------------------
Variable Storage Display Value
name type format label Variable label
-------------------------------------------------------------------------------
state str14 %14s State
year int %8.0g Year
packspercapita float %9.0g PacksPerCapita
treated byte %8.0g
-------------------------------------------------------------------------------
Panel variable: id (strongly balanced)
Time variable: year, 1970 to 2000
Delta: 1 unit
&lt;/code>&lt;/pre>
&lt;p>The panel is strongly balanced (no gaps), which every method below requires. The figure compares California to the raw control average.&lt;/p>
&lt;p>&lt;img src="stata_sdid_raw_trends.png" alt="California&amp;amp;rsquo;s cigarette sales fall faster than the average of the 38 control states after 1989, but the two series were already on different levels and slopes before the policy — which is exactly why a naive comparison is not enough.">&lt;/p>
&lt;p>California (orange) already smoked &lt;strong>less&lt;/strong> than the average control state and was declining throughout the 1980s. After 1989 the gap widens visibly. But two problems jump out: California sits on a &lt;strong>different level&lt;/strong> than the average donor, and it was already on a &lt;strong>different trend&lt;/strong> before 1989. A credible estimate must deal with both — the job of the three estimators below.&lt;/p>
&lt;hr>
&lt;h2 id="3-three-estimators-one-equation">3. Three estimators, one equation&lt;/h2>
&lt;p>The cleanest way to see how DiD, SC, and SDID relate is to write them all as the &lt;strong>same&lt;/strong> weighted two-way fixed-effects (TWFE) regression and change only the weights. This is the unifying view of Arkhangelsky et al. (2021).&lt;/p>
&lt;h3 id="synthetic-difference-in-differences">Synthetic difference-in-differences&lt;/h3>
&lt;p>SDID solves a weighted TWFE regression:&lt;/p>
&lt;p>$$
\left(\hat{\tau}^{sdid}, \hat{\mu}, \hat{\alpha}, \hat{\beta}\right) = \underset{\tau,\mu,\alpha,\beta}{\arg\min} \sum_{i=1}^{N} \sum_{t=1}^{T} \left(Y_{it} - \mu - \alpha_i - \beta_t - W_{it}\,\tau\right)^{2} \hat{\omega}_i^{sdid}\ \hat{\lambda}_t^{sdid}
$$&lt;/p>
&lt;p>Reading the symbols against the Stata variables: $Y_{it}$ is &lt;code>packspercapita&lt;/code>; $W_{it}$ is &lt;code>treated&lt;/code>; $\alpha_i$ is a state fixed effect (one per &lt;code>state&lt;/code>); $\beta_t$ is a year fixed effect (one per &lt;code>year&lt;/code>); and $\tau$ is the ATT we want. The two extra terms are the difference from ordinary regression: $\hat{\omega}_i^{sdid}$ is a &lt;strong>unit weight&lt;/strong> (how much state $i$ counts) and $\hat{\lambda}_t^{sdid}$ is a &lt;strong>time weight&lt;/strong> (how much year $t$ counts). Set those weights to special values and you recover the older estimators.&lt;/p>
&lt;h3 id="the-original-difference-in-differences">The original difference-in-differences&lt;/h3>
&lt;p>DiD is the &lt;strong>special case with no weighting&lt;/strong> — every unit and every year counts equally:&lt;/p>
&lt;p>$$
\left(\hat{\tau}^{did}, \hat{\mu}, \hat{\alpha}, \hat{\beta}\right) = \underset{\tau,\mu,\alpha,\beta}{\arg\min} \sum_{i=1}^{N} \sum_{t=1}^{T} \left(Y_{it} - \mu - \alpha_i - \beta_t - W_{it}\,\tau\right)^{2}
$$&lt;/p>
&lt;p>This is just two-way fixed-effects regression. Its credibility hinges entirely on &lt;strong>parallel trends&lt;/strong>: the assumption that, absent the policy, California would have moved in lockstep with the &lt;em>average&lt;/em> control state. The raw-trends figure already makes that assumption look shaky.&lt;/p>
&lt;h3 id="the-original-synthetic-control">The original synthetic control&lt;/h3>
&lt;p>SC keeps &lt;strong>unit weights&lt;/strong> but drops the &lt;strong>time weights&lt;/strong> &lt;em>and&lt;/em> the &lt;strong>unit fixed effects&lt;/strong> $\alpha_i$:&lt;/p>
&lt;p>$$
\left(\hat{\tau}^{sc}, \hat{\mu}, \hat{\beta}\right) = \underset{\tau,\mu,\beta}{\arg\min} \sum_{i=1}^{N} \sum_{t=1}^{T} \left(Y_{it} - \mu - \beta_t - W_{it}\,\tau\right)^{2} \hat{\omega}_i^{sc}
$$&lt;/p>
&lt;p>Without $\alpha_i$, SC cannot absorb a level gap, so it must build a synthetic California that matches California&amp;rsquo;s pre-period outcomes in &lt;strong>both level and trend&lt;/strong>. That is a demanding requirement — and the reason SC sometimes cannot find a good fit.&lt;/p>
&lt;pre>&lt;code class="language-mermaid">graph TD
OBJ[&amp;quot;&amp;lt;b&amp;gt;One weighted two-way&amp;lt;br/&amp;gt;fixed-effects regression&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;min Σ (Y − μ − α − β − Wτ)² · ω · λ&amp;lt;/i&amp;gt;&amp;quot;]
OBJ --&amp;gt; DID[&amp;quot;&amp;lt;b&amp;gt;DiD&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;ω uniform, λ uniform&amp;lt;br/&amp;gt;α included&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;parallel trends on all controls&amp;lt;/i&amp;gt;&amp;quot;]
OBJ --&amp;gt; SC[&amp;quot;&amp;lt;b&amp;gt;Synthetic control&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;ω optimized, no λ&amp;lt;br/&amp;gt;&amp;lt;b&amp;gt;no&amp;lt;/b&amp;gt; unit FE α&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;match level AND trend&amp;lt;/i&amp;gt;&amp;quot;]
OBJ --&amp;gt; SDID[&amp;quot;&amp;lt;b&amp;gt;SDID&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;ω optimized + λ optimized&amp;lt;br/&amp;gt;α included&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;match trend, allow level gap&amp;lt;/i&amp;gt;&amp;quot;]
style OBJ fill:#141413,stroke:#6a9bcc,color:#fff
style DID fill:#d97757,stroke:#141413,color:#fff
style SC fill:#6a9bcc,stroke:#141413,color:#fff
style SDID fill:#00d4c8,stroke:#141413,color:#141413
&lt;/code>&lt;/pre>
&lt;h3 id="how-the-weights-are-chosen">How the weights are chosen&lt;/h3>
&lt;p>The &lt;strong>unit weights&lt;/strong> make the weighted controls track California&amp;rsquo;s pre-period path, with a small ridge penalty for stability:&lt;/p>
&lt;p>$$
\hat{\omega}^{sdid} = \underset{\omega \in \Omega}{\arg\min} \sum_{t=1}^{T_{pre}} \left(\omega_0 + \sum_{i=1}^{N_{co}} \omega_i\, Y_{it} - \frac{1}{N_{tr}} \sum_{i=N_{co}+1}^{N} Y_{it}\right)^{2} + \zeta^{2}\, T_{pre}\, \lVert \omega \rVert_2^{2}
$$&lt;/p>
&lt;p>In words: choose nonnegative weights summing to one (the set $\Omega$) so the weighted control outcome, plus an intercept $\omega_0$, comes as close as possible to the treated outcome &lt;strong>in every pre-treatment year&lt;/strong>. The intercept $\omega_0$ is what lets SDID match California&amp;rsquo;s &lt;em>trend&lt;/em> without matching its &lt;em>level&lt;/em>. The penalty $\zeta^{2} T_{pre} \lVert \omega \rVert_2^2$ discourages putting all weight on one or two donors; Arkhangelsky et al. set $\zeta = (N_{tr} T_{post})^{1/4}\, \hat{\sigma}$, with $\hat{\sigma}$ the standard deviation of first-differenced control outcomes.&lt;/p>
&lt;p>The &lt;strong>time weights&lt;/strong> are the mirror image — they find pre-period years whose weighted average lines up with the post-period:&lt;/p>
&lt;p>$$
\hat{\lambda}^{sdid} = \underset{\lambda \in \Lambda}{\arg\min} \sum_{i=1}^{N_{co}} \left(\lambda_0 + \sum_{t=1}^{T_{pre}} \lambda_t\, Y_{it} - \frac{1}{T_{post}} \sum_{t=T_{pre}+1}^{T} Y_{it}\right)^{2} + \zeta_{\lambda}^{2}\, N_{co}\, \lVert \lambda \rVert^{2}
$$&lt;/p>
&lt;p>This says: find pre-period year weights so the weighted pre-period control outcome matches each control&amp;rsquo;s &lt;em>post-period average&lt;/em>. Years that look most like the post-period get the most weight. We will see SDID place essentially all pre-period weight on &lt;strong>1986–1988&lt;/strong>.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>&lt;/th>
&lt;th style="text-align:center">Unit weights ω&lt;/th>
&lt;th style="text-align:center">Time weights λ&lt;/th>
&lt;th style="text-align:center">Unit FE α&lt;/th>
&lt;th>Must match&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;strong>DiD&lt;/strong>&lt;/td>
&lt;td style="text-align:center">uniform&lt;/td>
&lt;td style="text-align:center">uniform&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>parallel trends vs. all controls&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SC&lt;/strong>&lt;/td>
&lt;td style="text-align:center">optimized&lt;/td>
&lt;td style="text-align:center">none&lt;/td>
&lt;td style="text-align:center">&lt;strong>no&lt;/strong>&lt;/td>
&lt;td>California&amp;rsquo;s level &lt;em>and&lt;/em> trend&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SDID&lt;/strong>&lt;/td>
&lt;td style="text-align:center">optimized&lt;/td>
&lt;td style="text-align:center">optimized&lt;/td>
&lt;td style="text-align:center">yes&lt;/td>
&lt;td>California&amp;rsquo;s trend (level gap allowed)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="4-loading-the-data">4. Loading the data&lt;/h2>
&lt;p>We already loaded and &lt;code>xtset&lt;/code> the panel above. The &lt;code>sdid&lt;/code> command takes the data in &lt;strong>long form&lt;/strong> and needs four arguments — outcome, unit, time, and a 0/1 treatment indicator — so no further reshaping is required. The &lt;code>synth2&lt;/code> command additionally needs a numeric panel id and &lt;code>xtset&lt;/code>, which we created with &lt;code>encode&lt;/code>.&lt;/p>
&lt;pre>&lt;code class="language-stata">summarize packspercapita
tab treated
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text"> Variable | Obs Mean Std. dev. Min Max
-------------+---------------------------------------------------------
packsperca~a | 1,209 122.6493 35.04942 40.7 296.2
treated | Freq. Percent Cum.
------------+-----------------------------------
0 | 1,197 99.01 99.01
1 | 12 0.99 100.00
------------+-----------------------------------
&lt;/code>&lt;/pre>
&lt;p>Only &lt;strong>12&lt;/strong> of 1,209 observations are treated — California in its 12 post-1988 years. This extreme imbalance (one treated unit) is the defining feature of a comparative case study and, as we will see in Section 9, dictates how inference must be done.&lt;/p>
&lt;hr>
&lt;h2 id="5-a-first-look-the-original-difference-in-differences">5. A first look: the original difference-in-differences&lt;/h2>
&lt;p>The simplest credible estimate is a &lt;strong>2×2 difference-in-differences&lt;/strong>: compare California&amp;rsquo;s change from before to after 1989 with the control states&amp;rsquo; change over the same window. The &amp;ldquo;difference in differences&amp;rdquo; removes anything common to all states (the nationwide decline in smoking) and anything fixed about California (its lower baseline level).&lt;/p>
&lt;pre>&lt;code class="language-stata">gen byte cal = state==&amp;quot;California&amp;quot;
gen byte post = year&amp;gt;=1989
reg packspercapita i.cal##i.post
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text">------------------------------------------------------------------------------
packsperca~a | Coefficient Std. err. t P&amp;gt;|t| [95% conf. interval]
-------------+----------------------------------------------------------------
1.cal | -14.359 6.788699 -2.12 0.035 -27.67799 -1.040019
1.post | -28.51142 1.747208 -16.32 0.000 -31.93932 -25.08351
|
cal#post |
1 1 | -27.34911 10.91131 -2.51 0.012 -48.75638 -5.941839
|
_cons | 130.5695 1.087062 120.11 0.000 128.4368 132.7023
------------------------------------------------------------------------------
&lt;/code>&lt;/pre>
&lt;p>The interaction &lt;code>cal#post&lt;/code> &lt;strong>= −27.35&lt;/strong> is the DiD estimate: relative to the control states, California&amp;rsquo;s smoking fell by about &lt;strong>27 packs per capita&lt;/strong> after Proposition 99. We can read the four group means straight off the table: control states averaged 130.57 packs before and 102.06 after (a drop of 28.5), while California went from 116.21 to 60.35 (a drop of 55.86). The difference of those drops, $-55.86 - (-28.51) = -27.35$, is the DiD.&lt;/p>
&lt;p>But this number trusts the &lt;strong>parallel-trends&lt;/strong> assumption against the &lt;em>simple average&lt;/em> of 38 very different states — and the raw-trends figure showed California was already drifting away from that average before 1989. If California was on a steeper downward path for reasons unrelated to the policy, DiD will overstate the effect. This is the weakness synthetic methods are designed to fix.&lt;/p>
&lt;hr>
&lt;h2 id="6-the-original-synthetic-control-with-synth2">6. The original synthetic control with &lt;code>synth2&lt;/code>&lt;/h2>
&lt;p>Synthetic control replaces the &lt;em>simple&lt;/em> average of controls with a &lt;em>weighted&lt;/em> average chosen to track California before 1989. We fit it with &lt;strong>&lt;code>synth2&lt;/code>&lt;/strong> (Yan and Chen 2023), a modern wrapper around Abadie&amp;rsquo;s &lt;code>synth&lt;/code> that adds placebo tests and visualization. Because our panel has only the outcome, we match on the &lt;strong>full pre-period path&lt;/strong> — each pre-1989 year of &lt;code>packspercapita&lt;/code> enters as its own predictor. This is the fair, like-for-like analog to what SDID uses.&lt;/p>
&lt;pre>&lt;code class="language-stata">* California is id 3 after encode (alphabetical)
local preds
forvalues y = 1970/1988 {
local preds &amp;quot;`preds' packspercapita(`y')&amp;quot;
}
synth2 packspercapita `preds', trunit(3) trperiod(1989) figure
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text"> Number of Control Units = 38 Root Mean Squared Error = 1.65640
Number of Covariates = 19 R-squared = 0.97699
Optimal Unit Weights:
---------------------------
Unit | U.weight
--------------+------------
Utah | 0.3940
Montana | 0.2320
Nevada | 0.2050
Connecticut | 0.1090
NewHampshire | 0.0450
Colorado | 0.0150
---------------------------
Note: The average treatment effect over the posttreatment period is -19.4814.
&lt;/code>&lt;/pre>
&lt;p>The pre-period fit is excellent — a root mean squared prediction error of &lt;strong>1.66 packs&lt;/strong> and an $R^2$ of &lt;strong>0.98&lt;/strong>, meaning synthetic California reproduces real California almost exactly before 1989. The synthetic is built from just &lt;strong>six&lt;/strong> donors, dominated by &lt;strong>Utah (0.39), Montana (0.23), and Nevada (0.21)&lt;/strong> — states that smoked like California before the program. The estimated effect averages &lt;strong>−19.48 packs per capita&lt;/strong> over 1989–2000, smaller than the naive DiD&amp;rsquo;s −27.35: once we compare California to states that actually looked like it, part of the apparent drop turns out to be the wrong comparison group, not the policy.&lt;/p>
&lt;p>&lt;img src="stata_sdid_sc_path.png" alt="Synthetic California (blue dashed) tracks real California (orange) almost perfectly before 1989, then the two separate sharply.">&lt;/p>
&lt;p>The fit before 1989 is the whole credibility argument for synthetic control: if the synthetic matches California for nineteen years and then diverges exactly when the policy starts, the divergence is plausibly the policy. The next figure shows the same thing as a single &lt;strong>gap&lt;/strong> series.&lt;/p>
&lt;p>&lt;img src="stata_sdid_sc_gap.png" alt="The estimated gap (California minus synthetic) hugs zero before 1989 and then falls steadily to about −27 packs by 2000.">&lt;/p>
&lt;p>The gap is essentially flat and near zero through 1988 — the pre-period fit is good — and then opens up after the policy, reaching roughly &lt;strong>−27 packs by 2000&lt;/strong>. Averaged over the post-period, that is the −19.5 headline. The growing gap is consistent with a program whose effect compounds as the tax and campaign change long-run behavior.&lt;/p>
&lt;hr>
&lt;h2 id="7-synthetic-difference-in-differences-with-sdid">7. Synthetic difference-in-differences with &lt;code>sdid&lt;/code>&lt;/h2>
&lt;p>Now SDID. The syntax mirrors the data structure — outcome, unit, time, treatment — and one option, &lt;code>vce()&lt;/code>, selects the inference method. We start with &lt;code>vce(noinference)&lt;/code> to focus on the point estimate and the diagnostic graph.&lt;/p>
&lt;pre>&lt;code class="language-stata">sdid packspercapita state year treated, method(sdid) vce(noinference) graph
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text">Synthetic Difference-in-Differences Estimator
-----------------------------------------------------------------------------
packsperca~a | ATT Std. Err. t P&amp;gt;|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------
treated | -15.60383 . . . . .
-----------------------------------------------------------------------------
&lt;/code>&lt;/pre>
&lt;p>The SDID estimate is &lt;strong>−15.60 packs per capita&lt;/strong> — smaller again than both DiD (−27.35) and SC (−19.48). Relative to the level SDID implies California &lt;em>would&lt;/em> have smoked, this is roughly a &lt;strong>20% reduction&lt;/strong>, and it is the number reported in Arkhangelsky et al. (2021). Why is it smaller than SC&amp;rsquo;s? Because SDID does two things SC does not: it allows a constant level gap (so it is not forced to fit California&amp;rsquo;s &lt;em>level&lt;/em>, only its &lt;em>trend&lt;/em>), and it down-weights pre-period years that look nothing like the late 1980s. Both make the comparison more conservative.&lt;/p>
&lt;p>The &lt;code>graph&lt;/code> option produces SDID&amp;rsquo;s signature diagnostic.&lt;/p>
&lt;p>&lt;img src="stata_sdid_sdid_main.png" alt="The SDID diagnostic: California (red) versus the trend-matched synthetic control (blue dashed), which sits above California by a roughly constant gap because SDID matches trends, not levels. The green ribbon at the bottom shows the time weights, concentrated on 1986–1988.">&lt;/p>
&lt;p>Two things are worth noticing. First, the synthetic &amp;ldquo;Control&amp;rdquo; line sits &lt;strong>above&lt;/strong> California throughout — SDID does not try to close that level gap, because the unit fixed effect absorbs it. What SDID cares about is whether the two lines stay &lt;strong>parallel&lt;/strong> before 1989 (they do) and then diverge after (they do). Second, the green shaded ribbon shows the &lt;strong>time weights&lt;/strong> $\hat{\lambda}_t$ — and they are not uniform.&lt;/p>
&lt;p>&lt;img src="stata_sdid_lambda.png" alt="SDID&amp;amp;rsquo;s pre-period time weights fall almost entirely on 1986, 1987, and 1988 (0.37, 0.21, 0.43); earlier years get zero.">&lt;/p>
&lt;p>This is SDID&amp;rsquo;s distinctive move. Of the nineteen pre-policy years, it places &lt;strong>all&lt;/strong> pre-period weight on &lt;strong>1986–1988&lt;/strong> — the years most similar to the post-1989 period — and zero on 1970–1985. Intuitively, smoking behavior and its determinants in 1972 tell us little about the counterfactual for 1995; the late 1980s tell us much more. DiD and SC, by contrast, treat 1972 and 1988 as equally informative. We can confirm which states and years carry weight by asking &lt;code>sdid&lt;/code> to return them:&lt;/p>
&lt;pre>&lt;code class="language-stata">sdid packspercapita state year treated, vce(noinference) returnweights mattitles
&lt;/code>&lt;/pre>
&lt;p>The returned unit weights $\hat{\omega}_i$ are &lt;strong>diffuse&lt;/strong> compared with synthetic control&amp;rsquo;s: the largest are Nevada (0.12), New Hampshire (0.11), Connecticut (0.08), Delaware (0.07), and Colorado (0.06), with positive weight spread across roughly twenty states. Where &lt;code>synth2&lt;/code> leaned on six donors, SDID&amp;rsquo;s ridge penalty spreads the weight — trading a little pre-period fit for a more stable, less idiosyncratic comparison group. Both methods nonetheless agree on the &lt;em>kind&lt;/em> of state that resembles California: Nevada, Utah, Montana, Connecticut, and Colorado appear prominently in both.&lt;/p>
&lt;hr>
&lt;h2 id="8-one-command-three-estimators">8. One command, three estimators&lt;/h2>
&lt;p>Here is the practical payoff emphasized by Clarke et al. (2024): the &lt;code>sdid&lt;/code> command implements all three estimators in an &lt;strong>identical framework&lt;/strong>. You do not switch packages or rewrite your model — you change the single option &lt;code>method()&lt;/code>. Estimation, inference (&lt;code>vce()&lt;/code>), and the diagnostic &lt;code>graph&lt;/code> all work the same way for each.&lt;/p>
&lt;pre>&lt;code class="language-stata">sdid packspercapita state year treated, method(did) vce(noinference) graph
sdid packspercapita state year treated, method(sc) vce(noinference) graph
sdid packspercapita state year treated, method(sdid) vce(noinference) graph
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text">DiD (sdid framework) = -27.34911
SC (sdid framework) = -19.61966
SDID = -15.60383
&lt;/code>&lt;/pre>
&lt;p>This is a strong internal consistency check. The framework&amp;rsquo;s &lt;code>method(did)&lt;/code> returns &lt;strong>−27.349&lt;/strong> — &lt;em>identical&lt;/em>, to the decimal, to the raw 2×2 interaction we computed by hand with &lt;code>reg&lt;/code> in Section 5. And &lt;code>method(sc)&lt;/code> returns &lt;strong>−19.620&lt;/strong>, essentially the same as the &lt;strong>−19.481&lt;/strong> from the standalone &lt;code>synth2&lt;/code> command (the tiny gap reflects different regularization: &lt;code>sdid&lt;/code> matches the full pre-period path with a ridge penalty, while &lt;code>synth2&lt;/code> optimizes Abadie&amp;rsquo;s predictor-weighting V-matrix). In other words, the unified command reproduces the two classic estimators we obtained by entirely separate routes — which is exactly the claim that they are special cases of one weighted regression. And because the optimal weights are computed once and reused across &lt;code>vce()&lt;/code> options, doing so is computationally cheap.&lt;/p>
&lt;p>The same &lt;code>graph&lt;/code> option yields each method&amp;rsquo;s diagnostic, so they can be read side by side.&lt;/p>
&lt;p>&lt;img src="stata_sdid_did_panel.png" alt="Difference-in-differences in the sdid framework: California versus the equally-weighted control average. Note there are no time weights — every pre-period year counts the same.">&lt;/p>
&lt;p>&lt;img src="stata_sdid_sc_panel.png" alt="Synthetic control in the sdid framework: California versus an optimally weighted synthetic, again with uniform time weights but optimized unit weights.">&lt;/p>
&lt;p>Stacking all four counterfactuals on one chart makes the ranking transparent. To put them on a common scale, the SDID counterfactual is anchored to California by its $\lambda$-weighted pre-period gap (recall SDID identifies effects only up to a constant level, which the unit fixed effect absorbs).&lt;/p>
&lt;p>&lt;img src="stata_sdid_compare_paths.png" alt="All four counterfactuals track California before 1989, then separate. The DiD counterfactual sits highest (largest estimated effect, −27), synthetic control next (−19.5), and SDID closest to California (smallest effect, −15.6).">&lt;/p>
&lt;p>The story is consistent across methods — Proposition 99 &lt;strong>reduced&lt;/strong> smoking — but the magnitude depends on how the counterfactual is built. The naive DiD is the most extreme because it compares California to a control average that was already on a different trajectory. Synthetic control fixes the comparison group and shrinks the estimate to about −19.5. SDID, by additionally allowing a level gap and weighting the informative late-1980s years, is the most conservative at −15.6. Reasonable methods bracket the truth; SDID&amp;rsquo;s contribution is to be robust to the assumption — exact parallel trends — that the others lean on hardest.&lt;/p>
&lt;p>Collecting every estimate in one place:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Method&lt;/th>
&lt;th>Command&lt;/th>
&lt;th style="text-align:center">ATT (packs per capita)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>Raw 2×2 DiD&lt;/td>
&lt;td>&lt;code>reg y i.cal##i.post&lt;/code>&lt;/td>
&lt;td style="text-align:center">−27.35&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>DiD (unified)&lt;/td>
&lt;td>&lt;code>sdid …, method(did)&lt;/code>&lt;/td>
&lt;td style="text-align:center">−27.35&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Synthetic control&lt;/td>
&lt;td>&lt;code>synth2 …&lt;/code>&lt;/td>
&lt;td style="text-align:center">−19.48&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>SC (unified)&lt;/td>
&lt;td>&lt;code>sdid …, method(sc)&lt;/code>&lt;/td>
&lt;td style="text-align:center">−19.62&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>SDID&lt;/strong>&lt;/td>
&lt;td>&lt;code>sdid …, method(sdid)&lt;/code>&lt;/td>
&lt;td style="text-align:center">&lt;strong>−15.60&lt;/strong>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="9-inference-how-sure-are-we">9. Inference: how sure are we?&lt;/h2>
&lt;p>A point estimate is not enough; we need a standard error. SDID&amp;rsquo;s variance feeds a familiar normal-approximation confidence interval:&lt;/p>
&lt;p>$$
\hat{\tau}^{sdid} \pm z_{\alpha/2} \sqrt{\hat{V}_{\tau}}
$$&lt;/p>
&lt;p>Arkhangelsky et al. (2021) offer three ways to estimate $\hat{V}_{\tau}$: a &lt;strong>bootstrap&lt;/strong>, a &lt;strong>jackknife&lt;/strong>, and a &lt;strong>placebo&lt;/strong> (permutation) procedure. The choice is not free here — it is forced by our design. With a &lt;strong>single treated unit&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>The &lt;strong>jackknife&lt;/strong> is literally &lt;strong>undefined&lt;/strong>. It works by deleting one unit at a time and re-estimating; when it deletes California, there is no treated unit left, so the treated-removed estimate does not exist.&lt;/li>
&lt;li>The &lt;strong>bootstrap&lt;/strong> relies on resampling &lt;em>many&lt;/em> treated units; its asymptotics require the number of treated units to grow. With one treated unit it is unreliable.&lt;/li>
&lt;li>The &lt;strong>placebo&lt;/strong> procedure is the one valid option. It keeps the controls, repeatedly assigns the treatment structure to a &lt;em>control&lt;/em> state as a fake &amp;ldquo;placebo&amp;rdquo; treatment, re-estimates the effect, and uses the spread of those placebo estimates as the variance.&lt;/li>
&lt;/ul>
&lt;pre>&lt;code class="language-mermaid">graph TD
Q{&amp;quot;How many&amp;lt;br/&amp;gt;treated units?&amp;quot;}
Q --&amp;gt;|&amp;quot;One — e.g. California&amp;quot;| PL[&amp;quot;&amp;lt;b&amp;gt;Placebo / permutation&amp;lt;/b&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;the valid choice here&amp;lt;/i&amp;gt;&amp;quot;]
Q --&amp;gt;|&amp;quot;Many — e.g. staggered adoption&amp;quot;| BJ[&amp;quot;Bootstrap or jackknife&amp;lt;br/&amp;gt;&amp;lt;i&amp;gt;asymptotics in number of treated units&amp;lt;/i&amp;gt;&amp;quot;]
PL --&amp;gt; THIS[&amp;quot;this tutorial&amp;lt;br/&amp;gt;vce(placebo)&amp;quot;]
BJ --&amp;gt; OOS[&amp;quot;out of scope&amp;lt;br/&amp;gt;(needs another design)&amp;quot;]
style Q fill:#141413,stroke:#6a9bcc,color:#fff
style PL fill:#00d4c8,stroke:#141413,color:#141413
style THIS fill:#6a9bcc,stroke:#141413,color:#fff
style BJ fill:#6a9bcc,stroke:#141413,color:#fff
style OOS fill:#d97757,stroke:#141413,color:#fff
&lt;/code>&lt;/pre>
&lt;p>So we run placebo inference, the appropriate choice for a comparative case study.&lt;/p>
&lt;pre>&lt;code class="language-stata">sdid packspercapita state year treated, vce(placebo) seed(1213)
&lt;/code>&lt;/pre>
&lt;pre>&lt;code class="language-text">Synthetic Difference-in-Differences Estimator
-----------------------------------------------------------------------------
packsperca~a | ATT Std. Err. t P&amp;gt;|t| [95% Conf. Interval]
-------------+---------------------------------------------------------------
treated | -15.60383 9.87941 -1.58 0.114 -34.96712 3.75946
-----------------------------------------------------------------------------
95% CIs and p-values are based on large-sample approximations.
&lt;/code>&lt;/pre>
&lt;p>The placebo standard error is &lt;strong>9.88&lt;/strong>, giving a 95% interval of roughly &lt;strong>[−35.0, 3.8]&lt;/strong>. Notice this interval &lt;strong>includes zero&lt;/strong>: by the normal-approximation criterion, we cannot reject &amp;ldquo;no effect&amp;rdquo; at the 5% level ($p = 0.114$). With a single treated unit and a noisy donor pool, the SDID interval is genuinely wide — honest about how hard it is to be certain from one case.&lt;/p>
&lt;p>But the normal approximation is not the only — or the sharpest — way to use the placebo distribution. We can also run an explicit &lt;strong>permutation test&lt;/strong>: assign the placebo treatment to each control state in turn, collect the placebo effects, and ask how California&amp;rsquo;s real estimate ranks against them.&lt;/p>
&lt;pre>&lt;code class="language-stata">* assign each control as a placebo-treated unit, collect placebo ATTs
drop if state==&amp;quot;California&amp;quot;
levelsof state, local(ctrls)
foreach s of local ctrls {
preserve
gen byte ptreat = (state==&amp;quot;`s'&amp;quot;) &amp;amp; (year&amp;gt;=1989)
sdid packspercapita state year ptreat, vce(noinference)
* store e(ATT)
restore
}
&lt;/code>&lt;/pre>
&lt;p>&lt;img src="stata_sdid_placebo_hist.png" alt="California&amp;amp;rsquo;s estimated effect (orange line, −15.6) sits in the extreme left tail of the placebo distribution; almost every control state shows an effect near zero.">&lt;/p>
&lt;p>The placebo effects for control states cluster around &lt;strong>zero&lt;/strong> — reassuring, since those states passed no comparable policy — while California&amp;rsquo;s &lt;strong>−15.6&lt;/strong> lands far in the left tail. Only &lt;strong>1 of 38&lt;/strong> control states produced a placebo effect as large in magnitude as California&amp;rsquo;s, a permutation &lt;strong>p-value of 0.026&lt;/strong>. So the two inferential lenses tell complementary stories: the rank-based permutation test says California&amp;rsquo;s drop is very unlikely to be noise (significant at 5%), while the conservative normal-approximation interval reminds us that, with a single treated unit, the &lt;em>precision&lt;/em> of the magnitude is limited. Reporting both is the honest summary.&lt;/p>
&lt;h3 id="other-inference-designs-out-of-scope">Other inference designs (out of scope)&lt;/h3>
&lt;p>It would be wrong to conclude that bootstrap and jackknife are &amp;ldquo;bad&amp;rdquo; — they are simply built for a &lt;strong>different design&lt;/strong>. They come into their own when there are &lt;strong>many treated units&lt;/strong>, especially under &lt;strong>staggered adoption&lt;/strong>, where units adopt the policy at different times. In that setting the ATT is an average of adoption-cohort-specific effects,&lt;/p>
&lt;p>$$
\widehat{ATT} = \sum_{a \in A} \frac{T_{post}^{a}}{T_{post}}\ \hat{\tau}_a^{sdid}
$$&lt;/p>
&lt;p>and with many treated units the asymptotic arguments behind the bootstrap and jackknife hold. The &lt;code>sdid&lt;/code> command supports all of this — &lt;code>vce(bootstrap)&lt;/code>, &lt;code>vce(jackknife)&lt;/code>, covariate adjustment, and staggered timing — but those tools require a genuinely different research design (multiple treated units adopting at multiple times) than California&amp;rsquo;s single 1989 intervention. We deliberately keep this tutorial to the &lt;strong>block design with one treated unit&lt;/strong>, where the placebo procedure is the right and sufficient tool. The staggered case, with its own estimation and inference, is a natural next tutorial.&lt;/p>
&lt;hr>
&lt;h2 id="10-robustness-and-discussion">10. Robustness and discussion&lt;/h2>
&lt;p>What should we take away about Proposition 99? Three independent constructions of the counterfactual — DiD, synthetic control, and SDID — all agree the policy &lt;strong>reduced&lt;/strong> smoking, with estimates from −15.6 to −27.3 packs per capita. The disagreement is informative rather than alarming: it maps directly onto how much each method trusts the comparison group.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>DiD (−27.35)&lt;/strong> trusts that California would have moved parallel to the &lt;em>average&lt;/em> of 38 heterogeneous states. The pre-period figure shows that average was already diverging from California, so DiD likely overstates the effect.&lt;/li>
&lt;li>&lt;strong>Synthetic control (−19.48)&lt;/strong> fixes the comparison group to states that actually resembled California (Utah, Montana, Nevada). Its pre-period fit is excellent (RMSE 1.66), which is the evidence for its credibility.&lt;/li>
&lt;li>&lt;strong>SDID (−15.60)&lt;/strong> additionally allows a constant level gap and concentrates on the informative late-1980s years. It is the most robust to a violation of exact parallel trends, and the most conservative.&lt;/li>
&lt;/ul>
&lt;p>The honest range, then, is something like &amp;ldquo;Proposition 99 cut cigarette consumption by &lt;strong>roughly 16–20 packs per capita per year&lt;/strong>, plausibly larger by the end of the 1990s,&amp;rdquo; with SDID the preferred single number because it leans least on the assumption most likely to fail.&lt;/p>
&lt;p>A few caveats apply to all three estimates. With &lt;strong>one treated unit&lt;/strong>, statistical power is inherently limited — the SDID confidence interval includes zero even though the permutation test is significant, and no method can fully escape that. The placebo variance assumes &lt;strong>homoskedasticity across units&lt;/strong> (the placebo treatments are drawn only from controls). And like every comparative case study, identification assumes &lt;strong>no other large shock hit California alone&lt;/strong> in 1989 and &lt;strong>no spillovers&lt;/strong> to the donor states (if Californians bought cigarettes across state lines, neighboring donors are contaminated). These are assumptions to argue substantively, not settle statistically.&lt;/p>
&lt;hr>
&lt;h2 id="11-summary-and-key-takeaways">11. Summary and key takeaways&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Method.&lt;/strong> SDID is one weighted two-way fixed-effects regression. DiD is the special case with uniform weights; synthetic control is the special case with unit weights but no time weights and no unit fixed effect. SDID uses &lt;strong>both&lt;/strong> unit and time weights and keeps the unit fixed effect, so it matches California&amp;rsquo;s pre-period &lt;em>trend&lt;/em> while allowing a constant &lt;em>level&lt;/em> gap.&lt;/li>
&lt;li>&lt;strong>Data.&lt;/strong> On the Proposition 99 panel, the estimates are DiD &lt;strong>−27.35&lt;/strong>, synthetic control &lt;strong>−19.48&lt;/strong>, and SDID &lt;strong>−15.60&lt;/strong> packs per capita — the same direction, with magnitude shrinking as the comparison group becomes more credible. SDID&amp;rsquo;s time weights land entirely on &lt;strong>1986–1988&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>One framework.&lt;/strong> The single &lt;code>sdid&lt;/code> command reproduced the hand-computed 2×2 DiD &lt;em>exactly&lt;/em> (−27.35) and the standalone &lt;code>synth2&lt;/code> synthetic control closely (−19.62 vs −19.48), confirming that all three are special cases of one estimator and can be run, with inference and graphs, from one command.&lt;/li>
&lt;li>&lt;strong>Inference.&lt;/strong> With a single treated unit, &lt;strong>placebo&lt;/strong> is the valid procedure: jackknife is undefined and the bootstrap is unreliable. The placebo SE is 9.88 (95% CI [−35.0, 3.8], which includes zero), while the permutation test gives &lt;strong>p = 0.026&lt;/strong>. Report both.&lt;/li>
&lt;li>&lt;strong>Limitation and next step.&lt;/strong> One treated unit means limited power. The natural extension is &lt;strong>staggered adoption&lt;/strong> with many treated units, where &lt;code>vce(bootstrap)&lt;/code> and &lt;code>vce(jackknife)&lt;/code> become appropriate and covariates can be added — a different design, and a good follow-up tutorial.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="12-exercises">12. Exercises&lt;/h2>
&lt;ol>
&lt;li>&lt;strong>Weights side by side.&lt;/strong> Re-run &lt;code>sdid …, method(sc) vce(noinference) returnweights&lt;/code> and compare its unit weights to the &lt;code>synth2&lt;/code> donor weights from Section 6. Which states appear in both? Why does the &lt;code>sdid&lt;/code> version spread weight more widely? (Hint: the ridge penalty $\zeta$.)&lt;/li>
&lt;li>&lt;strong>Placebo stability.&lt;/strong> Re-estimate &lt;code>sdid …, vce(placebo) seed(1213)&lt;/code> with a different &lt;code>seed()&lt;/code> and with more replications via &lt;code>reps()&lt;/code>. How much does the standard error move? What does that tell you about reading a single placebo SE to three decimal places?&lt;/li>
&lt;li>&lt;strong>Time weights matter.&lt;/strong> Inspect &lt;code>e(lambda)&lt;/code> after the SDID run and confirm the weight on 1986–1988. Then think through: if you forced uniform time weights (as DiD and SC do), would you expect the estimate to move toward or away from the DiD number? Check your intuition by comparing &lt;code>method(sdid)&lt;/code> with &lt;code>method(sc)&lt;/code>.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="references">References&lt;/h2>
&lt;ol>
&lt;li>Arkhangelsky, D., Athey, S., Hsiao, D. A., Imbens, G. W., and Wager, S. (2021). &lt;a href="https://doi.org/10.1257/aer.20190159" target="_blank" rel="noopener">Synthetic Difference-in-Differences&lt;/a>. &lt;em>American Economic Review&lt;/em> 111(12): 4088–4118.&lt;/li>
&lt;li>Clarke, D., Pailañir, D., Athey, S., and Imbens, G. (2024). &lt;a href="https://doi.org/10.1177/1536867X241297184" target="_blank" rel="noopener">On Synthetic Difference-in-Differences and Related Estimation Methods in Stata&lt;/a>. &lt;em>The Stata Journal&lt;/em> (st0757). The &lt;code>sdid&lt;/code> command.&lt;/li>
&lt;li>Abadie, A., Diamond, A., and Hainmueller, J. (2010). &lt;a href="https://doi.org/10.1198/jasa.2009.ap08746" target="_blank" rel="noopener">Synthetic Control Methods for Comparative Case Studies: Estimating the Effect of California&amp;rsquo;s Tobacco Control Program&lt;/a>. &lt;em>Journal of the American Statistical Association&lt;/em> 105(490): 493–505.&lt;/li>
&lt;li>Abadie, A., and Gardeazabal, J. (2003). &lt;a href="https://doi.org/10.1257/000282803321455188" target="_blank" rel="noopener">The Economic Costs of Conflict: A Case Study of the Basque Country&lt;/a>. &lt;em>American Economic Review&lt;/em> 93(1): 113–132.&lt;/li>
&lt;li>Yan, G., and Chen, Q. (2023). &lt;a href="https://doi.org/10.1177/1536867X231195278" target="_blank" rel="noopener">synth2: Synthetic Control Method with Placebo Tests, Robustness Test and Visualization&lt;/a>. &lt;em>The Stata Journal&lt;/em> 23(3): 597–624. The &lt;code>synth2&lt;/code> command.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Related tutorials on this site:&lt;/strong> &lt;a href="https://carlos-mendez.org/post/stata_sc/">Synthetic control in Stata&lt;/a> · &lt;a href="https://carlos-mendez.org/post/stata_did/">Difference-in-differences in Stata&lt;/a> · &lt;a href="https://carlos-mendez.org/post/stata_honestdid/">Sensitivity analysis for parallel trends (honestdid)&lt;/a> · &lt;a href="https://carlos-mendez.org/post/r_sc_bayes_spatial/">Bayesian spatial synthetic control for Proposition 99 (R)&lt;/a>&lt;/p>
&lt;h2 id="acknowledgments">Acknowledgments&lt;/h2>
&lt;p>The analysis uses the &lt;code>sdid&lt;/code> (Clarke, Pailañir, Athey, and Imbens) and &lt;code>synth2&lt;/code> (Yan and Chen) Stata packages and the Proposition 99 dataset distributed with &lt;code>sdid&lt;/code>. AI tools (Claude Code, with NotebookLM for the audio summary) assisted in drafting and exposition; all code was executed and all numbers verified by the author, who is responsible for any remaining errors.&lt;/p>
&lt;hr>
&lt;style>
.podcast-overlay {
display: none;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 9999;
animation: podSlideUp 0.35s ease-out;
}
@keyframes podSlideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.podcast-overlay.pod-closing {
animation: podSlideDown 0.3s ease-in forwards;
}
@keyframes podSlideDown {
from { transform: translateY(0); }
to { transform: translateY(100%); }
}
.podcast-container {
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
padding: 18px 24px 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
box-shadow: 0 -4px 32px rgba(0,0,0,0.5);
border-top: 1px solid rgba(106,155,204,0.2);
}
.podcast-inner {
max-width: 800px;
margin: 0 auto;
}
.podcast-top-row {
display: flex;
align-items: center;
gap: 14px;
margin-bottom: 14px;
}
.podcast-icon {
width: 42px;
height: 42px;
background: linear-gradient(135deg, #d97757, #e8956a);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.podcast-icon svg {
width: 22px;
height: 22px;
fill: #fff;
}
.podcast-title-block {
flex: 1;
min-width: 0;
}
.podcast-title-block h4 {
margin: 0 0 1px 0;
color: #f0ece2;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.02em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.podcast-title-block span {
color: #8b9dc3;
font-size: 11px;
}
.podcast-close-btn {
background: none;
border: none;
cursor: pointer;
padding: 6px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
flex-shrink: 0;
}
.podcast-close-btn:hover {
background: rgba(255,255,255,0.1);
}
.podcast-close-btn svg {
width: 20px;
height: 20px;
fill: #8b9dc3;
}
.podcast-progress-wrap {
margin-bottom: 12px;
}
.podcast-time-row {
display: flex;
justify-content: space-between;
font-size: 11px;
color: #8b9dc3;
margin-bottom: 5px;
font-variant-numeric: tabular-nums;
}
.podcast-bar-bg {
width: 100%;
height: 6px;
background: rgba(255,255,255,0.1);
border-radius: 3px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: height 0.15s;
}
.podcast-bar-buffered {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: rgba(106,155,204,0.25);
border-radius: 3px;
transition: width 0.3s;
}
.podcast-bar-progress {
position: absolute;
top: 0;
left: 0;
height: 100%;
background: linear-gradient(90deg, #6a9bcc, #00d4c8);
border-radius: 3px;
transition: width 0.1s linear;
}
.podcast-bar-bg:hover {
height: 10px;
margin-top: -2px;
}
.podcast-controls-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.podcast-transport {
display: flex;
align-items: center;
gap: 8px;
}
.podcast-btn {
background: none;
border: none;
cursor: pointer;
padding: 4px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.2s;
}
.podcast-btn svg {
fill: #c8d0e0;
transition: fill 0.2s;
}
.podcast-btn:hover svg {
fill: #f0ece2;
}
.podcast-btn-skip {
position: relative;
}
.podcast-btn-skip span {
position: absolute;
font-size: 7px;
font-weight: 700;
color: #c8d0e0;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
margin-top: 1px;
}
.podcast-btn-play {
width: 48px;
height: 48px;
background: linear-gradient(135deg, #d97757, #e8956a);
border-radius: 50%;
box-shadow: 0 3px 12px rgba(217,119,87,0.4);
transition: all 0.2s;
}
.podcast-btn-play:hover {
transform: scale(1.08);
box-shadow: 0 5px 20px rgba(217,119,87,0.5);
}
.podcast-btn-play svg {
fill: #fff;
width: 22px;
height: 22px;
}
.podcast-extras {
display: flex;
align-items: center;
gap: 10px;
}
.podcast-volume-wrap {
display: flex;
align-items: center;
gap: 5px;
}
.podcast-volume-wrap svg {
fill: #8b9dc3;
width: 16px;
height: 16px;
cursor: pointer;
flex-shrink: 0;
}
.podcast-volume-wrap svg:hover {
fill: #c8d0e0;
}
.podcast-volume-slider {
-webkit-appearance: none;
appearance: none;
width: 60px;
height: 4px;
background: rgba(255,255,255,0.12);
border-radius: 2px;
outline: none;
cursor: pointer;
}
.podcast-volume-slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
background: #6a9bcc;
border-radius: 50%;
cursor: pointer;
}
.podcast-speed-btn {
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.12);
color: #c8d0e0;
font-size: 11px;
font-weight: 600;
padding: 3px 9px;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
font-family: inherit;
min-width: 40px;
text-align: center;
}
.podcast-speed-btn:hover {
background: rgba(106,155,204,0.2);
border-color: #6a9bcc;
color: #f0ece2;
}
.podcast-download-btn {
background: none;
border: 1px solid rgba(255,255,255,0.12);
border-radius: 8px;
padding: 4px 10px;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
color: #8b9dc3;
font-size: 11px;
font-family: inherit;
text-decoration: none;
transition: all 0.2s;
}
.podcast-download-btn:hover {
border-color: #6a9bcc;
color: #f0ece2;
background: rgba(106,155,204,0.1);
}
.podcast-download-btn svg {
width: 14px;
height: 14px;
fill: currentColor;
}
@media (max-width: 600px) {
.podcast-container { padding: 14px 16px 16px; }
.podcast-volume-wrap { display: none; }
.podcast-title-block h4 { font-size: 13px; }
.podcast-extras { gap: 8px; }
}
&lt;/style>
&lt;div class="podcast-overlay" id="podOverlay">
&lt;div class="podcast-container">
&lt;div class="podcast-inner">
&lt;audio id="podAudio" preload="none" src="https://files.catbox.moe/wybbqc.m4a">&lt;/audio>
&lt;div class="podcast-top-row">
&lt;div class="podcast-icon">
&lt;svg viewBox="0 0 24 24">&lt;path d="M12 1a5 5 0 0 0-5 5v4a5 5 0 0 0 10 0V6a5 5 0 0 0-5-5zm0 16a7 7 0 0 1-7-7H3a9 9 0 0 0 8 8.94V22h2v-3.06A9 9 0 0 0 21 10h-2a7 7 0 0 1-7 7z"/>&lt;/svg>
&lt;/div>
&lt;div class="podcast-title-block">
&lt;h4>AI Podcast: Synthetic Difference-in-Differences&lt;/h4>
&lt;span id="podDurationLabel">Click play to load&lt;/span>
&lt;/div>
&lt;button class="podcast-close-btn" onclick="podClose()" title="Close player">
&lt;svg viewBox="0 0 24 24">&lt;path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/>&lt;/svg>
&lt;/button>
&lt;/div>
&lt;div class="podcast-progress-wrap">
&lt;div class="podcast-time-row">
&lt;span id="podCurrent">0:00&lt;/span>
&lt;span id="podDuration">0:00&lt;/span>
&lt;/div>
&lt;div class="podcast-bar-bg" id="podBarBg" onclick="podSeek(event)">
&lt;div class="podcast-bar-buffered" id="podBuffered">&lt;/div>
&lt;div class="podcast-bar-progress" id="podProgress">&lt;/div>
&lt;/div>
&lt;/div>
&lt;div class="podcast-controls-row">
&lt;div class="podcast-transport">
&lt;button class="podcast-btn podcast-btn-skip" onclick="podSkip(-15)" title="Back 15s">
&lt;svg width="26" height="26" viewBox="0 0 24 24">&lt;path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>&lt;/svg>
&lt;span>15&lt;/span>
&lt;/button>
&lt;button class="podcast-btn podcast-btn-play" id="podPlayBtn" onclick="podToggle()" title="Play">
&lt;svg id="podIconPlay" viewBox="0 0 24 24">&lt;path d="M8 5v14l11-7z"/>&lt;/svg>
&lt;svg id="podIconPause" viewBox="0 0 24 24" style="display:none">&lt;path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>&lt;/svg>
&lt;/button>
&lt;button class="podcast-btn podcast-btn-skip" onclick="podSkip(15)" title="Forward 15s">
&lt;svg width="26" height="26" viewBox="0 0 24 24">&lt;path d="M12 5V1l5 5-5 5V7c-3.31 0-6 2.69-6 6s2.69 6 6 6 6-2.69 6-6h2c0 4.42-3.58 8-8 8s-8-3.58-8-8 3.58-8 8-8z"/>&lt;/svg>
&lt;span>15&lt;/span>
&lt;/button>
&lt;/div>
&lt;div class="podcast-extras">
&lt;div class="podcast-volume-wrap">
&lt;svg id="podVolIcon" onclick="podMute()" viewBox="0 0 24 24">&lt;path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 8.5v7a4.47 4.47 0 0 0 2.5-3.5zM14 3.23v2.06a6.51 6.51 0 0 1 0 13.42v2.06A8.51 8.51 0 0 0 14 3.23z"/>&lt;/svg>
&lt;input type="range" class="podcast-volume-slider" id="podVolume" min="0" max="1" step="0.05" value="0.8">
&lt;/div>
&lt;button class="podcast-speed-btn" id="podSpeedBtn" onclick="podCycleSpeed()" title="Playback speed">1x&lt;/button>
&lt;a class="podcast-download-btn" href="https://files.catbox.moe/wybbqc.m4a" target="_blank" rel="noopener" title="Stream">
&lt;svg viewBox="0 0 24 24">&lt;path d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"/>&lt;/svg>
&lt;/a>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;/div>
&lt;script>
(function(){
var overlay = document.getElementById('podOverlay');
var a = document.getElementById('podAudio');
var speeds = [0.75, 1, 1.25, 1.5, 2];
var si = 1;
var opened = false;
function fmt(s){
if(isNaN(s)) return '0:00';
var m=Math.floor(s/60), sec=Math.floor(s%60);
return m+':'+(sec&lt;10?'0':'')+sec;
}
document.addEventListener('click', function(e){
var link = e.target.closest('a.btn-page-header');
if(!link) return;
var text = link.textContent.trim();
if(text.indexOf('AI Podcast') === -1) return;
e.preventDefault();
e.stopPropagation();
overlay.style.display = 'block';
overlay.classList.remove('pod-closing');
if(!opened){
a.preload = 'metadata';
a.load();
opened = true;
}
});
a.volume = 0.8;
a.addEventListener('loadedmetadata', function(){
document.getElementById('podDuration').textContent = fmt(a.duration);
document.getElementById('podDurationLabel').textContent = fmt(a.duration) + ' minutes';
});
a.addEventListener('timeupdate', function(){
document.getElementById('podCurrent').textContent = fmt(a.currentTime);
var pct = a.duration ? (a.currentTime/a.duration)*100 : 0;
document.getElementById('podProgress').style.width = pct+'%';
});
a.addEventListener('progress', function(){
if(a.buffered.length>0){
var pct = (a.buffered.end(a.buffered.length-1)/a.duration)*100;
document.getElementById('podBuffered').style.width = pct+'%';
}
});
a.addEventListener('ended', function(){
document.getElementById('podIconPlay').style.display='';
document.getElementById('podIconPause').style.display='none';
});
window.podToggle = function(){
if(a.paused){a.play();document.getElementById('podIconPlay').style.display='none';document.getElementById('podIconPause').style.display='';}
else{a.pause();document.getElementById('podIconPlay').style.display='';document.getElementById('podIconPause').style.display='none';}
};
window.podSkip = function(s){a.currentTime = Math.max(0,Math.min(a.duration||0,a.currentTime+s));};
window.podSeek = function(e){
var rect = document.getElementById('podBarBg').getBoundingClientRect();
var pct = (e.clientX - rect.left)/rect.width;
a.currentTime = pct * (a.duration||0);
};
window.podMute = function(){
a.muted = !a.muted;
document.getElementById('podVolume').value = a.muted ? 0 : a.volume;
};
window.podCycleSpeed = function(){
si = (si+1) % speeds.length;
a.playbackRate = speeds[si];
document.getElementById('podSpeedBtn').textContent = speeds[si]+'x';
};
window.podClose = function(){
overlay.classList.add('pod-closing');
setTimeout(function(){ overlay.style.display='none'; }, 300);
a.pause();
document.getElementById('podIconPlay').style.display='';
document.getElementById('podIconPause').style.display='none';
};
document.getElementById('podVolume').addEventListener('input', function(){
a.volume = this.value;
a.muted = false;
});
if(window.location.hash === '#podcast-player'){
overlay.style.display = 'block';
a.preload = 'metadata';
a.load();
opened = true;
}
})();
&lt;/script></description></item></channel></rss>