Announcement

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

  • IVQREGRESS problem with if and vce(robust)

    Dear Statalist,

    I have encountered a problem where 'if' in ivqregress command in Stata 18 is not working if vce(robust) option is used with it. I have reproduced the problem below. In the first example, 'if' works (ownhome==1 subsample is used). But in the second example, with the addition of vce(robust) option, 'if' doesn't work anymore (the entire sample is used, instead of just the ownhome==1 subsample). Kindly let me know if I am doing something wrong, or if this is a bug.

    *** First Example ***

    Code:
    webuse assets2
    Code:
    ivqregress iqr assets (i.p401k = i.e401k) income age familysize i.married i.ira i.pension educ if ownhome==1 , quantile(10 50 90)
    Initial grid:
    Quantile = 0.10: .........10.........20.........30 done
    Quantile = 0.50: .........10.........20.........30 done
    Quantile = 0.90: .........10.........20.........30 done

    Adaptive grid:
    Quantile = 0.10: .........10.........20.........30 done
    Quantile = 0.50: .........10.........20.........30 done
    Quantile = 0.90: .........10.........20.........30 done

    IV quantile regression Number of obs = 6,296
    Estimator: Inverse quantile regression Wald chi2(24) = 2359.57
    Prob > chi2 = 0.0000

    -----------------------------------------------------------------------------------
    | Robust
    assets | Coefficient std. err. z P>|z| [95% conf. interval]
    ------------------+----------------------------------------------------------------
    q10 |
    p401k |
    Yes | 4293.235 590.6811 7.27 0.000 3135.522 5450.949
    income | .0635461 .0138378 4.59 0.000 .0364246 .0906677
    age | 190.5692 19.87328 9.59 0.000 151.6182 229.5201
    familysize | -483.1987 154.6924 -3.12 0.002 -786.3903 -180.0072
    |
    married |
    Married | -935.8011 440.1757 -2.13 0.034 -1798.53 -73.07261
    |
    ira |
    Yes | 8745.51 446.2618 19.60 0.000 7870.852 9620.167
    |
    pension |
    Receives pension | -5.082095 388.9164 -0.01 0.990 -767.3443 757.1801
    educ | -68.64776 74.28996 -0.92 0.355 -214.2534 76.95789
    _cons | -13584.61 1615.843 -8.41 0.000 -16751.61 -10417.62
    ------------------+----------------------------------------------------------------
    q50 |
    p401k |
    Yes | 7979.171 842.5141 9.47 0.000 6327.874 9630.468
    income | .2691079 .0231217 11.64 0.000 .2237902 .3144256
    age | 245.7935 20.24533 12.14 0.000 206.1134 285.4736
    familysize | -478.287 129.0238 -3.71 0.000 -731.169 -225.405
    |
    married |
    Married | -1871.822 470.733 -3.98 0.000 -2794.441 -949.2021
    |
    ira |
    Yes | 22589.1 1166.895 19.36 0.000 20302.02 24876.17
    |
    pension |
    Receives pension | -802.2799 429.4881 -1.87 0.062 -1644.061 39.50123
    educ | -112.5388 80.19216 -1.40 0.161 -269.7126 44.63492
    _cons | -13421.89 1468.011 -9.14 0.000 -16299.14 -10544.64
    ------------------+----------------------------------------------------------------
    q90 |
    p401k |
    Yes | 12835.79 3094.711 4.15 0.000 6770.271 18901.32
    income | 1.096237 .0710617 15.43 0.000 .9569583 1.235515
    age | 869.6187 100.2409 8.68 0.000 673.1502 1066.087
    familysize | -1355.63 445.6364 -3.04 0.002 -2229.061 -482.1984
    |
    married |
    Married | -7333.136 1613.33 -4.55 0.000 -10495.2 -4171.068
    |
    ira |
    Yes | 60119.84 5482.446 10.97 0.000 49374.44 70865.23
    |
    pension |
    Receives pension | -4986.951 1878.684 -2.65 0.008 -8669.104 -1304.799
    educ | -232.3086 270.1343 -0.86 0.390 -761.7622 297.145
    _cons | -30935.17 4820.554 -6.42 0.000 -40383.28 -21487.06
    -----------------------------------------------------------------------------------
    Endogenous: 1.p401k
    Exogenous: income age familysize 1.married 1.ira 1.pension educ 1.e401k





    *** Second Example ***

    Code:
    ivqregress iqr assets (i.p401k = i.e401k) income age familysize i.married i.ira i.pension educ if ownhome==1 , quantile(10 50 90) vce(robust)
    Initial grid:
    Quantile = 0.10: .........10.........20.........30 done
    Quantile = 0.50: .........10.........20.........30 done
    Quantile = 0.90: .........10.........20.........30 done

    Adaptive grid:
    Quantile = 0.10: .........10.........20.........30 done
    Quantile = 0.50: .........10.........20.........30 done
    Quantile = 0.90: .........10.........20.........30 done

    IV quantile regression Number of obs = 9,913
    Estimator: Inverse quantile regression Wald chi2(24) = 3263.68
    Prob > chi2 = 0.0000

    -----------------------------------------------------------------------------------
    | Robust
    assets | Coefficient std. err. z P>|z| [95% conf. interval]
    ------------------+----------------------------------------------------------------
    q10 |
    p401k |
    Yes | 3305.904 468.5953 7.05 0.000 2387.474 4224.334
    income | .0359934 .0120754 2.98 0.003 .0123262 .0596607
    age | 140.5066 14.98849 9.37 0.000 111.1297 169.8835
    familysize | -290.4983 122.353 -2.37 0.018 -530.3058 -50.69085
    |
    married |
    Married | -1419.297 386.542 -3.67 0.000 -2176.905 -661.6883
    |
    ira |
    Yes | 7908.166 348.393 22.70 0.000 7225.328 8591.004
    |
    pension |
    Receives pension | -27.83389 328.8815 -0.08 0.933 -672.4297 616.7619
    educ | -307.3188 52.11844 -5.90 0.000 -409.4691 -205.1686
    _cons | -7442.676 1197.666 -6.21 0.000 -9790.057 -5095.294
    ------------------+----------------------------------------------------------------
    q50 |
    p401k |
    Yes | 5348.998 575.9941 9.29 0.000 4220.07 6477.925
    income | .1571562 .01235 12.73 0.000 .1329506 .1813618
    age | 99.40103 8.189474 12.14 0.000 83.34995 115.4521
    familysize | -203.5142 54.34734 -3.74 0.000 -310.033 -96.99536
    |
    married |
    Married | -1355.04 227.7764 -5.95 0.000 -1801.474 -908.6067
    |
    ira |
    Yes | 22637.69 1023.436 22.12 0.000 20631.79 24643.59
    |
    pension |
    Receives pension | -693.6053 210.6176 -3.29 0.001 -1106.408 -280.8023
    educ | -96.41078 32.12338 -3.00 0.003 -159.3714 -33.45011
    _cons | -4960.797 563.529 -8.80 0.000 -6065.294 -3856.301
    ------------------+----------------------------------------------------------------
    q90 |
    p401k |
    Yes | 16313.46 3072.568 5.31 0.000 10291.34 22335.58
    income | .8255442 .0570002 14.48 0.000 .7138257 .9372626
    age | 490.7687 47.84164 10.26 0.000 397.0009 584.5366
    familysize | -641.2733 185.945 -3.45 0.001 -1005.719 -276.8277
    |
    married |
    Married | -3211.854 749.3021 -4.29 0.000 -4680.459 -1743.249
    |
    ira |
    Yes | 68567.01 4953.925 13.84 0.000 58857.5 78276.53
    |
    pension |
    Receives pension | -4619.889 868.5539 -5.32 0.000 -6322.223 -2917.554
    educ | 33.19085 106.6064 0.31 0.756 -175.7538 242.1355
    _cons | -20512.35 2247.059 -9.13 0.000 -24916.5 -16108.19
    -----------------------------------------------------------------------------------
    Endogenous: 1.p401k
    Exogenous: income age familysize 1.married 1.ira 1.pension educ 1.e401k
    Last edited by Junior Becker; 10 May 2023, 09:45.

  • #2
    Dear Junior,

    Thank you for reporting this problem. We will fix it in a future update.

    Comment


    • #3
      Thanks, Enrique.

      Comment

      Working...
      X