Announcement

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

  • How to solve 'Convergence not Achieved' in Quantile Regression?

    Hi,

    I am running quantile in measure intergenerational health mobility. It is a log-log model. I am regressing the log health index of the child on the log health index of the household head using age, age squared, and an interaction between the log health index of time and year variable. The year variable (SURVEY) is a dummy taking values 1 and 2. The regressions that I have tried:

    Code:
    qreg log_health_index log_head_health_index c.log_head_health_index##SURVEY age age2 [weight=FWT]
    
    sqreg log_health_index log_head_health_index c.log_head_health_index##SURVEY age age2
    
    bsqreg log_health_index log_head_health_index c.log_head_health_index##SURVEY age age2
    Based on past threads on statalist, I have tried the following:

    1. I have used fre on SURVEY to determine whether it is rightly coded as a dummy. The result from fre:
    Code:
    . fre $SURVEY
    
    SURVEY -- IHDS1    (2005)    or IHDS2    (2012)
                        
            Freq.    Percent    Valid    Cum.
                        
    Valid   1 IHDS1    1    42872    48.19    48.19    48.19
    2 IHDS2    2    46096    51.81    51.81    100.00
    Total        88968    100.00    100.00              
                        
    too many values
    2. qreg log_health_index , wlsiter(100)

    The result table:

    Code:
    Median regression                    Number of obs =    88,968
    Raw sum of deviations    238.99 (about    0)
    Min sum of deviations    238.99                Pseudo R2     =    0.0000
    
                            
    log_health~x       Coef.    Std. Err.        t    P>t     [95% Conf.    Interval]
                            
    _cons           0    (omitted)

    Based on these things, I cannot infer what I doing incorrectly. I have attached a sample of the dataset using dataex.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double log_health_index float log_head_health_index int SURVEY float(age age2)
                     0         0 1 35 1225
                     0  .9755365 2 37 1369
                     0         0 1 31  961
                     0         0 1 24  576
                     0  .9755365 2 31  961
                     0         0 1 15  225
                     0         0 2 23  529
                     0         0 1 13  169
                     0         0 2 20  400
                     0         0 1 10  100
                     0         0 2 17  289
                     0         0 1  7   49
                     0         0 2 14  196
                     0         0 1  5   25
                     0         0 2 12  144
                     0         0 1 13  169
                     0         0 2 20  400
                     0         0 1  7   49
                     0         0 2 14  196
                     0         0 1  6   36
                     0         0 2 13  169
                     0         . 1 43 1849
                     0         . 2 27  729
                     0         . 2 23  529
                     0         . 2 18  324
                     0         . 2 16  256
                     0         . 2 12  144
                     0         0 1 19  361
                     0         0 2 26  676
                     0         0 1 17  289
                     0         0 2 24  576
                     0         0 1 13  169
     .3351881991313361         0 2 18  324
                     0         0 1 11  121
                     0         0 2 16  256
                     0         0 1  9   81
                     0         0 2 15  225
                     0         0 1 11  121
                     0         0 2 18  324
                     0         0 1  7   49
                     0         0 2 14  196
                     0         0 1  6   36
                     0         0 2 13  169
                     0         0 1  5   25
                     0         0 2 12  144
                     0         . 2 21  441
                     0         . 1 14  196
                     0         . 2 20  400
                     0         . 1 12  144
                     0         . 2 17  289
                     0         . 1 10  100
                     0         . 2 14  196
                     0         . 1  7   49
                     0         . 2 14  196
    .23162336927638064         . 1  6   36
                     0         . 2 12  144
                     0         0 1  4   16
                     0         0 2 11  121
                     0         0 1  2    4
                     0         0 2  9   81
                     0         0 1 19  361
                     0         0 2 26  676
                     0         0 1 16  256
                     0         0 2 23  529
                     0         0 1 14  196
                     0         0 2 21  441
    .23162336927638064         0 1 12  144
                     0         0 2 19  361
                     0         0 1 10  100
                     0         0 2 15  225
                     0         0 1 11  121
                     0 .23162337 2 18  324
                     0         0 1 10  100
                     0 .23162337 2 17  289
                     0         0 1  7   49
                     0 .23162337 2 14  196
                     0         0 1  3    9
                     0 .23162337 2 10  100
                     0         0 1  1    1
                     0 .23162337 2  7   49
                     0 .23162337 1 31  961
                     0 1.1552391 2 38 1444
                     0         . 1 17  289
    .23162336927638064         . 1 15  225
                     0         . 2 22  484
                     0         . 1 12  144
                     0         . 2 19  361
                     0         . 1 12  144
                     0         . 2 18  324
                     0         . 1 32 1024
                     0         . 1 23  529
     .3040916481639056         0 1  9   81
                     0         0 2 16  256
                     0         0 1  8   64
                     0         0 2 15  225
                     0         0 1  6   36
                     0         0 2 13  169
                     0         0 1  4   16
                     0         0 2  9   81
                     0         0 1 38 1444
    end
    label values SURVEY SURVEY
    label def SURVEY 1 "IHDS1 1", modify
    label def SURVEY 2 "IHDS2 2", modify

  • #2
    qreg by default calculates median regression. The implication of your data example is that your response has median zero, as most values are zero.

    That in itself doesn't rule out convergence -- as shown here -- but it raises the question of what you hope to find.

    Code:
    . sysuse auto , clear
    (1978 automobile data)
    
    . qreg foreign
    Iteration  1:  WLS sum of weighted deviations =   13.27729
    
    Iteration  1: sum of abs. weighted deviations =         11
    note: alternate solutions exist.
    Iteration  2: sum of abs. weighted deviations =         11
    
    Median regression                                   Number of obs =         74
      Raw sum of deviations       11 (about 0)
      Min sum of deviations       11                    Pseudo R2     =     0.0000
    
    ------------------------------------------------------------------------------
         foreign | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
           _cons |          0   .1255834     0.00   1.000    -.2502873    .2502873
    ------------------------------------------------------------------------------
    
    .

    Comment


    • #3
      Dear Jose Williams,

      It looks as if your dependent variable is discrete, and in that case standard quantile regression does not work. There are quantile regression methods for data like that.

      Best wishes,

      Joao

      Comment

      Working...
      X