Start by clarifying the schema and assumptions, then build the individual-day panel by joining daily participation with site adoption dates, computing treatment and event-time indicators. Next, aggregate to weekly site-level averages, ensuring never-treated sites are handled correctly (e.g., excluded from event-time plots or assigned a null event time). Finally, validate the panel structure and discuss how it supports a staggered DiD analysis.
Pro tip: Explicitly state how you handle never-treated sites in the weekly aggregation—whether you exclude them from event-time plots or include them as a separate 'never-treated' group—and mention that you would check for balanced panels and pre-trends.
Confirm table structures, date ranges, and definitions (e.g., adoption date is when shuttle service becomes available at the site). Assume daily participation is binary (1 if participated, 0 otherwise).
Join daily participation records with site adoption dates. Compute treated = 1 if date >= adoption_date else 0, with never-treated sites having adoption_date NULL and treated = 0. Compute event_time = date - adoption_date (NULL for never-treated) and post = 1 if event_time >= 0 else 0.
Group by site_id and week (e.g., date_trunc('week', date)). Compute average participation rate per site-week. For never-treated sites, either exclude from event-time analysis or include with a null event_time, but ensure the aggregation correctly reflects their participation.
Check for missing dates, ensure balanced panels if needed, and verify that treated and event_time are correctly computed. Discuss how the output supports staggered DiD (e.g., using event-study plots or regression with fixed effects).
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.