Announcement

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

  • Quantile regression, with specified quantiles

    Dear all,

    I would like to run a quantile regression with factor variables and clustered standard errors. The dependent variable is income (Y) and independent variables are precipitation (P), temperature (T) and state-specific fixed effects (i.State). Because the prices in my sample vary by state and urban/rural residence, I would like to consider this in the quintile regression. Hence the quintiles should not only be defined by income, but also by state and urban/rural residence. Is this somehow possible in Stata? Many thanks

  • #2
    If I understand you correctly, then it should be enough to run separate estimations for each combination of state and residence.
    If you mean something different, then you have to explain in more detail what you want and what your data looks like.

    Comment


    • #3
      Stata can fit the quantile regression of Koenker, R. and Bassett Jr, G., 1978. Regression quantiles. Econometrica: journal of the Econometric Society, pp.33-50.

      I do not know what you mean by "the quintiles should not only be defined by income, but also by state and urban/rural residence."

      In Koenker and Bassett's model, the conditional quantile is modelled as a linear function of some predictor variables. If this is what you want to do, here (and you are in luck, -qreg- accepts factor variable notation):

      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . qreg price mpg head i.rep, q(75) nolog vce(robust)
      
      .75 Quantile regression                             Number of obs =         69
        Raw sum of deviations  73169.5 (about 6303)
        Min sum of deviations 56790.38                    Pseudo R2     =     0.2239
      
      ------------------------------------------------------------------------------
                   |               Robust
             price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               mpg |  -445.2941   118.4047    -3.76   0.000    -681.9818   -208.6064
          headroom |  -395.3882   832.8927    -0.47   0.637    -2060.317     1269.54
                   |
             rep78 |
                2  |   18.41176    3762.43     0.00   0.996    -7502.579    7539.403
                3  |   2233.176   2062.772     1.08   0.283    -1890.247      6356.6
                4  |   2795.812   1408.011     1.99   0.051    -18.76188    5610.385
                5  |   4880.635    2240.39     2.18   0.033     402.1597    9359.111
                   |
             _cons |   15672.84   2837.937     5.52   0.000     9999.879    21345.79
      ------------------------------------------------------------------------------
      
      . qreg price mpg head i.rep, q(75) nolog vce(cluster rep)
      option vce( cluster rep) is not allowed
      r(198);
      And it turns out that -qreg- does not calculate clustered standard errors.

      Comment

      Working...
      X