Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • LPDID: new module implementing Local Projections Difference-in-Differences

    Dear all,

    Thanks to Prof. Baum, the new package lpdid is now available from SSC.

    It implements the Local Projections Difference-in-Differences (LP-DiD) estimator proposed by Dube, Girardi, Jordà and Taylor (https://www.nber.org/papers/w31184).

    LP-DiD is a convenient, fast and flexible regression-based framework for implementing Difference-in-Differences with multiple time periods.

    More details can be found at the package listing here https://econpapers.repec.org/softwar...de/S459273.htm. The package was written by Alexander Busch and me.

    The lpdid module should be installed from within Stata by typing

    Code:
    ssc install lpdid
    Please do let me know if you have any problem using the command, have any questions or find any bugs.

    All the best

    Daniele

  • #2
    Additionally, we are already creating a list of features which we want to introduce in the next big update of the module. If you have anything in particular you would like to see implemented, feel free to reach out to us!

    Comment


    • #3
      Dear LP-DID authors,

      Thanks so much for sharing this package, it has been super helpful. I am just wondering whether you plan to add a functionality for the package to return coefficients (and/or draw event-study plots) of treatment and control groups separately? This would come in very handy. Thank you again for providing such a great package and the great paper.

      Comment


      • #4
        Originally posted by Hans Wang View Post
        Dear LP-DID authors,

        Thanks so much for sharing this package, it has been super helpful. I am just wondering whether you plan to add a functionality for the package to return coefficients (and/or draw event-study plots) of treatment and control groups separately? This would come in very handy. Thank you again for providing such a great package and the great paper.
        Dear Hans, thank you for your suggestion! I am sorry for the delay, but could you go into more detail here? To my understanding, the coefficients of an event study cannot be disentangled into a treatment and control effect. After all, the coefficient measures a difference between these two groups (along a time dimension). Do you perhaps mean a "raw means" plot, where one plots the mean of the treatment and control group over time? They are quite helpful as they also show the baseline levels and general variance of the time series, but do not require local projections or any other "fancy" new method.

        Comment


        • #5
          Dear LP-DID authors,

          Thanks so much for sharing this package, it has been super helpful. How can I plot an impulse response graph?

          Comment


          • #6
            Hi,

            I have just used the package for a project - it works great! I just wanted to flag one thing:

            The ado file uses spbalance to check for a strongly balanced panel - spbalance does not work with Stata 14 and older - it would be nice to mention this in the help file where you mention all the commands that need to be installed! I think the file mentions the command needs Stata 13 or more. (I could make it work even though I have Stata 14 by commenting out the spbalance part in the ado file, because I knew my panel was strongly balanced).

            Also, and this is probably not an issue - I was wondering why the standard errors are missing when bootstrap is specified? I checked the ado file and it doesn't seem like a bug (as in the ado file explicitly makes the standard errors missing after a boottest) - I feel this probably has something to do with me not fully understanding how boottest works! Finally, and relatedly, I could only get the command to run with a bootstrap option on Stata 18 (in a lab). When I tried to do it on Stata 14, adding the bootstrap option just throws up an "invalid syntax" error. Unlike the spbalance though, this time I could not figure out why this was the case.

            Comment


            • #7
              Originally posted by Cera YANG View Post
              Dear LP-DID authors,

              Thanks so much for sharing this package, it has been super helpful. How can I plot an impulse response graph?
              Hi there & thank you for the interest!

              The package refers to issues arising in staggered difference-in-difference settings, so it differs quite substantially from the "classical" local projections estimator in its interpretation. Instead of an impulse response on a single time series, you produce an event study which can be interpreted as the difference between a treatment and control group at different relative time periods relative to a baseline period. This event study plot should be produced automatically after you run the command (unless you specify the nograph option). You can also use the saved output in e() to create a more tailored version of the event study plot. If instead, you want a "classical" local projection impulse response graph with time series data, you can e.g. have a look at the locproj package or the Stata 18 command lpirf.

              But perhaps I am missing something here - feel free to elaborate!

              On local projections for difference-in-differences (this package): https://www.nber.org/papers/w31184
              On local projections in time series (NOT this package): https://www.aeaweb.org/articles?id=1...02828053828518

              Comment


              • #8
                Originally posted by Akash Bhatt View Post
                Hi,

                I have just used the package for a project - it works great! I just wanted to flag one thing:

                The ado file uses spbalance to check for a strongly balanced panel - spbalance does not work with Stata 14 and older - it would be nice to mention this in the help file where you mention all the commands that need to be installed! I think the file mentions the command needs Stata 13 or more. (I could make it work even though I have Stata 14 by commenting out the spbalance part in the ado file, because I knew my panel was strongly balanced).

                Also, and this is probably not an issue - I was wondering why the standard errors are missing when bootstrap is specified? I checked the ado file and it doesn't seem like a bug (as in the ado file explicitly makes the standard errors missing after a boottest) - I feel this probably has something to do with me not fully understanding how boottest works! Finally, and relatedly, I could only get the command to run with a bootstrap option on Stata 18 (in a lab). When I tried to do it on Stata 14, adding the bootstrap option just throws up an "invalid syntax" error. Unlike the spbalance though, this time I could not figure out why this was the case.
                To you, too: Thank you for providing us feedback, making lpdid a better package!

                spbalance: Great point, we will investigate this and will double check our reliance on Stata-supplied, but version-dependent functions and commands. We will also update the panel check in our next update, so that the program no longer crashes for old versions. This is our first Stata package, and I misunderstood the "version" command when I performed some tests on version compatibility.

                bootstrap 1: The wild nonparametric bootstrap does not produce standard errors, as this would impose an asymptotic normality assumption that may not be or desired (see the boottest documentation & Stata journal paper https://journals.sagepub.com/doi/ful...36867X19830877). It is also an established procedure in panel regressions such as diff-in-diff settings if there are few (but perhaps not too few) clusters (https://www.sciencedirect.com/scienc...04407620301445).

                bootstrap 2: The error is concerning and I am checking it right now. We will be back with a solution!

                Comment


                • #9

                  Thank you for your answer. I understand. By the way, may I ask you another question: Does LP-DID need to control the unit fixed effects? I read your latest working paper, and when comparing the specification 1-3, Local projection does not include unit fixed effects, The paper states that: “As a result of the differencing, note that the LP specification no longer includes unit fixed effects for comparability with the two previous specifications.” But I don't understand why LP-DID doesn't include individual fixed effects, or whether I can only add covariates if I want to control for unit level effects. I would appreciate it if you could answer me, Thanks~

                  Comment


                  • #10
                    Originally posted by Cera YANG View Post
                    Thank you for your answer. I understand. By the way, may I ask you another question: Does LP-DID need to control the unit fixed effects? I read your latest working paper, and when comparing the specification 1-3, Local projection does not include unit fixed effects, The paper states that: “As a result of the differencing, note that the LP specification no longer includes unit fixed effects for comparability with the two previous specifications.” But I don't understand why LP-DID doesn't include individual fixed effects, or whether I can only add covariates if I want to control for unit level effects. I would appreciate it if you could answer me, Thanks~
                    Differencing before the regression is equivalent to using unit fixed effects here. This is not a special feature of local projections, staggered diff-in-diff, or event studies, but a general result you can show in the "classical" 2x2 difference-in-difference estimator:

                    Code:
                    Code:
                    clear
                    input unit time y
                    0 0 10
                    0 1 20
                    1 0 5
                    1 1 10
                    end
                    
                    reg y unit time c.unit#c.time // "classical" formular
                    
                    
                    xtset unit time
                    reg D.y time c.unit#c.time, nocon // differentiated formular
                    Even without a regression equation, you should know that "difference-in-differences" means exactly that: You create the difference on the unit and the time level. If you already obtained the difference on the unit level before you plug your values into your regression, you only need to accommodate the time difference (i.e. time FE).

                    Hope this helps!

                    Comment


                    • #11
                      UPDATE:
                      A new slightly extended version (v1.0.1) of the lpdid command has just been uploaded in SSC (thanks to Prof. Baum).

                      Three new features:
                      - an absorb() option for additional fixed effects (besides time fixed effects, which are always automatically included).
                      - the controls() option now accepts STATA operators.
                      - it is now possible to apply weights using the standard STATA format [pweight=weight] instead of the weights() option (although the weights() option still works, in order to ensure full backward compatibility).

                      Update the command by typing


                      ssc install lpdid, replace

                      My coauthor Alex Busch and I hope these extensions are useful!

                      Daniele

                      Comment


                      • #12
                        Hi! How would you suggest one could use the results to output coefficients using esttab/estout?

                        Comment


                        • #13
                          I would like to add-on to Akash's question. When using the most recent version of the lpdid command today, there did not appear to be any stored estimates when using either the Stata default of estimates store or the user written eststo; the help file for lpdid seems to suggest that estimates should be stored in memory.

                          Nonetheless, I've found the canned Stata command to be very useful!

                          Comment


                          • #14
                            Originally posted by Tyler Ludwig View Post
                            I would like to add-on to Akash's question. When using the most recent version of the lpdid command today, there did not appear to be any stored estimates when using either the Stata default of estimates store or the user written eststo; the help file for lpdid seems to suggest that estimates should be stored in memory.

                            Nonetheless, I've found the canned Stata command to be very useful!
                            Hi, and thanks for your interest! Great to hear that you found the lpdid command useful

                            Estimates are stored into the e(results) and e(pooled_results) macros. My suggestion is to save your estimates in a matrix and (if useful) convert them into variables that you can use as needed, for example to do your own event study graphs or whatever is needed. For example, you can do so by simply writing

                            Code:
                            mat J=e(results)
                            svmat J
                            Hope this helps!

                            Daniele

                            Comment


                            • #15
                              Dear Alexander/Daniele,

                              Could you please suggest if I need to address the Nickell bias in LP-DID?
                              If yes, does the ANRR exercise in the paper use an Arellano-Bond estimator, and is this implemented by the package?
                              Many thanks in advance!

                              Comment

                              Working...
                              X