Announcement

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

  • Omitted 2nd stage results with 2SLS model and panel data

    Dear all,

    I am currently running a 2SLS regression model with both time and individual fixed effects. However, I find with different age constraints, my second stage results are so different.
    One code I set the age constraints as age_diffy>=-10 & age_diffy<=11 and the second one is age_diffy>=-10 & age_diffy<=10. But I am really confused why the second stage results are totally omitted for age_diffy>=-10 & age_diffy<=10.

    I really hope someone can help me with this question!!! Thank you so much.


    In detail:

    the first one is: xtivreg outcome age_diffy age_diffy2 inter1 inter2 (retired = indi_ORAy) i.wave if age_diffy>=-10 & age_diffy<=11 & labor_force==1 & ep054_ ==1, first fe vce(r)

    First-stage within regression

    Fixed-effects (within) regression Number of obs = 1,192
    Group variable: newid Number of groups = 1,147

    R-squared: Obs per group:
    Within = 0.8234 min = 1
    Between = 0.0000 avg = 1.0
    Overall = 0.0002 max = 2

    F(10,1146) = 20.00
    corr(u_i, Xb) = -0.5340 Prob > F = 0.0000

    (Std. err. adjusted for 1,147 clusters in newid)
    ------------------------------------------------------------------------------
    | Robust
    retired | Coefficient std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    age_diffy | -.1208511 .052335 -2.31 0.021 -.2235342 -.018168
    age_diffy2 | -.0038789 .0024748 -1.57 0.117 -.0087346 .0009769
    inter1 | .1271927 .0722878 1.76 0.079 -.0146385 .2690239
    inter2 | -.0024991 .0038913 -0.64 0.521 -.0101339 .0051357
    |
    wave |
    2 | .1061347 .0738861 1.44 0.151 -.0388325 .251102
    4 | .3408324 .1975245 1.73 0.085 -.0467179 .7283826
    5 | .5130551 .2688112 1.91 0.057 -.0143622 1.040472
    6 | .6092881 .3218449 1.89 0.059 -.0221832 1.240759
    7 | .5936469 .3318852 1.79 0.074 -.0575239 1.244818
    |
    indi_ORAy | .797642 .1296571 6.15 0.000 .5432502 1.052034
    _cons | -.3089585 .2031058 -1.52 0.128 -.7074595 .0895425
    -------------+----------------------------------------------------------------
    sigma_u | .57338083
    sigma_e | .12303088
    rho | .95598575 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    Fixed-effects (within) IV regression Number of obs = 1,192
    Group variable: newid Number of groups = 1,147

    R-squared: Obs per group:
    Within = 0.3606 min = 1
    Between = 0.0085 avg = 1.0
    Overall = 0.0077 max = 2


    Wald chi2(10) = 307.28
    corr(u_i, Xb) = -0.4870 Prob > chi2 = 0.0000

    (Std. err. adjusted for 1,147 clusters in newid)
    ------------------------------------------------------------------------------
    | Robust
    heartever | Coefficient std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    retired | .1479382 .1138688 1.30 0.194 -.0752404 .3711169
    age_diffy | -.0112322 .0217147 -0.52 0.605 -.0537923 .0313279
    age_diffy2 | .00082 .0008095 1.01 0.311 -.0007667 .0024067
    inter1 | -.0930373 .0670657 -1.39 0.165 -.2244837 .038409
    inter2 | .0075708 .0052247 1.45 0.147 -.0026694 .0178109
    |
    wave |
    2 | -.0512984 .0675063 -0.76 0.447 -.1836083 .0810115
    4 | .0981351 .1524298 0.64 0.520 -.2006219 .396892
    5 | .1426473 .20156 0.71 0.479 -.252403 .5376976
    6 | .1871464 .2461851 0.76 0.447 -.2953675 .6696603
    7 | .1919604 .2694266 0.71 0.476 -.3361061 .7200269
    |
    _cons | .0037885 .1552308 0.02 0.981 -.3004582 .3080353
    -------------+----------------------------------------------------------------
    sigma_u | .36576327
    sigma_e | .09557573
    rho | .93608396 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    Instrumented: retired
    Instruments: age_diffy age_diffy2 inter1 inter2 2.wave 4.wave 5.wave 6.wave
    7.wave indi_ORAy

    the second one is:
    xtivreg disease age_diffy age_diffy2 inter1 inter2 (retired = indi_ORAy) i.wave if age_diffy>=-10 & age_diffy<=10 & labor_force==1 & ep054_ ==1, first fe vce(r)

    First-stage within regression

    Fixed-effects (within) regression Number of obs = 1,151
    Group variable: newid Number of groups = 1,108

    R-squared: Obs per group:
    Within = 0.8323 min = 1
    Between = 0.0015 avg = 1.0
    Overall = 0.0030 max = 2

    F(10,1107) = 20.04
    corr(u_i, Xb) = -0.4930 Prob > F = 0.0000

    (Std. err. adjusted for 1,108 clusters in newid)
    ------------------------------------------------------------------------------
    | Robust
    retired | Coefficient std. err. t P>|t| [95% conf. interval]
    -------------+----------------------------------------------------------------
    age_diffy | -.1201018 .0506138 -2.37 0.018 -.2194115 -.020792
    age_diffy2 | -.0039209 .0024343 -1.61 0.108 -.0086971 .0008554
    inter1 | .1454731 .0798084 1.82 0.069 -.0111198 .302066
    inter2 | -.004281 .0047667 -0.90 0.369 -.0136337 .0050717
    |
    wave |
    2 | .0824965 .0752169 1.10 0.273 -.0650872 .2300802
    4 | .3227128 .1933266 1.67 0.095 -.0566152 .7020408
    5 | .4932313 .2638468 1.87 0.062 -.0244649 1.010928
    6 | .5887558 .3147219 1.87 0.062 -.028763 1.206275
    7 | .5806172 .325852 1.78 0.075 -.0587399 1.219974
    |
    indi_ORAy | .7601296 .1474079 5.16 0.000 .4708992 1.04936
    _cons | -.3143619 .2126213 -1.48 0.140 -.7315481 .1028244
    -------------+----------------------------------------------------------------
    sigma_u | .56061452
    sigma_e | .12346465
    rho | .95374194 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    Fixed-effects (within) IV regression Number of obs = 1,151
    Group variable: newid Number of groups = 1,108

    R-squared: Obs per group:
    Within = . min = 1
    Between = . avg = 1.0
    Overall = . max = 2


    Wald chi2(1) = .
    corr(u_i, Xb) = . Prob > chi2 = .

    (Std. err. adjusted for 1,108 clusters in newid)
    ------------------------------------------------------------------------------
    | Robust
    heartever | Coefficient std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    retired | 0 (omitted)
    age_diffy | 0 (omitted)
    age_diffy2 | 0 (omitted)
    inter1 | 0 (omitted)
    inter2 | 0 (omitted)
    |
    wave |
    2 | 0 (omitted)
    4 | 0 (omitted)
    5 | 0 (omitted)
    6 | 0 (omitted)
    7 | 0 (omitted)
    |
    _cons | .1112076 . . . . .
    -------------+----------------------------------------------------------------
    sigma_u | .31761231
    sigma_e | 0
    rho | 1 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    Instrumented: retired
    Instruments: age_diffy age_diffy2 inter1 inter2 2.wave 4.wave 5.wave 6.wave
    7.wave indi_ORAy

    .

  • #2
    Do you really have panel data?

    Fixed-effects (within) IV regression Number of obs = 1,151
    Group variable: newid Number of groups = 1,108
    If "newid" is your panel identifier and you have 1108 distinct individuals and 1151 observations in total, then 1108/1151 \(\approx\) 96% of the individuals are observed only once. You might just as well consider your data cross-sectional.

    Comment


    • #3
      Dear Andrew,

      Thanks for the reply. I am pretty sure my dataset is a longitudinal dataset, so it should be panel.

      I also checked following group with lagged model:
      for lagged model it shows:
      in first stage:
      Fixed-effects (within) regression Number of obs = 13,607
      Group variable: newid Number of groups = 9,824

      in second stage:
      Fixed-effects (within) IV regression Number of obs = 41,102
      Group variable: newid Number of groups = 24,212

      May I ask why the number of obs and groups are so different in two stages?
      Also, as you could see, I only add another variable, which is ep054_ to the following models, why the dataset looks so different?

      For more reference, you can see my code and results in the following:
      xtivreg disease age_diffy age_diffy2 inter1 inter2 marital (retired = indi_ORAy) i.wave if age_diffy>=-10 & age_diffy<=10 & labor_force==1, first fe vce(r)

      First-stage within regression

      Fixed-effects (within) regression Number of obs = 80,759
      Group variable: newid Number of groups = 37,094

      R-squared: Obs per group:
      Within = 0.4098 min = 1
      Between = 0.5796 avg = 2.2
      Overall = 0.5134 max = 6

      F(11,37093) = 1041.53
      corr(u_i, Xb) = 0.3339 Prob > F = 0.0000

      (Std. err. adjusted for 37,094 clusters in newid)
      ------------------------------------------------------------------------------
      | Robust
      retired | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      age_diffy | .0950277 .0039366 24.14 0.000 .0873118 .1027436
      age_diffy2 | .0054146 .0002646 20.46 0.000 .004896 .0059333
      inter1 | -.0762128 .0035304 -21.59 0.000 -.0831326 -.0692931
      inter2 | -.0079227 .0003151 -25.14 0.000 -.0085404 -.0073051
      marital | .0022466 .0110893 0.20 0.839 -.0194888 .023982
      |
      wave |
      2 | .0357307 .0069812 5.12 0.000 .0220474 .049414
      4 | .1025342 .0183088 5.60 0.000 .0666484 .13842
      5 | .1342052 .0228198 5.88 0.000 .0894779 .1789326
      6 | .1632228 .0274145 5.95 0.000 .1094897 .2169559
      7 | .2208783 .0321602 6.87 0.000 .1578435 .2839132
      |
      indi_ORAy | .1204279 .0075325 15.99 0.000 .105664 .1351917
      _cons | .5866666 .0214541 27.35 0.000 .544616 .6287172
      -------------+----------------------------------------------------------------
      sigma_u | .32416312
      sigma_e | .23050622
      rho | .66417109 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      Fixed-effects (within) IV regression Number of obs = 80,759
      Group variable: newid Number of groups = 37,094

      R-squared: Obs per group:
      Within = 0.0675 min = 1
      Between = 0.0093 avg = 2.2
      Overall = 0.0164 max = 6


      Wald chi2(11) = 10279.33
      corr(u_i, Xb) = -0.0052 Prob > chi2 = 0.0000

      (Std. err. adjusted for 37,094 clusters in newid)
      ------------------------------------------------------------------------------
      | Robust
      heartever | Coefficient std. err. z P>|z| [95% conf. interval]
      -------------+----------------------------------------------------------------
      retired | -.0130915 .0298121 -0.44 0.661 -.0715222 .0453391
      age_diffy | .0082606 .0040804 2.02 0.043 .0002632 .016258
      age_diffy2 | .0006437 .0002442 2.64 0.008 .0001651 .0011224
      inter1 | -.0029004 .0029681 -0.98 0.328 -.0087177 .0029169
      inter2 | -.0001718 .0003976 -0.43 0.666 -.0009511 .0006075
      marital | -.0032544 .0071519 -0.46 0.649 -.0172718 .0107631
      |
      wave |
      2 | .0273259 .0048974 5.58 0.000 .0177271 .0369247
      4 | .0405002 .0124785 3.25 0.001 .0160428 .0649575
      5 | .0546734 .015704 3.48 0.000 .023894 .0854527
      6 | .0732871 .0189049 3.88 0.000 .0362342 .1103401
      7 | .0819929 .0225837 3.63 0.000 .0377296 .1262561
      |
      _cons | .0666161 .0234045 2.85 0.004 .0207441 .1124881
      -------------+----------------------------------------------------------------
      sigma_u | .29821655
      sigma_e | .15115482
      rho | .79560209 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      Instrumented: retired
      Instruments: age_diffy age_diffy2 inter1 inter2 marital 2.wave 4.wave 5.wave
      6.wave 7.wave indi_ORAy

      .


      . xtivreg disease L1.age_diffy L1.age_diffy2 L1.inter1 L1.inter2 L1.marital (L1.retired = L1. indi_ORAy) i.wave if L1.age_diffy>=-10 & L1.age_diffy<=10 & labor_force==1, first fe vce(r)

      First-stage within regression

      Fixed-effects (within) regression Number of obs = 13,607
      Group variable: newid Number of groups = 9,824

      R-squared: Obs per group:
      Within = 0.1613 min = 1
      Between = 0.0201 avg = 1.4
      Overall = 0.0068 max = 2

      F(7,9823) = 55.07
      corr(u_i, Xb) = -0.3467 Prob > F = 0.0000

      (Std. err. adjusted for 9,824 clusters in newid)
      ------------------------------------------------------------------------------
      | Robust
      __000004 | Coefficient std. err. t P>|t| [95% conf. interval]
      -------------+----------------------------------------------------------------
      age_diffy |
      L1. | .0313144 .0170861 1.83 0.067 -.0021778 .0648066
      |
      age_diffy2 |
      L1. | .0042818 .001345 3.18 0.001 .0016453 .0069182
      |
      inter1 |
      L1. | -.0517112 .0138465 -3.73 0.000 -.0788532 -.0245691
      |
      inter2 |
      L1. | -.0072432 .0014281 -5.07 0.000 -.0100425 -.0044438
      |
      marital |
      L1. | -.0054045 .035118 -0.15 0.878 -.074243 .063434
      |
      wave |
      2 | 0 (empty)
      5 | 0 (empty)
      6 | -.1181368 .0220845 -5.35 0.000 -.1614269 -.0748466
      7 | 0 (omitted)
      |
      indi_ORAy |
      L1. | .1362696 .0235653 5.78 0.000 .0900768 .1824625
      |
      _cons | .843435 .047912 17.60 0.000 .7495177 .9373523
      -------------+----------------------------------------------------------------
      sigma_u | .48187339
      sigma_e | .18851021
      rho | .86727289 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------

      Fixed-effects (within) IV regression Number of obs = 41,102
      Group variable: newid Number of groups = 24,212

      R-squared: Obs per group:
      Within = 0.0580 min = 1
      Between = 0.0105 avg = 1.7
      Overall = 0.0168 max = 4


      Wald chi2(9) = 6035.37
      corr(u_i, Xb) = 0.0066 Prob > chi2 = 0.0000

      (Std. err. adjusted for 24,212 clusters in newid)
      ------------------------------------------------------------------------------
      | Robust
      heartever | Coefficient std. err. z P>|z| [95% conf. interval]
      -------------+----------------------------------------------------------------
      retired |
      L1. | .0696582 .03052 2.28 0.022 .0098401 .1294764
      |
      age_diffy |
      L1. | -.0023588 .00477 -0.49 0.621 -.0117078 .0069903
      |
      age_diffy2 |
      L1. | .0001673 .0003024 0.55 0.580 -.0004254 .0007599
      |
      inter1 |
      L1. | -.0002404 .003623 -0.07 0.947 -.0073413 .0068605
      |
      inter2 |
      L1. | .0009104 .0005197 1.75 0.080 -.0001083 .0019291
      |
      marital |
      L1. | -.0050013 .0111639 -0.45 0.654 -.0268821 .0168796
      |
      wave |
      5 | .0400923 .0202437 1.98 0.048 .0004152 .0797693
      6 | .0575173 .0257137 2.24 0.025 .0071193 .1079152
      7 | .0726076 .0313591 2.32 0.021 .0111449 .1340703
      |
      _cons | .0428386 .0272541 1.57 0.116 -.0105785 .0962558
      -------------+----------------------------------------------------------------
      sigma_u | .3393069
      sigma_e | .14958866
      rho | .8372669 (fraction of variance due to u_i)
      ------------------------------------------------------------------------------
      Instrumented: L.retired
      Instruments: L.age_diffy L.age_diffy2 L.inter1 L.inter2 L.marital 5.wave
      6.wave 7.wave L.indi_ORAy

      Comment


      • #4
        Originally posted by Eve Liu View Post
        Thanks for the reply. I am pretty sure my dataset is a longitudinal dataset, so it should be panel.
        I do not question that. I am just pointing out the proportion of units that are observed more than once (less than 4% in the output in #1). The estimation below looks OK.

        Fixed-effects (within) regression Number of obs = 80,759
        Group variable: newid Number of groups = 37,094

        R-squared: Obs per group:
        Within = 0.4098 min = 1
        Between = 0.5796 avg = 2.2
        Overall = 0.5134 max = 6

        I also checked following group with lagged model:
        for lagged model it shows:
        in first stage:
        Fixed-effects (within) regression Number of obs = 13,607
        Group variable: newid Number of groups = 9,824

        in second stage:
        Fixed-effects (within) IV regression Number of obs = 41,102
        Group variable: newid Number of groups = 24,212
        Most likely there is a variable or variables in the first stage that has a lot of missing values. With listwise deletion, this variable/variables results in a lot of lost observations. Lagging can exacerbate this in the presence of missing values. Have a look at

        Code:
        misstable summarize

        Comment


        • #5
          Dear Andrew,

          Thanks for the reply. That is really helpful!

          Comment

          Working...
          X