1. Data Loading and Setup
## # A tibble: 6 × 6
## timestamp topic interest treatment post did
## <dttm> <chr> <int> <dbl> <dbl> <dbl>
## 1 2025-06-22 17:00:00 socialism 6 1 0 0
## 2 2025-06-22 17:00:00 capitalism 4 0 0 0
## 3 2025-06-22 18:00:00 socialism 5 1 0 0
## 4 2025-06-22 18:00:00 capitalism 3 0 0 0
## 5 2025-06-22 19:00:00 socialism 6 1 0 0
## 6 2025-06-22 19:00:00 capitalism 4 0 0 0
## Data spans from 2025-06-22 17:00:00 to 2025-06-29 17:00:00
2. Descriptive Visualization

3. Pre-Trends Validation (Critical Test)
##
## Pre-Trends Test: Parallel Trends Assumption
## =========================================================================================
## Dependent variable:
## ------------------------------------------------------------------
## Search Interest
## -----------------------------------------------------------------------------------------
## Socialism Topic 2.135***
## (0.369)
## Hours Before Treatment 0.020*
## (0.011)
## Socialism × Time Trend 0.020
## (0.015)
## Constant 4.546***
## (0.261)
## -----------------------------------------------------------------------------------------
## Observations 82
## R2 0.577
## Adjusted R2 0.561
## Residual Std. Error 0.820 (df = 78)
## F Statistic 35.511*** (df = 3; 78)
## =========================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## Treatment cutoff: 10:00 AM Tunis (5:00 AM NY) - polls opening time
##
## === PRE-TRENDS VALIDATION ===
##
## Socialism × Time Trend coefficient: 0.02
##
## P-value: 0.187
##
## ✓ PARALLEL TRENDS ASSUMPTION SATISFIED (BORDERLINE)
## Marginally non-significant differential pre-trends
## DiD identification strategy is valid but requires caution
4. Main Difference-in-Differences Analysis
##
## Main Result: Effect of Mamdani's Victory on Socialism Search Interest
## ==================================================================================================
## Dependent variable:
## ---------------------------------------------------------------------------
## Search Interest
## --------------------------------------------------------------------------------------------------
## Post-Treatment Period 1.137
## (1.503)
## Socialism Topic 3.155*
## (1.722)
## Treatment Effect (DiD) 18.232***
## (2.125)
## Constant 4.034***
## (1.218)
## --------------------------------------------------------------------------------------------------
## Observations 338
## R2 0.540
## Adjusted R2 0.535
## Residual Std. Error 9.276 (df = 334)
## F Statistic 130.497*** (df = 3; 334)
## ==================================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## Treatment: Results became clear (3 AM Tunis = 10 PM NY when Cuomo conceded)
##
## === MAIN FINDINGS ===
##
## Treatment Effect: 18.2 points
##
## Baseline socialism interest: 7.2 points
##
## Percent increase: 253 %
##
## Interpretation: Mamdani's victory increased socialism search interest by 18.2 points,
##
## a 253 % increase from the pre-election baseline.
5. Multiple Treatment Timing Analysis
##
## Multiple Treatment Periods: Election Timeline Analysis
## ====================================================================
## Dependent variable:
## ------------------------------------
## Search Interest
## --------------------------------------------------------------------
## Post Polls Open (11 AM Tunis) -0.298
## (2.672)
## Post Results Clear (3 AM Tunis) 1.348
## (2.412)
## Socialism Topic 1.707
## (2.046)
## Socialism × Polls Open 4.940
## (3.778)
## Socialism × Results Clear 14.740***
## (3.411)
## Constant 4.122***
## (1.446)
## --------------------------------------------------------------------
## Observations 338
## R2 0.544
## Adjusted R2 0.537
## Residual Std. Error 9.262 (df = 332)
## F Statistic 79.146*** (df = 5; 332)
## ====================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## Polls Open: 11 AM Tunis = 6 AM NY
## Results Clear: 3 AM Tunis = 10 PM NY
##
## === TREATMENT TIMING ANALYSIS ===
##
## Polls Opening Effect: 4.9 points (p = 0.192 )
##
## Results Clear Effect: 14.7 points (p = 0 )
##
## - Polls opening (6 AM NY): No significant effect
##
## - Results clear (10 PM NY): Highly significant effect
##
##
## Conclusion: The major effect ( 14.7 points) occurred when results became clear at 10 PM NY,
##
## with minimal effect ( 4.9 points) when polls opened at 6 AM NY.
6. Multiple Treatment Visualization

7. Robustness Checks
##
## Robustness Checks: Multiple Model Specifications
## ==========================================================================
## Dependent variable:
## ------------------------------------------------------
## Search Interest
## Baseline Linear Time Quadratic Time Topic FE Time FE
## (1) (2) (3) (4) (5)
## --------------------------------------------------------------------------
## Post-Treatment 1.14 14.78*** 14.78*** 1.14 -3.12
## (1.50) (1.88) (1.88) (1.50) (9.34)
## Socialism 3.16* 3.16** 3.16** 3.16* 3.16*
## (1.72) (1.51) (1.51) (1.72) (1.72)
## Treatment Effect 18.23*** 18.23*** 18.23*** 18.23*** 18.23***
## (2.13) (1.86) (1.86) (2.13) (2.13)
## Time (linear) -0.0000*** -0.0000***
## (0.0000) (0.0000)
## Time²
##
## Constant 4.03*** 78,545.29*** 78,545.29*** 4.03*** 3.42
## (1.22) (7,735.95) (7,735.95) (1.22) (6.62)
## --------------------------------------------------------------------------
## Topic Fixed Effects No No No Yes No
## Time Fixed Effects No No No No Yes
## Observations 338 338 338 338 338
## R2 0.54 0.65 0.65 0.54 0.77
## Adjusted R2 0.54 0.64 0.64 0.54 0.53
## ==========================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
##
## === ROBUSTNESS CHECK ===
##
## Treatment effects across specifications:
##
## Model 1 : 18.23
## Model 2 : 18.23
## Model 3 : 18.23
## Model 4 : 18.23
## Model 5 : 18.23
##
## Range: 18.23 to 18.23
##
## ✓ Treatment effect stable across specifications
8. Event Study Analysis

##
## === EVENT STUDY INTERPRETATION ===
##
## This plot shows how the treatment effect evolved over time:
##
## - Pre-treatment: Effects should be near zero (validates parallel trends)
##
## - At treatment: Sharp increase in socialism search interest
##
## - Post-treatment: Gradual decline as effect dissipates
9. Alternative Control Groups
## Available topics in extended dataset:
## [1] "socialism" "capitalism" "liberalism" "communism"
##
## Using control topics: capitalism, liberalism, communism
##
## Robustness: Alternative Control Topics
## ====================================================================================================
## Dependent variable:
## ---------------------------------------------------------------------
## Search Interest
## vs capitalism vs liberalism vs communism
## (1) (2) (3)
## ----------------------------------------------------------------------------------------------------
## Post-Treatment 1.14 -0.09 5.57***
## (1.51) (1.51) (1.53)
## Socialism 3.18* -3.30* -1.68
## (1.73) (1.74) (1.77)
## Treatment Effect 18.10*** 19.33*** 13.68***
## (2.13) (2.14) (2.17)
## Constant 4.04*** 10.51*** 8.89***
## (1.23) (1.23) (1.25)
## ----------------------------------------------------------------------------------------------------
## Observations 338 338 338
## R2 0.54 0.43 0.40
## Adjusted R2 0.53 0.42 0.39
## Residual Std. Error (df = 334) 9.26 9.28 9.43
## F Statistic (df = 3; 334) 130.14*** 83.70*** 74.05***
## ====================================================================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
## Testing robustness with different political/economic control topics
##
## === ALTERNATIVE CONTROLS COMPARISON ===
## Treatment effects with different control topics:
## vs capitalism.did : 18.1
## vs liberalism.did : 19.33
## vs communism.did : 13.68
## Mean effect: 17.04
## ✓ Results consistent across different control groups
10. Statistical Power Analysis
## === STATISTICAL POWER ANALYSIS ===
##
## Total observations: 338
##
## Observations per group: 169
##
## Observed effect size (Cohen's d): 1.61
##
## Achieved statistical power: 1
##
## ✓ ADEQUATE POWER: Study has sufficient power to detect effects
##
## Power Analysis: Sample Size Requirements
## ======================================================================
## 1 2 3 4
## ----------------------------------------------------------------------
## effect_size 0.200000 0.500000 0.800000 1.610195
## scenario Small Effect Medium Effect Large Effect Observed Effect
## required_n 786.81139 127.53122 51.04916 14.31043
## achieved_power 0.4496467 0.9956428 1.0000000 1.0000000
## ----------------------------------------------------------------------
## Required N calculated for 80% power at α = 0.05
##
##
## Minimum detectable effect size with current sample: 0.306
##
## Observed effect size: 1.61
##
## ✓ EFFECT SIZE ADEQUATE: Observed effect exceeds minimum detectable threshold
