Skip to content

Commit 14bf4e9

Browse files
authored
Merge pull request #11 from CausalInferenceLab/feat/rdd-fuzzy-video-embed
docs(rdd): Fuzzy RDD 노트북 개선 및 강의 영상 임베드
2 parents 58d39ea + 0cdfaaa commit 14bf4e9

47 files changed

Lines changed: 9273 additions & 2220 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ videos/*/preview/
2424
# Large data files (cached locally, not tracked in git)
2525
book/fdc/data/
2626

27+
# Jupyter
28+
.ipynb_checkpoints/
29+
2730
# OS
2831
.DS_Store
2932

book/myst.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ project:
4141
- title: RDD
4242
children:
4343
- title: Basics
44-
file: rdd/rdd_basic_en.ipynb
45-
- file: rdd/rdd_basic_ko.ipynb
44+
file: rdd/01_rdd_basic_en.ipynb
45+
- file: rdd/01_rdd_basic_ko.ipynb
4646
hidden: true
4747
- title: Fuzzy RDD
48-
file: rdd/fuzzy_rdd_en.ipynb
49-
- file: rdd/fuzzy_rdd_ko.ipynb
48+
file: rdd/02_fuzzy_rdd_en.ipynb
49+
- file: rdd/02_fuzzy_rdd_ko.ipynb
5050
hidden: true
5151
- title: IPW
5252
children:
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,12 @@
390390
"Note that this is a **local** effect, limited to units near the cutoff. RDD cannot tell us how a scholarship would affect students who scored in the 340s."
391391
]
392392
},
393+
{
394+
"cell_type": "markdown",
395+
"id": "7446c81b",
396+
"source": "```{quiz} rdd-late-scope\n:single:\n:bank: rdd/quizzes.json\n:lang: en\n```",
397+
"metadata": {}
398+
},
393399
{
394400
"attachments": {},
395401
"cell_type": "markdown",
@@ -1074,4 +1080,4 @@
10741080
},
10751081
"nbformat": 4,
10761082
"nbformat_minor": 5
1077-
}
1083+
}
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
},
2727
"outputs": [
2828
{
29-
"output_type": "execute_result",
29+
"data": {
30+
"text/html": [
31+
"<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/65C9J1yJwhc?si=y52uzSAVn_IFY7Gb\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>"
32+
],
33+
"text/plain": [
34+
"<IPython.core.display.HTML object>"
35+
]
36+
},
3037
"execution_count": 22,
3138
"metadata": {},
32-
"data": {
33-
"text/plain": "<IPython.core.display.HTML object>",
34-
"text/html": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/65C9J1yJwhc?si=y52uzSAVn_IFY7Gb\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen></iframe>"
35-
}
39+
"output_type": "execute_result"
3640
}
3741
],
3842
"source": [
@@ -379,6 +383,18 @@
379383
"단, 이 효과는 기준점 근방 개체들에 한정된 **국소적(local)** 효과임을 기억해야 합니다. 수능 340점대 학생들에게 장학금이 어떤 효과를 낼지는 RDD로 알 수 없습니다."
380384
]
381385
},
386+
{
387+
"cell_type": "markdown",
388+
"id": "rdd-quiz-late-scope",
389+
"metadata": {},
390+
"source": [
391+
"```{quiz} rdd-late-scope\n",
392+
":single:\n",
393+
":bank: rdd/quizzes.json\n",
394+
":lang: ko\n",
395+
"```"
396+
]
397+
},
382398
{
383399
"cell_type": "markdown",
384400
"id": "40000001",

book/rdd/02_fuzzy_rdd_en.ipynb

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

book/rdd/02_fuzzy_rdd_ko.ipynb

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

book/rdd/fuzzy_rdd_en.ipynb

Lines changed: 0 additions & 1100 deletions
This file was deleted.

book/rdd/fuzzy_rdd_ko.ipynb

Lines changed: 0 additions & 1110 deletions
This file was deleted.

book/rdd/quizzes.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"sets": {},
3+
"fuzzy-rdd-complier": {
4+
"question": {
5+
"ko": "Fuzzy RDD의 $\\tau^{Fuzzy}$는 어떤 집단의 처치 효과를 추정하는가?",
6+
"en": "Whose treatment effect does the Fuzzy RDD estimand $\\tau^{Fuzzy}$ identify?"
7+
},
8+
"options": [
9+
{
10+
"ko": "임계점 근방의 모든 개체 (Always-taker, Never-taker 포함)",
11+
"en": "All individuals near the cutoff (including Always-takers and Never-takers)"
12+
},
13+
{
14+
"ko": "임계점 근방의 순응자(Complier) — 자격 때문에 비로소 처치를 받게 된 사람",
15+
"en": "Compliers near the cutoff — those who take treatment only because they crossed the threshold"
16+
},
17+
{
18+
"ko": "임계점 근방에서 실제로 처치를 받은 모든 개체 (Always-taker 포함)",
19+
"en": "All treated individuals near the cutoff (including Always-takers)"
20+
}
21+
],
22+
"answer": 1,
23+
"explanation": {
24+
"ko": "Wald 추정량($\\widehat{\\text{ITT}}_Y / \\widehat{\\text{ITT}}_D$)의 분자·분모 모두 자격 때문에 행동이 바뀐 순응자만 반영합니다. 자격과 무관하게 항상 받거나(Always-taker) 항상 거부하는(Never-taker) 사람은 분자·분모에서 상쇄되어 추정량에 잡히지 않습니다.",
25+
"en": "Both the numerator and denominator of the Wald estimator capture only Compliers — those whose treatment status changes because of the instrument. Always-takers and Never-takers cancel out and do not contribute to the estimate."
26+
}
27+
},
28+
"fuzzy-rdd-jump-size": {
29+
"question": {
30+
"ko": "Fuzzy RDD 시각화에서 Reduced Form의 Y 점프($\\widehat{\\text{ITT}}_Y$)와 First Stage의 D 점프($\\widehat{\\text{ITT}}_D$)의 관계로 옳은 것은?",
31+
"en": "In a Fuzzy RDD plot, which statement about the Reduced Form Y-jump ($\\widehat{\\text{ITT}}_Y$) and the First Stage D-jump ($\\widehat{\\text{ITT}}_D$) is correct?"
32+
},
33+
"options": [
34+
{
35+
"ko": "순응률이 100% 미만이므로 Y 점프는 D 점프보다 항상 작다",
36+
"en": "Since compliance is below 100%, the Y-jump is always smaller than the D-jump"
37+
},
38+
{
39+
"ko": "둘은 단위가 달라 크기를 직접 비교할 수 없다 — Y 점프를 D 점프로 나눈 값이 순응자의 처치 효과(LATE)다",
40+
"en": "They have different units and cannot be compared directly — dividing the Y-jump by the D-jump gives the compliers' treatment effect (LATE)"
41+
},
42+
{
43+
"ko": "Y 점프가 D 점프보다 크면 반드시 배제 제약이 위반된 것이다",
44+
"en": "If the Y-jump exceeds the D-jump, the exclusion restriction must be violated"
45+
}
46+
],
47+
"answer": 1,
48+
"explanation": {
49+
"ko": "$\\widehat{\\text{ITT}}_D$는 확률의 점프(0~1)이고 $\\widehat{\\text{ITT}}_Y$는 결과 $Y$의 단위(예: GPA 점수)이므로 둘의 크기를 직접 비교하는 것은 의미가 없습니다. 관계식은 $\\widehat{\\text{ITT}}_Y = \\text{LATE} \\times \\widehat{\\text{ITT}}_D$이므로, 부분적 순응 때문에 희석되는 것은 'Y 점프가 완전 처치 효과(LATE)보다 작아진다'는 것이지 'Y 점프가 D 점프보다 작아진다'가 아닙니다(①은 LATE<1일 때만 우연히 성립). LATE가 1보다 크면 Y 점프 > D 점프일 수 있고 이는 정상이며, 배제 제약 위반과도 무관합니다(③ 오답).",
50+
"en": "$\\widehat{\\text{ITT}}_D$ is a jump in probability (0–1) while $\\widehat{\\text{ITT}}_Y$ carries the units of $Y$ (e.g., GPA points), so comparing their magnitudes directly is meaningless. Since $\\widehat{\\text{ITT}}_Y = \\text{LATE} \\times \\widehat{\\text{ITT}}_D$, partial compliance dilutes the Y-jump relative to the full treatment effect (LATE), not relative to the D-jump (option ① holds only by coincidence when LATE < 1). If LATE > 1, the Y-jump can exceed the D-jump, which is perfectly valid and unrelated to the exclusion restriction (so ③ is wrong)."
51+
}
52+
},
53+
"rdd-late-scope": {
54+
"question": {
55+
"ko": "Sharp RDD로 추정한 처치 효과($\\tau_{SRD}$)의 적용 범위로 올바른 것은?",
56+
"en": "Which best describes the scope of the treatment effect estimated by Sharp RDD ($\\tau_{SRD}$)?"
57+
},
58+
"options": [
59+
{
60+
"ko": "전체 표본의 평균 처치 효과 (ATE)",
61+
"en": "Average treatment effect for the entire sample (ATE)"
62+
},
63+
{
64+
"ko": "기준점 근방의 국소 평균 처치 효과 (LATE)",
65+
"en": "Local average treatment effect near the cutoff (LATE)"
66+
},
67+
{
68+
"ko": "처치를 받은 집단 전체의 평균 처치 효과 (ATT)",
69+
"en": "Average treatment effect for the treated group (ATT)"
70+
}
71+
],
72+
"answer": 1,
73+
"explanation": {
74+
"ko": "RDD는 기준점(cutoff) 바로 좌우의 개체들만 비교하므로, 기준점 근방의 국소 평균 처치 효과(LATE)를 추정합니다. 기준점에서 멀리 떨어진 개체(예: 290점, 400점 학생)에는 이 추정치를 적용할 수 없습니다.",
75+
"en": "RDD compares only individuals just above and below the cutoff, so it estimates a Local Average Treatment Effect (LATE) at the cutoff. This estimate cannot be generalized to individuals far from the cutoff."
76+
}
77+
}
78+
}

book/videos_en.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@
2626
<p style="margin-top:8px; font-size:0.9rem; color:#555;">Introduces regression discontinuity design and how cutoff-based assignment can support causal comparison near a threshold.</p>
2727
</div>
2828

29+
<div style="width:45%; margin-bottom:24px; margin-right:24px;">
30+
<h3 style="font-size:1rem; margin-bottom:8px;">Fuzzy RDD</h3>
31+
<div style="position:relative; padding-bottom:56.25%; height:0; overflow:hidden;">
32+
<iframe src="https://www.youtube.com/embed/Qc0Z_M1XP4s"
33+
style="position:absolute; top:0; left:0; width:100%; height:100%; border:0;"
34+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
35+
allowfullscreen></iframe>
36+
</div>
37+
<p style="margin-top:8px; font-size:0.9rem; color:#555;">When the cutoff no longer fully determines treatment, this video shows how the Wald estimator and 2SLS recover the local average treatment effect (LATE) for compliers.</p>
38+
</div>
39+
2940
<div style="width:45%; margin-bottom:24px; margin-right:24px;">
3041
<h3 style="font-size:1rem; margin-bottom:8px;">Inverse Probability Weighting (IPW)</h3>
3142
<div style="position:relative; padding-bottom:56.25%; height:0; overflow:hidden;">

0 commit comments

Comments
 (0)