Announcement

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

  • Bootstrapping in the case of control functions with fixed effects

    Hi all,

    I am trying to bootstrap the standard errors after using the control function method. In the second stage, I use a logit model with country fixed effects. However, when I try bootstrapping using the following method, I get an error:

    cap program drop cfu
    program cfu
    xtreg x z x2 i.year, fe robust
    predict vhat, resid

    logit dummy x x2 vhat country*, robust
    drop vhat
    end

    bootstrap, reps(400): cfu

    no observations
    an error occurred when bootstrap executed cfu
    r(2000);

    I assume that it might be because of country fixed effects (country*). Could someone please help me adjust the program so that the fixed effects from the second stage work through the bootstrapping?
    Last edited by Edison Jakurti; 09 May 2024, 14:16.

  • #2
    can you run the xtreg regression without error?

    Comment


    • #3
      and the logit model without vhat without error?

      or just run both inside the loop to see if both models estimate

      Comment


      • #4
        Yes, they both work. When I remove country*, the bootstrapping works too. That's why I assumed that it must be something with the country fixed effects (i.e., country*)...

        Comment


        • #5
          so you have country1 country2, etc..?

          why not i.country?

          does it work without the country* variable?

          Comment


          • #6
            It works without country*. It does not work with country* nor i.country. That’s why I assumed that it had something to do with the fixed effects.

            Comment


            • #7
              estimate the first model without the country fixed effect.

              reg x z x2 i.year, robust

              G

              Comment


              • #8
                Thanks, George! I tried but it didn't work. Moreover, I need to include country fixed effects in the first stage. The issue is really with the country fixed effects in the second stage. I also tried to use a Mundlak device, but it didn't work either.

                Comment


                • #9
                  I think the vhat is perfectly correlated with country

                  Comment


                  • #10
                    But, when I run both stages without bootstrapping everything works well. It's just the bootstrapping for which (I think) the program needs some tweaking.

                    Comment


                    • #11
                      Edison: Your procedure suffers from the incidental parameters problem. Putting country fixed effects into a logit when the data are at the country level cannot be justified. You can instead try the correlated random effects approach in both stages. In the first stage, it's the same as fixed effects. But not in the second. See Papke and Wooldridge (2008, Journal of Econometrics) or my MIT Press book, chapter 15.

                      Also, you need to use the panel version of the bootstrap, where you resample countries, not individual observations. That might explain why it's not working. But, in any case, you can't justify putting in the country dummies.

                      Comment


                      • #12
                        Thank you, Prof. Wooldridge! I will see Papke and Wooldridge (2008). One follow-up question: would using clogit instead of logit address the incidental parameter problem, or is there still an issue with using country FE when the data are at the country level?

                        Comment


                        • #13
                          If you use clogit you will not be able to estimate the average partial effects -- at least not easily. You can get the effects on the log-odds, and maybe that's enough for you.

                          Comment


                          • #14
                            Again, many thanks Prof. Wooldridge! Let me provide more info: I'm using a balanced panel data which includes 16 countries over 100+ years (i.e. T>N). For the main variable of interest, I have (at least) 25 to 100+ observations per country. Would the incidental parameters problem be still an issue if I use logit with country dummies? Or would you rather recommend clogit (although estimating the average partial effects would not be easy)?

                            Comment


                            • #15
                              With those dimensions, just include country dummy variables. It might be okay. But then you have to figure out a way to obtain "large-T" standard errors. This is relatively easy with linear models, using xtscc. But I don't know of any equivalent for nonlinear models (even though it wouldn't be too hard).

                              What about starting with a linear model and using xtscc to obtain standard errors?

                              Comment

                              Working...
                              X