Announcement

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

  • Bootstrap standard errors using ivreghdfe

    I want to bootstrap the standard errors with 1000 replications. In my regression specification standard errors are clustered. I'm using " ivreghdfe" command. I tried like this:

    ivreghdfe price mpg, absorb (type year) vce(bootstrap, reps(1000) seed(12345) cluster (id))

    I got error - option vce() not allowed. Please explain, how can I do this uisng ivreghdfe command ?
    Last edited by kamalesh pahurkar; 26 Aug 2023, 07:00.

  • #2
    ivreghdfe is from SSC, as you are asked to explain (FAQ Advice #12).

    Code:
    help reghdfe
    shows that bootstrap standard errors are not supported.

    vce(vcetype, subopt) specifies the type of standard error reported.

    unadjusted|ols estimates conventional standard errors, valid under the assumptions of homoscedasticity and no correlation between observations even in small samples.

    robust estimates heteroscedasticity-consistent standard errors (Huber/White/sandwich estimators), which still assume independence between observations.

    Warning: in a FE panel regression, using robust will lead to inconsistent standard errors if, for every fixed effect, the other dimension is fixed. For instance, in a standard panel with individual and time fixed effects, we require both the
    number of individuals and periods to grow asymptotically. If that is not the case, an alternative may be to use clustered errors, which as discussed below will still have their own asymptotic requirements. For a discussion, see Stock and
    Watson, "Heteroskedasticity-robust standard errors for fixed-effects panel-data regression," Econometrica 76 (2008): 155-174.

    cluster clustervars estimates consistent standard errors even when the observations are correlated within groups.

    Multi-way-clustering is allowed. Thus, you can indicate as many clustervars as desired (e.g. allowing for intragroup correlation across individuals, time, country, etc). For instance, vce(cluster firm year) will estimate SEs with firm and year
    clustering (two-way clustering).

    Each clustervar permits interactions of the type var1#var2. This is equivalent to using egen group(var1 var2) to create a new variable, but more convenient and faster. For instance, vce(cluster firm#year) will estimate SEs with one-way
    clustering i.e. where all observations of a given firm and year are clustered together.

    Note: do not confuse vce(cluster firm#year) (one-way clustering) with vce(cluster firm year) (two-way clustering).

    Warning: it is not recommended to run clustered SEs if any of the clustering variables have too few different levels. A frequent rule of thumb is that each cluster variable must have at least 50 different categories (the number of categories
    for each clustervar appears at the top of the regression table).

    Note: More advanced SEs, including autocorrelation-consistent (AC), heteroskedastic and autocorrelation-consistent (HAC), Driscoll-Kraay, Kiefer, etc. are available in the ivreghdfe package (which uses ivreg2 as its back-end).
    Try either xtivreg or ivregress.

    Comment


    • #3
      Thanks Andrew, you said try xtivreg or ivregress, but the problem is I have a huge number of fixed effects and I want to save their coefficients. I think that is not possible with xtiverg or ivregress

      Comment


      • #4
        Bootstrapping affects the standard errors, not the coefficients.

        Comment


        • #5
          Kamalesh:
          are you sure that you cannot make your model more parsimonious once yiou have ruled out all the time-invariant fixed effects (that will be wiped out by the -fe- estimator anyway)?
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            I don't want to rule out fixed effects (I need fixed effects coef), that's why I don't want to use xtiverg, Is there any command which allow me bootstrap option and simultaneously I can save the large number of fixed effects coef.`s

            Comment


            • #7
              Kamalesh:
              perhaps you can go -ivregress-, incuding categorical variables for fixed effects in the right-hand side of your regression equation.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                I tried xtivreg, but the problem is it does not allow me to cluster the standard errors. It shows "option cluster is not allow", Can you help?

                Comment


                • #9
                  Kamalesh:
                  what if you go -robust- standard errors?
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment

                  Working...
                  X