This question evaluates understanding of difference-in-differences estimation, simple pretrend detection, and related data-processing competencies for experiment-like observational datasets.
You are given individual-level observational data for an experiment-like setting with:
period[i]
∈ {0,1}: 0 = pre period, 1 = post period
treatment[i]
∈ {0,1}: 1 = treated group, 0 = control group
outcome[i]
∈ ℝ: numeric outcome
All three arrays have the same length N, and row i corresponds to one observation.
where the bars denote sample means over the corresponding subsets.
threshold
, return
pretrend=True
if
, else
False
.
Return:
did_estimate
(float)
pretrend
(boolean)
Login required