Announcement

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

  • Bootstrapped SEs for quantile regression

    Hi,

    I have a standard difference-in-differences setup where a reform is introduced in one region in a given year but none of the other regions. I’d like to estimate the effect of the reform across the distribution of the outcome variable. To do this, I am using the rifhdreg package, with the following code:

    loc nreps = 1000
    loc seed = 1019

    glo controls “age gender income”

    forval n = 1(1)99 {

    bootstrap, reps(`nreps') seed(`seed'): rifhdreg outcome treat##post $controls, cluster(region) rif(q(`n'));

    }

    However, about 35% of the repetitions fail with the error message that “collinearity in replicate sample is not the same as the full sample, posting missing values”. See, for example, this output:

    Click image for larger version

Name:	error.png
Views:	1
Size:	11.7 KB
ID:	1554109



    It looks like that when re-sampling, it’s drawing samples without observations from all four groups that are needed to identify the parameters in the difference-in-differences model: (i) pre-reform control regions, (ii) pre-reform treatment region, (iii) post-reform control regions, and (iv) post-reform treatment region.

    Is there a way to ensure that I'm drawing samples with observations from each of these four groups? If not, what is the best way to proceed?

    Thanks in advance!

  • #2
    Dear Jack,
    It seems odd to me that you are encountering that warning message. On this respect, do you mind trying running the same model but with "regress" and see if the same problem remains?
    If the problem doesnt come up with regress, then i may need you to send me a snapshot of your data (say 5%) so i can see if i can replicate the problem on my end, and track down if the bug is on my end.
    If the problem persists when using regress, then the source of the problem may be related to what you suspect.
    In any case, I think your solution is reasonable. I would say that you need to use region x treatment as your strata variable for the bootstrap, region (considering how many there will be) may not be enough for bootstrap cluster :
    Code:
    egen post_treat=group(post treat)
    bootstrap , reps(50) strata(post_treat:rifhdreg y treat post i.treat#i.post x1 x2 x3, rif(q(10))
    regarding the DID strategy. Since this methodology aims to compare distribution using pre-post and treat vs untreated units, you need to modify your model specification a bit.
    namely you need to use the option "over"

    Code:
    rifhdreg y treat post i.treat#i.post x1 x2 x3, rif(q(10)) over(post_treat)
    this will estimate the "treatment" effect, as it replicates more closely what Firpo(2007) suggests. You will find the details of what this function does on the help file and the paper that accompanies the command. https://journals.sagepub.com/doi/abs...36867X20909690

    Best Regards
    Fernando

    Comment


    • #3
      Hi Fernando,

      I have now tried running my original code with "regress", and the same problem arises, so it does not seem to be a bug with the rifhdreg package. The new code seemed to work well on a quick trial run. Many thanks for your help, especially the point about my model specification. Much appreciated!

      Jack

      Comment

      Working...
      X