xuyiqing / fect

fixed effect counterfactual estimators
Other
53 stars 20 forks source link

The number of treated units in unbalanced panel #15

Closed QLgogo closed 1 year ago

QLgogo commented 3 years ago

Hi,

Thanks for this great tool. I got one more question. I am not sure how 'fect' decides the number of treated units in the unbalanced panel. In my unbalanced panel, some observations of a treated unit are missing in pre-treated period (e.g., -2, -1, 0), treatment-launched period (+1 period), and post-treated period (e.g., +2, +3 period). When I try to figure out the number of treated units for each time period, I encountered the following questions:

  1. I created a variable called distance (distance = current_month_index - treated_month_index) to measure the relative time to the treated month. The range of distance is [-15, 3] in my data panel at month-level. Since 'fect' view the treatment-launched month as "+1", so my relative range in 'fect' should be [-14, 4]. But the range of results got from "out.ife$est.att" is [-17, 4]. I am confused about why the lower bar is -17?
  2. In the results got from "out.ife$est.att", I notice that the number of treated units for period [-17, -15] is much smaller than those for period [-14, 3], so I try to drop these units. The period [-17, -15] in 'fect' response to distance [-18, -16] in my data panel. However, I cannot drop these treated units for period [-17, -15] in 'fect' by using "drop if distance <= -16", given that "-16" is out of my distance range.
  3. I tried different ways. Finally I run "drop if distance <= -13" on my data panel and successfully dropped these treated units for period [-17, -15] in 'fect'. But this dropping can also reduce the number of treated units for period [-14, 4] in 'fect'.

All these operations make me quite confused about how the number of treated units in unbalanced panel is determined in 'fect'. Could you kindly help and give some hints?

xuyiqing commented 3 years ago

Licheng will follow up in a few days :-) A treatment status pilot made by panelView() sent to our email address will be helpful.

Best, Yiqing

On Mon, Apr 12, 2021 at 8:48 PM QLgogo @.***> wrote:

Hi,

Thanks for this great tool. I got one more question. I am not sure how 'fect' decides the number of treated units in the unbalanced panel. In my unbalanced panel, some observations of a treated unit are missing in pre-treated period (e.g., -2, -1, 0), treatment-launched period (+1 period), and post-treated period (e.g., +2, +3 period). When I try to figure out the number of treated units for each time period, I encountered the following questions:

  1. I created a variable called distance (distance = current_month_index - treated_month_index) to measure the relative time to the treated month. The range of distance is [-15, 3] in my data panel at month-level. Since 'fect' view the treatment-launched month as "+1", so my relative range in 'fect' should be [-14, 4]. But the range of results got from "out.ife$est.att" is [-17, 4]. I am confused about why the lower bar is -17?
  2. In the results got from "out.ife$est.att", I notice that the number of treated units for period [-17, -15] is much smaller than those for period [-14, 3], so I try to drop these units. The period [-17, -15] in 'fect' response to distance [-18, -16] in my data panel. However, I cannot drop these treated units for period [-17, -15] in 'fect' by using "drop if distance <= -16", given that "-16" is out of my distance range.
  3. I tried different ways. Finally I run "drop if distance <= -13" on my data panel and successfully dropped these treated units for period [-17, -15] in 'fect'. But this dropping can also reduce the number of treated units for period [-14, 4] in 'fect'.

All these operations make me quite confused about how the number of treated units in unbalanced panel is determined in 'fect'. Could you kindly help and give some hints?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/fect/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGFOWY4EEBXCDI6YF6TTIO5KHANCNFSM422QAH6Q .

QLgogo commented 3 years ago

Thanks for your reply. I have figured out the reason, which is there are some missing values in my treatment dummy. I contacted ziyi liu in email and he has kindly helped. Thanks to all!