Announcement

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

  • Examples in did2s stata help command

    I did a search in Stata, in the help stata command on 'did2s' and try to run their first example (see below). I get an error. I am not sure if there is a problem on my end (maybe my STATA 15.1 is too old and doesn't run it because of this) or is the problem something else. The error I get is nboot() not allowed.

    The code I run is:

    use https://github.com/kylebutts/did2s_s...ata/df_hom.dta, clear

    did2s dep_var, first_stage(i.unit i.year) second_stage(i.rel_year_shift) treatment(treat) cluster(state) nboot(10)


    I am ultimately trying to find code that allows me to bootstrap with did2s. I've tried other code as well, but I get an error that says repeated time values within panel. When I check 'duplicates list month_year state', I don't find duplicates.

    Any help on bootstrapping with did2s would be appreciated.





  • #2
    I'll be perfectly honest here, I hate the syntax for this command. Some commands are more difficult to use than others, but this syntax is downright confusing. The minimum worked examples don't even work as advertised in the help file. I would almost go as far as to say that this is simply a work in progress and not intended for public consumption yet- the minimum worked examples in the help file should AT LEAST work 99% as advertised, and this isn't it. Looking at the ado code, nboot isn't even in the options list. I mean for Christ's sake, it isn't even in the help file! I know I'm not a perfect programmer or a perfect coder, but in my opinion, this command isn't ready for prime time yet (which is fine, but it shouldn't be released like it works as advertised when it doesn't). I'd reach out to the author on this, they clearly owe an explanation.


    Anyways, this works for me, but whether we should trust it is another matter
    Code:
    cls
    
    
    u "https://github.com/kylebutts/did2s_stata/raw/main/data/df_hom.dta", clear
    cls
    
    did2s dep_var, ///
        first_stage(i.unit i.year) ///
        second_stage(treat) ///
        cluster(state) ///
        treatment(treat)

    Comment

    Working...
    X