xuyiqing / fect

fixed effect counterfactual estimators
Other
53 stars 20 forks source link

Could you please help with how to define the pre-trend periods? #5

Closed metascience-lab closed 1 year ago

metascience-lab commented 3 years ago

Hello, I am trying to use your excellent package "fect" to deal with my own dateset. However, I could not make the pre-trend period longer, the result plot is as follow: QQ图片20200924144509

The range of time in my dateset is [3,146], which is longer than the simdata. I try to use "min.T0 = 30,pre.period = c(-30,0)", but the pre-trend periods still equal to [-3,0], could you give me a hand to deal with this setting problem?

xuyiqing commented 3 years ago

Could you try setting "proportion = 0"? The default is 0.3, which means showing the periods whose numbers of treated units are at least 30% of the highest number (usually at period 0 or 1).

On Wed, Sep 23, 2020 at 11:49 PM jiajingchan notifications@github.com wrote:

Hello, I am trying to use your excellent package "fect" to deal with my own dateset. However, I could not make the pre-trend period longer, the result plot is as follow: [image: QQ图片20200924144509] https://user-images.githubusercontent.com/17024559/94110153-c6037c00-fe74-11ea-84d5-b9342e1cb7b7.png

The range of time in my dateset is [3,146], which is longer than the simdata. I try to use "min.T0 = 30,pre.period = c(-30,0)", but the pre-trend periods still equal to [-3,0], could you give me a hand to deal with this setting problem?

— 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/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGH65GHBGAHBXB6Q72DSHLTXHANCNFSM4RX5GBXQ .

-- Yiqing Xu

Assistant Professor Department of Political Science Stanford University http://yiqingxu.org/

metascience-lab commented 3 years ago

Thanks for your generous reply, I tried to set "proportion = 0", the result plot seems to be more weird.. The 3 values turned to be "NA", as shown in the pic attached here. 1

For now, your excellent package is kind of blackbox for me, so I attached my modified R code and date sample as zip file here, it would be grateful if you could make some comment on it...

code&data.zip

metascience-lab commented 3 years ago

Hello Prof, I read your source code and I know how to solve it now. Just change the parameters in "Plot" function. Thanks a lot, and this issue could be closed. Best Regard.

xuyiqing commented 3 years ago

Sorry about that. Thank you so much.

On Thu, Oct 1, 2020 at 6:45 PM jiajingchan notifications@github.com wrote:

Hello Prof, I read your source code and I know how to solve it now. Just change the parameters in "Plot" function. Thanks a lot, and this issue could be closed. Best Regard.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/fect/issues/5#issuecomment-702483237, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGG7D5VJ7ZZZOVC3GPDSIUWB5ANCNFSM4RX5GBXQ .

-- Yiqing Xu

Assistant Professor Department of Political Science Stanford University http://yiqingxu.org/

metascience-lab commented 3 years ago

You really do me a favor, I just misunderstood your guidance and set "proportion = 0" in a wrong position("fect" function). It should be set in "Plot" function, hah.