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

Diff in Diff in Julia #2

Open
azev77 opened this issue May 16, 2023 · 3 comments
Open

Diff in Diff in Julia #2

azev77 opened this issue May 16, 2023 · 3 comments

Comments

@azev77
Copy link

azev77 commented May 16, 2023

Hi, are you aware @junyuan-chen has
https://github.com/JuliaDiffinDiffs/DiffinDiffs.jl

@xiaobaaaa
Copy link
Owner

Hi, are you aware @junyuan-chen has https://github.com/JuliaDiffinDiffs/DiffinDiffs.jl

Em .... I know about the https://github.com/JuliaDiffinDiffs/DiffinDiffs.jl package and have tried using it, but I found that it has many issues. The EventStudyInteracts package in Stata is very useful and I am mainly using it for my empirical papers. I did some tests and found that the results from DiffinDiffs.jl are different from those of Stata’s EventStudyInteracts package and many features cannot be implemented. DiffinDiffs.jl also cannot use the GPU functionality of FixedEffectModels. I also cannot understand the code and documentation of DiffinDiffs.jl. DiffinDiffs.jl cannot become my main tool for econometric empirical research. I did some tests and found that the results calculated by the sunab function in the R package fixest are also very strange. So I did not choose to use R packages either. So I wrote one myself.

@junyuan-chen
Copy link

@xiaobaaaa It's totally fine that people write their own packages. I also think that it's very important for people to understand what they are doing. But, I just want to comment that the issues/limitations you mentioned regarding DiffinDiffs.jl is arising from the lack of familiarity of the package design rather than something wrong with the package. DiffinDiffs.jl is designed from the beginning to be highly modular. Even within an estimation method, the intermediate procedures can be swapped and customized based on need. But that's not something that is done with a one-line command like how things work in a canned software. Admittedly, the demand for user proficiency in Julia language is somewhat high given what is readily available for high-level usage now.

If you found the results are different, I am pretty sure it's because the specification is not set correctly. The package was tested very comprehensively and this is unlikely to be a bug with the package internals. Regarding comparing estimates across subsamples, that's something totally doable by the package but not documented. (I think what you refer to is something based on lincom in Stata, which is a linear transformation of the estimates from the more saturated regression.)

@xiaobaaaa
Copy link
Owner

@junyuan-chen Thank you for your attention and reply! DiffinDiffs.jl is designed from the beginning to be highly modular. This is a very good feature. But this is also why I didn’t raise issues in your package and wrote my own package instead. I don’t understand your package and don’t know how to make suggestions.

Regarding comparing estimates across subsamples, it is not simply referring to something based on lincom in Stata. Instead, it should be able to generate two types of relative time dummy variables based on a categorical variable, even though the policy start times for these two types are the same. You can refer to my documentation or see the examples in the EventStudyInteracts package help document in Stata. See: Compare event study estimates for subsamples. Suppose we want to compare the average effect over the first five years of joining the union between college graduates and non-college graduates. We can first estimate their separate effects by interacting the relative time indicators with an indicator of college graduates. For the issue of different results, I will do some tests with DiffinDiffs.jl later.

DiffinDiffs.jl may still have some missing documentation, which makes me not know how to implement some econometric operations. I will also do some more tests. I also want to use the GPU feature of FixedEffectModels and control more fixed effects in the regression, just like FixedEffectModels. I think that keeping the syntax similar to FixedEffectModels in Julia’s packages, just like EventStudyInteracts in Stata keeps the syntax similar to reghdfe, is the key to making the package more flexible and easy to use.

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

3 participants