Announcement

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

  • Panel data + quantile regression

    Hello everyone,

    for an important seminar at my University I am running a gravity model of trade (Jan Tinbergen 1962).
    Therefore I use an unbalanced Panel (1948-2015) 224 individuals. 15k observations. I want to use a quantile regression though.
    The aim is to figure how distance variables matter for separete product aggregates (by considering different export volumes through quantiles).

    Modell: log export(odh) = ß0(h) + lnß1Y(od) + ß2lnPCY(od) + ß3lnD + ß4com_lang + ß5contiguity + ß6colony + ß7rta + ß8gatt
    o=origin d=destination h=productgroup

    Export(odh)= natural logarithm of exports from o to d specific by h
    ß0= constant
    Y(od)= natural logarithm of product of GDP of o multiplied with d
    PCY(od)= natural logarithm of pc GDP of o multiplied with d
    D= natural logarithm of real distance between o and d
    com_lang= dummy variable for common language; 1 = yes, 0 = no
    contiguity= dummy variable for contiguity; 1 = yes, 0 = no
    colony= dummy variable for colony; 1 = yes, 0 = no
    rta= dummy variable for regional trade agreement; 1 = yes, 0 = no
    gatt= dummy variable for GATT/WTO membership; 1 = yes, 0 = no

    Also have to find a solution to use time fixed effects and at the same time not loosing the distance variables. Furthermore I have to incorporate individual fixed effects (or probably a ton of specific fixed effects).


    I am a noob though, so after specifying all these what would be my first reasonable steps in Stata?

    Thanks + Best,
    Burz

  • #2
    hello Jon, for the fixed effects, it would be possible with the command -rifhdreg- or -rifreg-
    2B or not 2B, that's a question!

    Comment


    • #3
      Hi Liu, thank you. I am still gathering information.

      Comment


      • #4
        Dear Jon Burzka,

        Further to Liu Qiang's helpful advice, please note that both -rifhdreg- and -rifreg- are for unconditional quantiles, while it is likely that you are interested in conditional quantiles. For that, please consider -xtqreg- but note that estimating quantile regressions for trade data is not trivial because of the high proportion of zeros.

        Best wishes,

        Joao

        Comment


        • #5
          thanks Joao. The 0's issue is a problem indeed.. As the panel is strongly unbalanced but the attrition is seemingly random I so far just cut out some exptreme individuals but don't know if this is sufficient reasoning.

          I also wonder how ln(0) = ? affects the results..

          Best,
          Burz
          Last edited by Jon Burzka; 10 Jun 2019, 04:38.

          Comment


          • #6
            Hi Jon
            it is usually never recommended to use log transformation when you have zeros that matter in the context of your regression. The reason for this is that ln(0) is undefined in real numbers. So, they will just be dropped out as missing when running regressions.
            For situations like that, as you may already know, its better to use a poisson type of model (gravity model). I think you may be facing something that has not really been studied formally. a Quantile poisson regression with fixed effects.
            Perhaps your best option would be to estimate the quantile panel model with the dependent variable in levels, rather than logs. And see if you can observe heterogeneity there.
            Best
            Fernando

            Comment


            • #7
              Dear Jon Burzka,

              As FernandoRios noted, quantile regression with FE for data with a mass-point point at zero is something that has not been formally studied, so I would recommend great caution. I have a paper where we look at the estimation of quantiles for this kind of that but, as we note there, the inclusion of fixed effect in this context is something that has not been fully studied.

              Best wishes,

              Joao

              Comment


              • #8
                thanks.

                I found two papers running this setup. One uses a cencored model, the other one uses "fixed effect quantile regression developed by Koenker (2004)" ""A median fixed effect quantile regression is, in fact, a fixed effect Tobit regression developed by Bo HonorØ (1992) for data whose observations concentrate above zeros."" Not really firm with that yet..

                Regrading fixed effects thats what the guy did: "Country xed e⁄ect estimation will be carried out using "within" transformation. Considering the fact of huge dataset for reference priced and heterogeneous goods, the usual transformation of pre-multiplying both sides of equation 14 by the annihilator matrices is not possible, since the dimension of the annihilator matrices would be too large.9 Thus, my "within" estimation will be implemented by first taking deviation of all variables from country o's mean, then from country d's mean." Is this reasonable?


                For the censored case I found opposing opinions proclaiming that this will distort the estimation..

                Appart from that could I use the "swap" function of ln, which is the exponent, as exp(0) = 1. But I guess this would result in similar results than censored log model..

                Best,
                Burz

                Comment


                • #9

                  I can only say that within transformation is not valid for models other than Linear regression models. So it will not give you anything related to what you want if you do that.

                  Comment


                  • #10
                    thanks.

                    could I use fixed effect Tobit regression by using trimmed least-absolute deviation LAD estimator and add corresponding quantiles?

                    edit: right now my sample size is reduced to 5k observations where about 8% are zeros.

                    Comment


                    • #11
                      im now trying to run the xtqreg comand to compare it with other estimations but i recieve the following issue:

                      xtqreg $ylist $xlist, quantile(.5)
                      Path for R.exe: C:\Program Files\R\R-3.1.3\bin\x64\R.exe
                      note: com_currency omitted because of collinearity
                      note: o.com_currency dropped because of collinearity
                      factor variables and time-series operators not allowed
                      r(101);

                      Comment


                      • #12
                        Please try using the xi prefix.

                        Best wishes,

                        Joao

                        Comment


                        • #13
                          thanks. neither xiqreg nor xixtqreg works.
                          199 appears

                          Comment


                          • #14
                            The correct syntax is:
                            Code:
                            xi: xtqreg ...

                            Comment


                            • #15
                              I get the same error again as in the first place.

                              xi: xtqreg $ylist $xlist, quantile(.5)

                              Path for R.exe: C:\Program Files\R\R-3.1.3\bin\x64\R.exe
                              note: com_currency omitted because of collinearity
                              note: o.com_currency dropped because of collinearity
                              factor variables and time-series operators not allowed
                              r(101);

                              Comment

                              Working...
                              X