Announcement

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

  • Strata option in Bootstrap command

    Hello everybody,
    for my PhD thesis I am developing a DiD model that captures the effects of a particular price policy on online platforms: I would computing bootstrapped standard errors allowing for a cluster structure, through vce(bootstrap).
    Among the command options, I find strata(varlist): analyzing the available resources, I have not reached a valid conclusion on the functioning of this option and the difference with clusters (varlist).
    Someone could help me?
    Thanks
    Best regards

  • #2
    Hi Simone,
    The short version of the difference is as follows:
    Strata() request to draw bootstrap samples for each individual subsample identified by the strata. Each bootstrap sample will have the same number of individuals by strata as the original sample.
    Clusters() request to draw bootstrap samples taking random draws of clusters, but not individual observations. Each sample will be of different size, but will have the same number of "clusters", where some will appear more than once, and others wont appear at all.
    HTH
    Fernando

    Comment


    • #3
      Hi Fernando,
      thank you for your answer: I'm sorry, but I'm a beginner on the bootstrap theme. If I insert both options, what are the effects?
      Thank you very much.
      Simone

      Comment


      • #4
        If that is the case, it will be far better, and easier, if see what happens by doing it more "manually"
        Code:
        sysuse auto, clear
        ** this is so you can replicate exactly what i get here
        set seed 1
        tab foreign
        bsample, strata(foreign)
        tab foreign
        * same number of observations under foreign =1 and foreign==0
        
        sysuse auto, clear
        set seed 1
        egen id=group(trunk)
        tab id
        * there are 18 categories
        bsample, cluster(id) idcluster(id2)
        tab id
        * there are only 13 categories now, but
        tab id2
        * the new id created (id2) still has 18 categories.
        
        ** Mixing both:
        sysuse auto, clear
        set seed  1
        
        egen id=group(trunk)
        ssc install distinct
        distinct id if foreign==0
        distinct id if foreign==1
        ** see how many ID's you have per foreign
        bsample, strata(foreign) cluster(id) idcluster(id2)
        distinct id2 if foreign==0
        distinct id2 if foreign==1
        ** As you can see there are the same number of "distinct" ids by foreign.
        For more details, i would encourage you to go over the bootstrap and bsample helpfiles and the manual. They have very detailed examples.
        Fernando

        Comment


        • #5
          Thank you so much,
          Simone

          Comment

          Working...
          X