Skip to content
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

Heterogeneous treatment effect D:time in formula #62

Open
yahoochen97 opened this issue May 28, 2021 · 2 comments
Open

Heterogeneous treatment effect D:time in formula #62

yahoochen97 opened this issue May 28, 2021 · 2 comments

Comments

@yahoochen97
Copy link

Hi,

I am trying to replicate the simulation study in your paper that has linearly growing effect which is heterogereous. However, when I included time-treatment interaction in the model formula:

fit <- interFE(y ~ 1 + x1 + x2 + D:time, data = data, index=c("unit","time"), r = 2, force = "two-way", nboots = 100)

an error prompted:

Error in FUN(X[[i]], ...) : Calling var(x) on a factor x is defunct. Use something like 'all(duplicated(x)[-1L])' to test for a constant vector.

My data have two time-varying covariates, treatment indicator, time and unit factors. Could you show me the proper way to obtain heterogeneous treatment effect using gsynth package? Thank you in advance!

@yahoochen97
Copy link
Author

I also tried not factoring time variable and another error occured:

Error in interFE.default(formula = NULL, data = data, Y = Yname, X = Xname, : Variable "time" is time-invariant. Try to remove it.

@xuyiqing
Copy link
Owner

xuyiqing commented May 28, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants