Announcement

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

  • Insufficient observations for bootstrap standard errors in fixed effects quantile regression

    Hello, I am new to Stata so any advice on this would really help! I am trying to bootstrap clustering to my quantile regression using the xqtreg command, but I am getting the following error message for my code:
    Click image for larger version

Name:	Screen Shot 2022-01-21 at 3.50.15 PM.png
Views:	1
Size:	14.7 KB
ID:	1646196



    I would like to cluster and have fixed effects at the settlement level. Any idea what is going on? Am I doing something wrong in my code? Any advice would be appreciated. Thank you!
    Last edited by Isabelle Mary; 21 Jan 2022, 15:06.

  • #2
    See all those red x's? They're telling you that the -xtqreg- command failed to run in every single iteration! The "insufficient observations" error message is actually an understatement: there were no -xtqreg- results available for computing bootstrap standard errors.

    So you need to figure out why your -xtqreg- command doesn't run. I suggest that you first try running the -xtqreg- command without the bootstrap. You may get your answer right then and there.

    If not, add the -noisily- option to the bootstrap prefix. Then you will get -xtqreg- output and error messages along the way and that will probably give you some information to help you track down the problem.

    Comment


    • #3
      You should follow the FAQ and post your code as text in code delimiters, not as a picture. Since your problem is due to your data you could also describe it a little, otherwise no one can really say what is causing the problem. E.g. the number and size of your groups.

      In any case you can try the command
      Code:
      bsqreg
      which is built into Stata (or at least version 16 and on) and has worked for me in the past.

      Comment


      • #4
        You can try -mmqreg- from ssc
        very similar syntax
        bootstrap, cluster(settlement) : mmqreg y x1 x2, abs(settlement)

        and mmqreg also allows you to cluster al thought I would use it just to compare standard errors
        hth

        Comment


        • #5
          Originally posted by Clyde Schechter View Post
          See all those red x's? They're telling you that the -xtqreg- command failed to run in every single iteration! The "insufficient observations" error message is actually an understatement: there were no -xtqreg- results available for computing bootstrap standard errors.

          So you need to figure out why your -xtqreg- command doesn't run. I suggest that you first try running the -xtqreg- command without the bootstrap. You may get your answer right then and there.

          If not, add the -noisily- option to the bootstrap prefix. Then you will get -xtqreg- output and error messages along the way and that will probably give you some information to help you track down the problem.
          Thanks!! The regression runs fine without the bootstrap. I added -noisily- to the bootstrap and it is giving me the error message "collinearity in replicate sample is not the same as the full sample, posting missing values". I think that the issue is that the clusters are very unbalanced - ranging from 6 to 38. I am not sure if there is any way to get around this...any suggestions would be appreciated.
          Last edited by Isabelle Mary; 22 Jan 2022, 12:05.

          Comment


          • #6
            Originally posted by Jackson Monroe View Post
            You should follow the FAQ and post your code as text in code delimiters, not as a picture. Since your problem is due to your data you could also describe it a little, otherwise no one can really say what is causing the problem. E.g. the number and size of your groups.

            In any case you can try the command
            Code:
            bsqreg
            which is built into Stata (or at least version 16 and on) and has worked for me in the past.
            Thanks! I will try that.

            And I am working on an offline, secured server that does not allow you to copy and paste, access the internet, or export, so it's difficult for me to post my code or give a sample of data. I will manually write it out for the future, but I was worried about typos or messing up the code while writing it over.

            Comment


            • #7
              Dear Isabelle Mary,

              I am afraid bsqreg will estimate a very different model and therefore is not a solution for your problem. My suggestion is that you xtset the data by settlement before running the bootstrap (and in that case you do not need the option i(settlement)). Alternatively, try Fernando's suggestion in #4.

              Best wishes,

              Joao

              Comment

              Working...
              X