insongkim / PanelMatch

111 stars 34 forks source link

Missing matches in matched set data #88

Open PromiseKamanga opened 2 years ago

PromiseKamanga commented 2 years ago

I am working with data whereby some treated observations share treatment periods. When matching observations based on treatment history, my understanding is that all those observations that share treatment periods should also share the sizes of their matched sets. The issue I am encountering is that, of those observations share treatment periods, some of them are not appearing on the list when I print the matched set sizes. I don't know what to make of this. My question is why could this be happening? Also, what does this imply as far as estimating the impact of treatment is concerned?

adamrauh commented 2 years ago

Hi @PromiseKamanga, thanks for using the package!

Would you be able to share some code to reproduce the error and/or a DisplayTreatment style plot if the data are small enough? I'm not sure what's going on, but I'm happy to look more into this.

-Adam

PromiseKamanga commented 2 years ago

Thank you for your response.

The dataset is huge. So I will just describe it and share the line of code hoping that will give you a picture of what I am doing. I have 22 countries that are undergoing a similar policy change but at different years. As described earlier, some of those countries share the years in which they implement the policy change. Here is the line of code I use to observe the sizes of matched sets.

print(PanelMatch(lag = 3, time.id = "year", unit.id = "country_code", treatment = "policy_change", refinement.method = "none", data = my_df, match.missing =TRUE, size.match =5, qoi = "att", outcome.var = "trade_val", lead = 0, forbid.treatment.reversal = FALSE, use.diagonal.variance.matrix = TRUE))

PromiseKamanga commented 2 years ago

Hi @adamrauh,

Here is a portion of the data I am using. I hope it helps to resolve the issue.

my_df.xlsx

adamrauh commented 2 years ago

Hi @PromiseKamanga thank you for this. I'll take a look and will follow up here with any questions/findings.

zoezoezhouwei commented 2 years ago

Hi, Adam, My question is actually the same. Why not all of them appear? Also, I limited the matched size in the code, but it's much more than the limited number.