Announcement

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

  • How Bootstrap command is different from vce(bootstrap)

    I have a panel data regression
    I would like to find the bootstrapped estimation of coefficients
    Here is what I do normally for panel regression

    Original
    xtset ID YEAR
    xtreg DV IV c.IV#c.Moderator Moderator i.YEAR if YEAR < 2022, vce(cluster ID) fe

    There are 2 ways of finding bootstrapped estimation
    Method 1
    xtreg DV IV c.IV#c.Moderator i.YEAR if YEAR < 2022, vce(bootstrap, reps(500) seed(123)) cluster(ID) fe

    Method 2
    program define bootstrap
    xtreg DV IV c.IV#c.Moderator i.YEAR if YEAR < 2022, vce(cluster ID) fe
    end
    bootstrap, reps(500) seed(123): bootstrap

    When I run Original, without bootstrap, most effects are significant
    When I use Method 1, most effects are not significant
    When I use Method 2, most effects are significant, similar to Original

    I wonder:
    How Method 1 is different from Method 2, in terms of internal mechanisms, resampling process, estimation, etc.
    Which method I should use?

    Thank you.

  • #2
    Not answering your question, but the equation for Method 1 and 2 are not the same as Original.

    Comment


    • #3
      It seems to me that the main difference is the use of clusters.
      Namely, "wrapping" the command in a program, and not specifying a block bootstrap procedure, is creating results that are very different from the Standard approach. in method 1.
      Additionally, why bootstrap? any concerns about the credibility of the SE produced by xtreg?

      Comment


      • #4
        First, it begs for problems to name a program like an official command (bootstrap, reps(500) seed(123): bootstrap).

        Second, the issue here is that vce(bootstrap) and the bootstrap prefix work very differently with panel data. With VCE, Stata takes care of all the issues that come with resampling dependent data. I would always use this approach if possible. If not, you need to take care of this your self. See this demonstration:


        Code:
        clear all
        webuse nlswork
        keep if year > 80
        xtset idcode year
        
        
        *** Easy approach ***
        xtreg ln_wage i.union, fe vce(bootstrap, reps(100) seed(123))
        
        
        *** Hard approach ***
        cap program drop bootprog
        program define bootprog, rclass
            xtset newid year
            xtreg ln_wage i.union, fe
            return scalar res = r(table)[1,2]
        end
        
        
        
        cap drop newid
        gen newid = idcode
        bootprog        //Test program
        return list    
        
        
        bootstrap r(res), reps(100) seed(123) cluster(idcode) idcluster(newid): bootprog
        Best wishes

        (Stata 16.1 MP)

        Comment

        Working...
        X