Announcement

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

  • Quantile regression giving omitted standard error and zero coefficients

    Hello,

    Currently, I am using qreg in Stata 15.1

    My data looks like:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    
    clear
    
    input long familyid int Year float(q childx ratio) byte(moth_edu fath_edu)
    
    2545665 2013 212         0 .59322035 5 7
    
    2546785 2013 212         0  1.516129 8 4
    
    2546905 2013 212         0  .5555556 7 8
    
    2547465 2013 212         0        .6 6 6
    
    2547935 2013 212         0  .9705882 4 5
    
    2547995 2013 212         0 1.1184211 4 4
    
    2548115 2013 212         0     .4375 4 5
    
    2548145 2013 212 2308.9746  .8510638 7 4
    
    2548355 2013 212         0  .7435898 4 2
    
    2548545 2013 212  2963.038  .7894737 7 4
    
    2548625 2013 212         0 .18487395 5 8
    
    2548665 2013 212         0 .24671906 4 7
    
    2548715 2013 212         0  .6923077 4 5
    
    2549115 2013 212         0  1.368421 7 6
    
    2549795 2013 212         0  .6071429 2 2
    
    2549965 2013 212 10140.174 1.6666666 7 7
    
    2550275 2013 212         0  1.945946 8 7
    
    2550425 2013 212         0  .8837209 6 5
    
    2550635 2013 212  790.1434  .6041667 5 5
    
    2551585 2013 212  7901.434  .6363636 4 5
    
    2551875 2013 212         0  .4022988 7 8
    
    2552265 2013 212         0  .8166667 4 4
    
    2552495 2013 212         0       2.5 7 7
    
    2552715 2013 212         0      .875 5 4
    
    2553825 2013 212  7901.434     .5625 4 2
    
    2554325 2013 212  5425.651       .85 8 4
    
    2554425 2013 212         0 .50605714 7 7
    
    2554815 2013 212         0      .875 5 5
    
    2555075 2013 212         0  .9846154 5 5
    
    2555235 2013 212         0  .4615385 4 4
    
    2555345 2013 212         0  .9649123 8 7
    
    2555415 2013 212 10535.245       .45 6 6
    
    2556405 2013 212         0 .16977993 7 7
    
    2556445 2013 212         0         1 4 5
    
    2556765 2013 212         0 1.0630273 7 7
    
    2557095 2013 212         0 1.1555556 5 5
    
    2557185 2013 212         0 1.4945405 4 7
    
    2557215 2013 212         0  .8266667 7 7
    
    2557425 2013 212  5618.797  1.054054 3 4
    
    2557465 2013 212 285.32956  .7674419 6 4
    
    2557485 2013 212  702.3497  .4074718 7 8
    
    2557525 2013 212         0  .3333333 5 5
    
    2557905 2013 212         0  .6195208 7 8
    
    2559085 2013 212         0  .7962963 8 8
    
    2560255 2013 212  2809.399  .8333333 8 4
    
    2560495 2013 212         0  .8571429 4 4
    
    2560905 2013 212         0        .6 4 7
    
    2562045 2013 212  5671.474 1.0403662 7 4
    
    2562345 2013 212         0       .25 3 8
    
    2562475 2013 212  9657.309 .44615385 8 8
    
    2562745 2013 212         0  .6896552 5 3
    
    2562835 2013 212         0  .3395062 7 4
    
    2563335 2013 212 10500.128       1.8 7 4
    
    2563535 2013 212   9218.34  .8166667 7 7
    
    2563545 2013 212         0 1.3793104 8 8
    
    2563715 2013 212         0  .9943978 8 2
    
    2564185 2013 212         0  .3333333 7 8
    
    2564515 2013 212         0      1.25 5 4
    
    2564845 2013 212         0     1.125 3 5
    
    2565255 2013 212 3511.7485       .75 2 2
    
    2565945 2013 212         0       1.5 7 5
    
    2566475 2013 212         0         1 8 8
    
    2566965 2013 212         0  .5011765 7 6
    
    2567575 2013 212         0  .6666667 5 7
    
    2567665 2013 212 4828.6543  4.428387 7 4
    
    2567975 2013 212         0   .301831 8 8
    
    2568165 2013 212         0       2.8 7 6
    
    2568625 2013 212         0  .4783773 4 4
    
    2569045 2013 212         0 1.1944444 5 6
    
    2569185 2013 212         0  .1810986 7 7
    
    2569265 2013 212  2107.049     .6625 7 7
    
    2569535 2013 212         0  .6666667 4 4
    
    2570155 2013 212         0  .8387097 4 5
    
    2571045 2013 212 1053.5245  .8333333 7 7
    
    2571235 2013 212   3072.78 1.0857143 7 7
    
    2571275 2013 212         0  .6896552 7 7
    
    2571655 2013 212         0  .6153846 8 7
    
    2571735 2013 212         0 1.0833334 4 4
    
    2571875 2013 212         0 1.1428572 5 4
    
    2572495 2013 212         0 1.0788236 8 6
    
    2573035 2013 212  438.9686  .4716109 8 8
    
    2573575 2013 212         0 1.1111112 8 8
    
    2574385 2013 212 2194.8428 .12222222 7 7
    
    2575355 2013 212         0  .8924731 7 4
    
    2575465 2013 212         0 1.1290323 8 7
    
    2575585 2013 212         0         1 4 5
    
    2575775 2013 212         0 2.3428571 5 5
    
    2576205 2013 212         0 .53846157 4 5
    
    2576615 2013 212         0 1.2121212 6 4
    
    2576785 2013 212         0  .8857143 7 7
    
    2577005 2013 212         0       .88 5 5
    
    2577275 2013 212   15363.9         1 8 8
    
    2578175 2013 212 1755.8743   .680851 7 6
    
    2578565 2013 212         0      .875 7 4
    
    2578805 2013 212         0  .4285714 6 8
    
    2579084 2013 212  7901.434  .5555556 7 6
    
    2579375 2013 213         0  .9166667 2 4
    
    2579445 2013 213         0  .9285714 7 8
    
    2579804 2013 212         0  .8076923 4 4
    
    2579805 2013 213         0      1.08 4 4
    
    end
    
    format %tq q
    I ran the following command:

    Code:
     qreg childx ratio , quantile (0.25)
    And got these results:

    Code:
    . qreg childx ratio , quantile (0.25)
    Iteration  1:  WLS sum of weighted deviations =   10204047
    
    Iteration  1: sum of abs. weighted deviations =   11206464
    Iteration  2: sum of abs. weighted deviations =   10197148
    Iteration  3: sum of abs. weighted deviations =  5805605.2
    Iteration  4: sum of abs. weighted deviations =  5805605.2
    Iteration  5: sum of abs. weighted deviations =  5805605.2
    
    .25 Quantile regression                             Number of obs =     13,076
      Raw sum of deviations  5805605 (about 0)
      Min sum of deviations  5805605                    Pseudo R2     =     0.0000
    
    ------------------------------------------------------------------------------
          childx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           ratio |          0  (omitted)
           _cons |          0  (omitted)
    ------------------------------------------------------------------------------
    
    .



    I wanted to ask why I am getting these types of results!

    Thank you very much!

  • #2
    Dear Jenna Kerry,

    The estimator implemented by qreg is valid only for continuous dependent variables, which is not the case here. If you tell us more about the nature of your data, we may be able to suggest alternative approaches to estimating quantiles.

    Best wishes,

    Joao

    Comment


    • #3
      Hello Jao,

      Thank you very much for your response!

      Here is some information about my dependent variable
      Code:
       childx
      Code:
      . sum childx
      
          Variable |        Obs        Mean    Std. Dev.       Min        Max
      -------------+---------------------------------------------------------
            childx |     13,076    1775.958    4754.127          0   74987.95
      
      . des childx
      
                    storage   display    value
      variable name   type    format     label      variable label
      -------------------------------------------------------------------------------------------------------------------
      childx          float   %9.0g                 
      
      . list childx in 1/20
      
           +----------+
           |   childx |
           |----------|
        1. |        0 |
        2. |        0 |
        3. |        0 |
        4. |        0 |
        5. |        0 |
           |----------|
        6. |        0 |
        7. |        0 |
        8. | 2308.975 |
        9. |        0 |
       10. | 2963.038 |
           |----------|
       11. |        0 |
       12. |        0 |
       13. |        0 |
       14. |        0 |
       15. |        0 |
           |----------|
       16. | 10140.17 |
       17. |        0 |
       18. |        0 |
       19. | 790.1434 |
       20. | 7901.434 |
           +----------+
      
      .

      Please let me know what more information I can give.

      Thank you!!

      Comment


      • #4
        Dear Jenna Kerry,

        We can see that the variable has a mass-point at zero, which is probably a lower bound. Is there an upper bound? What does the variable represent?

        Best wishes,

        Joao

        Comment


        • #5
          Also, the qplot looks like this:



          Click image for larger version

Name:	Graph.png
Views:	1
Size:	89.9 KB
ID:	1700879
          Last edited by Jenna Kerry; 09 Feb 2023, 02:19.

          Comment


          • #6
            The variable is expenditure on childcare for families. Some family pays zero dollar, the maximum amount is 74,987.95.

            Comment


            • #7
              Dear Jenna Kerry,

              Quantiles for that kind of data are tricky. The paper

              Machado, J.A.F., Santos Silva, J.M.C., and Wei, K. (2016), Quantiles, Corners, and the Extensive Margin of Trade, European Economic Review, 89, pp. 73–84.

              may help but the associated fqreg command is for the case where there is an upper bound. You can either write the code for your case, or you may be able to get decent results by setting a very large upper bound (e.g., several times the maximum value in the sample).

              Best wishes,

              Joao

              Comment


              • #8
                Thank you, I will look into the paper!

                Comment

                Working...
                X