-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DiD: allow for multiple pre and post intervention observations #76
Comments
Model formula will be |
At this point it seems that model fitting does work, although we'll have to wait for the visualisation to see if the results make sense. Plotting is going to get more complex. The initial plot that I had only makes sense when we have two time points (pre/post) AND we have multiple observed units per group. So we've potentially got a 2*2 grid of different plot types to produce
|
The magnitude of the causal impact is wrong. I think this might be fixed by enforcing an order on the levels of the groups. |
Plotting now works for the original dataset (multiple units in the treatment and control conditions) and the new banking example (one unit in the treatment and one in the control condition). Although the aesthetics could do with some work, the priority is to focus on getting it working in the case where we have more observations over time, not just the pre/post times. And the inferences are particularly bad. But this is because we are just using whatever default priors at the moment and because we only have one observation per condition. This is not an ideal scenario as a lot rides on the sigma parameter. But this can be worked on when we use Bambi (see #22). |
Currently sampling from the posterior works with result = DifferenceInDifferences(
df_long,
formula="bib ~ 1 + district + year + district:treated",
time_variable_name="year",
group_variable_name="district",
treated="Sixth District",
untreated="Eighth District",
prediction_model=LinearRegression()
) But breaks when we get to doing the other stuff and expected. This is the next step. |
Currently working in the |
In the |
At the moment the code works but it assumes there are observations at one pre and one post intervention time.
So we need to relax this assumption and generalise the code.
Probably best to do this while working through the 'bank failure' dataset, see #44.
This will also impact plotting
And it will impact reporting of the summery stats.
Bank failure dataset/example + robustifying
treated
andunits
columnsdistrict
) as categorical OR enter that asC(district)
in the model formulaClassic 2x2 DID
Implement example for the frequentist approach'Extended' DID with more than 2 observed time points
DifferenceInDifferences
class deal with all situations.Make it work for the frequentist modelREADME
+index.rst
The text was updated successfully, but these errors were encountered: