|
11 | 11 | <meta name="generator" content="quarto-1.5.57">
|
12 | 12 |
|
13 | 13 | <meta name="author" content="Paul Schrimpf">
|
14 |
| - <meta name="dcterms.date" content="2024-09-18"> |
| 14 | + <meta name="dcterms.date" content="2024-09-23"> |
15 | 15 | <title>ECON 626 – Identification</title>
|
16 | 16 | <meta name="apple-mobile-web-app-capable" content="yes">
|
17 | 17 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
|
30 | 30 | margin: 0 0.8em 0.2em -1em; /* quarto-specific, see https://github.com/quarto-dev/quarto-cli/issues/4556 */
|
31 | 31 | vertical-align: middle;
|
32 | 32 | }
|
| 33 | + /* CSS for syntax highlighting */ |
| 34 | + pre > code.sourceCode { white-space: pre; position: relative; } |
| 35 | + pre > code.sourceCode > span { line-height: 1.25; } |
| 36 | + pre > code.sourceCode > span:empty { height: 1.2em; } |
| 37 | + .sourceCode { overflow: visible; } |
| 38 | + code.sourceCode > span { color: inherit; text-decoration: inherit; } |
| 39 | + div.sourceCode { margin: 1em 0; } |
| 40 | + pre.sourceCode { margin: 0; } |
| 41 | + @media screen { |
| 42 | + div.sourceCode { overflow: auto; } |
| 43 | + } |
| 44 | + @media print { |
| 45 | + pre > code.sourceCode { white-space: pre-wrap; } |
| 46 | + pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; } |
| 47 | + } |
| 48 | + pre.numberSource code |
| 49 | + { counter-reset: source-line 0; } |
| 50 | + pre.numberSource code > span |
| 51 | + { position: relative; left: -4em; counter-increment: source-line; } |
| 52 | + pre.numberSource code > span > a:first-child::before |
| 53 | + { content: counter(source-line); |
| 54 | + position: relative; left: -1em; text-align: right; vertical-align: baseline; |
| 55 | + border: none; display: inline-block; |
| 56 | + -webkit-touch-callout: none; -webkit-user-select: none; |
| 57 | + -khtml-user-select: none; -moz-user-select: none; |
| 58 | + -ms-user-select: none; user-select: none; |
| 59 | + padding: 0 4px; width: 4em; |
| 60 | + } |
| 61 | + pre.numberSource { margin-left: 3em; padding-left: 4px; } |
| 62 | + div.sourceCode |
| 63 | + { color: #f8f8f2; } |
| 64 | + @media screen { |
| 65 | + pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } |
| 66 | + } |
| 67 | + code span { color: #f8f8f2; } /* Normal */ |
| 68 | + code span.al { color: #f07178; background-color: #2a0f15; font-weight: bold; } /* Alert */ |
| 69 | + code span.an { color: #d4d0ab; } /* Annotation */ |
| 70 | + code span.at { color: #00e0e0; } /* Attribute */ |
| 71 | + code span.bn { color: #d4d0ab; } /* BaseN */ |
| 72 | + code span.bu { color: #abe338; } /* BuiltIn */ |
| 73 | + code span.cf { color: #ffa07a; font-weight: bold; } /* ControlFlow */ |
| 74 | + code span.ch { color: #abe338; } /* Char */ |
| 75 | + code span.cn { color: #ffd700; } /* Constant */ |
| 76 | + code span.co { color: #f8f8f2; font-style: italic; } /* Comment */ |
| 77 | + code span.cv { color: #ffd700; } /* CommentVar */ |
| 78 | + code span.do { color: #f8f8f2; } /* Documentation */ |
| 79 | + code span.dt { color: #ffa07a; } /* DataType */ |
| 80 | + code span.dv { color: #d4d0ab; } /* DecVal */ |
| 81 | + code span.er { color: #f07178; text-decoration: underline; } /* Error */ |
| 82 | + code span.ex { color: #00e0e0; font-weight: bold; } /* Extension */ |
| 83 | + code span.fl { color: #d4d0ab; } /* Float */ |
| 84 | + code span.fu { color: #ffa07a; } /* Function */ |
| 85 | + code span.im { color: #abe338; } /* Import */ |
| 86 | + code span.in { color: #d4d0ab; } /* Information */ |
| 87 | + code span.kw { color: #ffa07a; font-weight: bold; } /* Keyword */ |
| 88 | + code span.op { color: #ffa07a; } /* Operator */ |
| 89 | + code span.ot { color: #00e0e0; } /* Other */ |
| 90 | + code span.pp { color: #dcc6e0; } /* Preprocessor */ |
| 91 | + code span.re { color: #00e0e0; background-color: #f8f8f2; } /* RegionMarker */ |
| 92 | + code span.sc { color: #abe338; } /* SpecialChar */ |
| 93 | + code span.ss { color: #abe338; } /* SpecialString */ |
| 94 | + code span.st { color: #abe338; } /* String */ |
| 95 | + code span.va { color: #00e0e0; } /* Variable */ |
| 96 | + code span.vs { color: #abe338; } /* VerbatimString */ |
| 97 | + code span.wa { color: #dcc6e0; } /* Warning */ |
33 | 98 | /* CSS for citations */
|
34 | 99 | div.csl-bib-body { }
|
35 | 100 | div.csl-entry {
|
@@ -363,7 +428,7 @@ <h1 class="title">Identification</h1>
|
363 | 428 | </div>
|
364 | 429 | </div>
|
365 | 430 |
|
366 |
| - <p class="date">2024-09-18</p> |
| 431 | + <p class="date">2024-09-23</p> |
367 | 432 | </section>
|
368 | 433 | <section id="reading" class="slide level2">
|
369 | 434 | <h2>Reading</h2>
|
@@ -748,6 +813,22 @@ <h2>Example: Regression</h2>
|
748 | 813 | \]</span></li>
|
749 | 814 | </ul>
|
750 | 815 | </section>
|
| 816 | +<section id="caution" class="slide level2"> |
| 817 | +<h2>Caution</h2> |
| 818 | +<ul> |
| 819 | +<li><p>Regression being a linear approximation to <span class="math inline">\(\Er[Y|X]\)</span> does not mean <span class="math inline">\(\beta = \Er[X X']^{-1} \Er[X Y]\)</span> necessarily has the sign you want</p></li> |
| 820 | +<li><p>In example below, <span class="math inline">\(\Er[Y|x_1=1, x_2] > \Er[Y|x_1=9,x_2]\)</span>, but <span class="math inline">\(\beta_1 < 0\)</span></p></li> |
| 821 | +</ul> |
| 822 | +<div class="sourceCode" id="cb1"><pre class="sourceCode numberSource {julia} number-lines code-with-copy"><code class="sourceCode"><span id="cb1-1"><a></a>using LinearAlgebra</span> |
| 823 | +<span id="cb1-2"><a></a>n = 10_000</span> |
| 824 | +<span id="cb1-3"><a></a>EYX(x) = x[2]>0 ? -1.0 + 1.0*x[1] : (1.0 + 0.1*x[1])</span> |
| 825 | +<span id="cb1-4"><a></a>x2 = randn(n)</span> |
| 826 | +<span id="cb1-5"><a></a>x1 = (x2*3 + randn(n) .> 0)</span> |
| 827 | +<span id="cb1-6"><a></a>X = hcat(x1,x2)</span> |
| 828 | +<span id="cb1-7"><a></a>y = EYX.(eachrow(X)) + randn(n)</span> |
| 829 | +<span id="cb1-8"><a></a>X = hcat(ones(n), X)</span> |
| 830 | +<span id="cb1-9"><a></a>β = (X'*X) \ (X'*y)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div> |
| 831 | +</section> |
751 | 832 | <section id="example-potential-outcomes-3" class="slide level2">
|
752 | 833 | <h2>Example: Potential Outcomes</h2>
|
753 | 834 | <ul>
|
|
0 commit comments