Skip to content

Commit e716bcd

Browse files
committed
deploy: bc60b1c
1 parent dbcb1e8 commit e716bcd

28 files changed

+2539
-2539
lines changed

changelog.html

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

compare-fixest-pyfixest.html

Lines changed: 42 additions & 42 deletions
Large diffs are not rendered by default.

difference-in-differences.html

Lines changed: 35 additions & 35 deletions
Large diffs are not rendered by default.

marginaleffects.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ <h1 class="title">Marginal Effects and Hypothesis Tests via <code>marginaleffect
260260

261261

262262
<p>We can compute marginal effects and linear and non-linear hypothesis tests via the excellent <a href="https://github.com/vincentarelbundock/pymarginaleffects">marginaleffects</a> package.</p>
263-
<div id="0983a637" class="cell" data-execution_count="1">
263+
<div id="441de77e" class="cell" data-execution_count="1">
264264
<div class="sourceCode cell-code" id="cb1"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="im">from</span> marginaleffects <span class="im">import</span> hypotheses</span>
265265
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
266266
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="im">import</span> pyfixest <span class="im">as</span> pf</span>
@@ -271,7 +271,7 @@ <h1 class="title">Marginal Effects and Hypothesis Tests via <code>marginaleffect
271271
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a>fit.tidy()</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
272272
<div class="cell-output cell-output-display">
273273

274-
<div id="RPL6yI"></div>
274+
<div id="FIRark"></div>
275275
<script type="text/javascript" data-lets-plot-script="library">
276276
if(!window.letsPlotCallQueue) {
277277
window.letsPlotCallQueue = [];
@@ -295,17 +295,17 @@ <h1 class="title">Marginal Effects and Hypothesis Tests via <code>marginaleffect
295295
var div = document.createElement("div");
296296
div.style.color = 'darkred';
297297
div.textContent = 'Error loading Lets-Plot JS';
298-
document.getElementById("RPL6yI").appendChild(div);
298+
document.getElementById("FIRark").appendChild(div);
299299
};
300-
var e = document.getElementById("RPL6yI");
300+
var e = document.getElementById("FIRark");
301301
e.appendChild(script);
302302
})()
303303
</script>
304304

305305
</div>
306306
<div class="cell-output cell-output-display">
307307

308-
<div id="p6ubAX"></div>
308+
<div id="2I1ZLr"></div>
309309
<script type="text/javascript" data-lets-plot-script="library">
310310
if(!window.letsPlotCallQueue) {
311311
window.letsPlotCallQueue = [];
@@ -329,9 +329,9 @@ <h1 class="title">Marginal Effects and Hypothesis Tests via <code>marginaleffect
329329
var div = document.createElement("div");
330330
div.style.color = 'darkred';
331331
div.textContent = 'Error loading Lets-Plot JS';
332-
document.getElementById("p6ubAX").appendChild(div);
332+
document.getElementById("2I1ZLr").appendChild(div);
333333
};
334-
var e = document.getElementById("p6ubAX");
334+
var e = document.getElementById("2I1ZLr");
335335
e.appendChild(script);
336336
})()
337337
</script>
@@ -398,7 +398,7 @@ <h1 class="title">Marginal Effects and Hypothesis Tests via <code>marginaleffect
398398
</div>
399399
<p>Suppose we were interested in testing the hypothesis that <span class="math inline">\(X_{1} = X_{2}\)</span>. Given the relatively large differences in coefficients and small standard errors, we will likely reject the null that the two parameters are equal.</p>
400400
<p>We can run the formal test via the <code>hypotheses</code> function from the <code>marginaleffects</code> package.</p>
401-
<div id="0c5b635c" class="cell" data-execution_count="2">
401+
<div id="01f48cb6" class="cell" data-execution_count="2">
402402
<div class="sourceCode cell-code" id="cb2"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>hypotheses(fit, <span class="st">"X1 - X2 = 0"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
403403
<div class="cell-output cell-output-display" data-execution_count="2">
404404
<div><style>
@@ -454,7 +454,7 @@ <h2 class="anchored" data-anchor-id="non-linear-hypothesis-tests-ratio-estimates
454454
<p>We can also test run-linear hypotheses, in which case <code>marginaleffects</code> will automatically compute correct standard errors based on the estimated covariance matrix and the Delta method. This is for example useful for computing inferential statistics for the “relative uplift” in an AB test.</p>
455455
<p>For the moment, let’s assume that <span class="math inline">\(X1\)</span> is a randomly assigned treatment variable. As before, <span class="math inline">\(Y\)</span> is our variable / KPI of interest.</p>
456456
<p>Under randomization, the model intercept measures the “baseline”, i.e.&nbsp;the population average of <span class="math inline">\(Y\)</span> in the absence of treatment. To compute a relative uplift, we might compute</p>
457-
<div id="f3d91957" class="cell" data-execution_count="3">
457+
<div id="4785fa25" class="cell" data-execution_count="3">
458458
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a>(fit.coef().xs(<span class="st">"X1"</span>) <span class="op">/</span> fit.coef().xs(<span class="st">"Intercept"</span>) <span class="op">-</span> <span class="dv">1</span>) <span class="op">*</span> <span class="dv">100</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
459459
<div class="cell-output cell-output-display" data-execution_count="3">
460460
<pre><code>np.float64(-211.71906665561212)</code></pre>
@@ -481,7 +481,7 @@ <h3 class="anchored" data-anchor-id="the-multivariate-delta-method">The Multivar
481481
<section id="using-the-delta-method-via-marginaleffects" class="level3">
482482
<h3 class="anchored" data-anchor-id="using-the-delta-method-via-marginaleffects">Using the Delta Method via <code>marginaleffects</code>:</h3>
483483
<p>We can employ the Delta Method via <code>marginaleffects</code> via the <code>hypotheses</code> function:</p>
484-
<div id="74b73e5a" class="cell" data-execution_count="4">
484+
<div id="ab476788" class="cell" data-execution_count="4">
485485
<div class="sourceCode cell-code" id="cb5"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a>hypotheses(fit, <span class="st">"(X1 / Intercept - 1) * 100 = 0"</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
486486
<div class="cell-output cell-output-display" data-execution_count="4">
487487
<div><style>

quarto_example/QuartoExample.pdf

-10 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)