Announcement

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

  • Bootstrap SE after XTPMG

    Dear all
    I am using the user written command XTPMG in Stata. Actually, i am using in my regression residuals obtained from a previous estimation. I want to use the boostrap to make sure that i have the right standards errors. Unfortunately, i wasn't able to do that using the standard Bootstrap command in Stata: here below is my code

    bootstrap, rep(100): xtpmg d.lshrgdpr d.lshrgdpr1 d.lshrgdpr2 d.lshrgdpr3 d.lshrgdpr4 d.stdresid d.stdresid1 d.stdresid2 d.stdresid3 d.stdresid4 d.stdresid d.lshrtpils1 d.lshrtpils2 d.lshrtpils3 d.lshrtpils4 , lr(l.lshrgdpr lshtc lshrtpils) ec(mu) replace mg

    in this equation, lshrgdpr is the log of real GDP and stdresid is the residuals that capture a discretionary fiscal policy, lshrtpils is log of taxes. I also use 4 lags for each variable.

    I would like to know if there is a way to correct the standards errors after XTPMG in this type of situation. Thank you


    THIERRY YOGO, Ph.D,


  • #2
    Hi Thierry,
    I'm not completely sure if bootstrapping only during the second step is the correct approach for correcting the Standard errors. I would recommend doing the bootstrap for the whole system instead. Now, for your specific command, I think you also need to specify the cluster (the panel id), so your random sample is random selection of "individuals", but consistent across time, rather than just a random sample each year.
    Hope this helps.
    Fernando

    Comment


    • #3
      Thank you very Fernando. Your comments do help. But i am still facing an issue which is that when i am running the boostrap command as in my post, i get an error message like "unsufficient observations to compute bootstrap standard errors". I have quarterly data for 11 countries from 1992q3 to 2013q2. Then i have on average 56 observation per group. Then i don't know what is going on. Please if somebody has an explanation, i will be so grateful

      Comment


      • #4
        Could you post the full command and error? That might help see why you are running into problems.

        Comment


        • #5
          here is my program

          cap program drop mysimul9
          program define mysimul9
          drop _all
          use "C:\Users\utyogo\Documents\recup DELL\Documents\fiscal multiplier\New data fiscal multiplier.dta"
          set more off
          merge 1:1 country year time using externaldebt.dta
          drop _merge
          count
          bsample
          count
          tsset id time
          xtpmg d.lshrgdpr d.lshrgdpr1 d.lshrgdpr2 d.lshrgdpr3 d.lshrgdpr4 d.stdresid d.stdresid1 d.stdresid2 d.stdresid3 d.stdresid4 d.lshrtpils d.lshrtpils1 d.lshrtpils2 d.lshrtpils3 d.lshrtpils4 , lr(l.lshrgdpr lshtc lshrtpils) ec(mu) replace mg
          end
          simulate _b _se, reps(50): mysimul9

          i get the following message
          repeated time values within the panel
          an error occured when simulate execute mysimul9


          i have to mention that i am using quarterly data with the following structure
          country year time variable
          romania 1992 1992q1 12
          romania 1992 1992q2 14
          .
          ..and so on. The data span from 1992 q1 to 2013q3
          The point is that i can delete year without deleting some of the quarters

          thank you once more

          Comment


          • #6
            Hi Thierry,
            As I suspected at first, your approach on the bsample was the problem. As I said earlier, when you bootstrap panel data, you need to specify the cluster, so you bootstrap individuals, not observations.
            In the specific case you should do:
            - bsample, cluster(id)
            HTH.
            Fernando

            Comment

            Working...
            X