Skip to content

Claude/respond to request 011 c uf um nex zjf ft ayo gb s3k#3

Closed
yo5uke wants to merge 2 commits intomainfrom
claude/respond-to-request-011CUfUmNexZjfFTAyoGbS3k
Closed

Claude/respond to request 011 c uf um nex zjf ft ayo gb s3k#3
yo5uke wants to merge 2 commits intomainfrom
claude/respond-to-request-011CUfUmNexZjfFTAyoGbS3k

Conversation

@yo5uke
Copy link
Owner

@yo5uke yo5uke commented Oct 31, 2025

No description provided.

The baseline row was missing the relative_time column, causing is_baseline
to be NA instead of TRUE. This resulted in the baseline point being dropped
from plots when plot_es() filters out rows with NA values.

Added relative_time = as.integer(baseline) to the baseline_row tibble
creation in the classic method section, ensuring that:
- The baseline row has the correct relative_time value
- The is_baseline flag is properly set to TRUE for the baseline row
- plot_es() correctly displays the baseline point and doesn't connect
  non-adjacent points
Changed the classic event study specification to use proper interaction
terms (treat × relative_time) instead of treating the treatment variable
as time-varying. This resolves collinearity issues with fixed effects.

Key changes:
1. Calculate relative_time (k_vec) for all observations, not just treated ones
2. Add treatment group indicator (..treat) to model data
3. Use fixest::i() function to create proper interaction terms:
   i(..f, ..treat, ref = baseline)
4. Update term name extraction to handle i() output format
5. Modify .compute_metadata() to use treatment indicator for counting

This ensures that:
- Event dummies are created as treat × 1{relative_time = k}
- The specification avoids collinearity with individual and time fixed effects
- Control group observations are properly included in the regression
- The model correctly implements two-way fixed effects event study design
@yo5uke yo5uke closed this Oct 31, 2025
@yo5uke yo5uke deleted the claude/respond-to-request-011CUfUmNexZjfFTAyoGbS3k branch October 31, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants