Announcement

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

  • Quantile Regression with panel data and cluster

    Hi,

    I have a panel of households over a period of 22 years. I want to run a quantile regression on my panel data and cluster as well. Is there a command to do this? Would qreg2 or qregpd work? Also, I have many factor variables including my DD variable that is an interaction as well as state and year fixed effects. When I run my regressions in qreg2 or qregpd, I get an error message that factor variables are not allowed. Is there a way to get around this?

    Thank you for any help!

  • #2
    Surya:
    see if things work using the -xi:- prefix (see _help xi-).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Surya:
      see if things work using the -xi:- prefix (see _help xi-).
      Thanks Carlo, that helped!

      Would you have any insight into if I should be using qregpd or qreg2? I know qregpd is for panel data but I can't find an option to cluster my standard errors in this command while in qreg2 I can cluster but it seems that it is not for panel data.

      Comment


      • #4
        Dear Surya,

        qreg2 is for panel data in the sense that it allows clustering; however, it does not allow for fixed effects. As far as I understand qregpd allows you to condition on the fixed effects, but they are not actually included in the model. So, which one to use depends on what you want to do.

        Best wishes,

        Joao

        Comment


        • #5
          Did you find a solution to your problem? I am facing the same issue and I might have to just move over to R to run my regressions because there are no options I see on Stata that can allow for clustering AND fixed effects on Stata. (No real options for clustering on R either).

          Comment


          • #6
            Dear Nikki Tavasoli,

            In Stata you can either cluster or do FE. What would be the advantage of R?

            Best wishes,

            Joao

            Comment


            • #7
              Dear all is there any news on this? Is clustering possible?

              Comment


              • #8
                You can do clustering in qreg2, but this command does not allow fixed effects. You can use xtqreg to estimate a model with fixed effects and do a clustered bootstrap to compute standard errors.

                Best wishes,

                Joao

                Comment


                • #9
                  Dear Joao Joao Santos Silva ,

                  I tried to use xtqreg for fixed effect quantile regression, but the option only allows for id fixed effect. I also need to include time fixed effect, so I added i.time_id in the model, but I got an error message " factor-variable and time-series operators not allowed". Is there no way to include multiple fixed effects using xtqreg? Thank you!

                  Sincerely,
                  Soyoung

                  Comment


                  • #10
                    Hi Soyoung,
                    Try to update to the latest version of xtqreg. The older version did not allow for factor variables, but the newer version does.
                    Also, regarding to the modeling, if you want to add year fixed effects, be sure that this are indeed years (or months), but not a combination of year and individual fixed effects, as your variable name suggests.
                    Best regards
                    Fernando

                    Comment


                    • #11
                      Hello Fernando FernandoRios ,

                      Thank you so much for quick reply. I actually installed xtqreg just recently, and I wasn't aware that this is older version. Could you walk me through how to update a specific command?

                      Sincerely,
                      Soyoung

                      Comment


                      • #12
                        just type
                        ssc install xtqreg, replace

                        Comment


                        • #13
                          FernandoRios This is great. Thank you so much!

                          Comment


                          • #14
                            Let me also publicly thank FernandoRios for the help with the updated version of the command, especially with the factor variables. I am very grateful!

                            Best wishes,

                            Joao

                            Comment


                            • #15
                              Originally posted by Joao Santos Silva View Post
                              Let me also publicly thank FernandoRios for the help with the updated version of the command, especially with the factor variables. I am very grateful!

                              Best wishes,

                              Joao
                              It was my pleasure!

                              Comment

                              Working...
                              X