Announcement

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

  • ivreg2h warning variables have been centered and invalid name r(198);

    Hello all,

    I am trying a probit IV regression with weights. My command is as follows

    Code:
    ivreg2h self_empl (cogn_ability=f20s1) finance_literacy age age_squared sa_fl graduation_gdr gender mth_net_hh_inc risktolerance number_chi
    > ldren homeowner married, first
    
    Standard IV Results
     
    
    First-stage regressions
    -----------------------
    
    
    First-stage regression of cogn_ability:
    
    Statistics consistent for homoskedasticity only
    Number of obs =                    969
    ----------------------------------------------------------------------------------
        cogn_ability | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -----------------+----------------------------------------------------------------
               f20s1 |   .0737916   .0237149     3.11   0.002     .0272523    .1203308
    finance_literacy |   .1428539   .0137185    10.41   0.000     .1159321    .1697757
                 age |   .0274964   .0262839     1.05   0.296    -.0240844    .0790771
        age_squared2 |  -.0004098   .0002887    -1.42   0.156    -.0009764    .0001567
               sa_fl |   .0711833   .0337132     2.11   0.035     .0050228    .1373438
      graduation_gdr |   -.138416    .076785    -1.80   0.072    -.2891026    .0122705
              gender |   .1592251   .0667075     2.39   0.017      .028315    .2901351
      mth_net_hh_inc |   .0000456   .0000233     1.96   0.051    -1.73e-07    .0000913
       risktolerance |   .0070372   .0122796     0.57   0.567    -.0170609    .0311352
     number_children |   .0597235   .0268744     2.22   0.026     .0069838    .1124631
           homeowner |   .1829295    .069381     2.64   0.009     .0467727    .3190862
             married |  -.0750075    .075888    -0.99   0.323    -.2239338    .0739187
               _cons |  -.9842482   .5917053    -1.66   0.097    -2.145439     .176943
    ----------------------------------------------------------------------------------
    F test of excluded instruments:
      F(  1,   956) =     9.68
      Prob > F      =   0.0019
    Sanderson-Windmeijer multivariate F test of excluded instruments:
      F(  1,   956) =     9.68
      Prob > F      =   0.0019
    
    
    
    Summary results for first-stage regressions
    -------------------------------------------
    
                                               (Underid)            (Weak id)
    Variable     | F(  1,   956)  P-val | SW Chi-sq(  1) P-val | SW F(  1,   956)
    cogn_ability |       9.68    0.0019 |        9.81   0.0017 |        9.68
    
    Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Sanderson-Windmeijer F statistic.
    
    Underidentification test
    Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
    Ha: matrix has rank=K1 (identified)
    Anderson canon. corr. LM statistic       Chi-sq(1)=9.72     P-val=0.0018
    
    Weak identification test
    Ho: equation is weakly identified
    Cragg-Donald Wald F statistic                                       9.68
    
    Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    
    Weak-instrument-robust inference
    Tests of joint significance of endogenous regressors B1 in main equation
    Ho: B1=0 and orthogonality conditions are valid
    Anderson-Rubin Wald test           F(1,956)=      12.83     P-val=0.0004
    Anderson-Rubin Wald test           Chi-sq(1)=     13.01     P-val=0.0003
    Stock-Wright LM S statistic        Chi-sq(1)=     12.84     P-val=0.0003
    
    Number of observations               N  =        969
    Number of regressors                 K  =         13
    Number of endogenous regressors      K1 =          1
    Number of instruments                L  =         13
    Number of excluded instruments       L1 =          1
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics consistent for homoskedasticity only
    
                                                          Number of obs =      969
                                                          F( 12,   956) =     2.94
                                                          Prob > F      =   0.0005
    Total (centered) SS     =   80.8255934                Centered R2   =  -1.3017
    Total (uncentered) SS   =           89                Uncentered R2 =  -1.0903
    Residual SS             =  186.0381302                Root MSE      =    .4382
    
    ----------------------------------------------------------------------------------
           self_empl | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -----------------+----------------------------------------------------------------
        cogn_ability |   .3222591   .1416957     2.27   0.023     .0445407    .5999775
    finance_literacy |  -.0436765   .0223474    -1.95   0.051    -.0874766    .0001237
                 age |  -.0141219   .0117364    -1.20   0.229    -.0371249     .008881
        age_squared2 |    .000222    .000134     1.66   0.097    -.0000406    .0004846
               sa_fl |   .0060097   .0180043     0.33   0.739     -.029278    .0412974
      graduation_gdr |   .0769905   .0347261     2.22   0.027     .0089286    .1450523
              gender |  -.0481954   .0365726    -1.32   0.188    -.1198764    .0234856
      mth_net_hh_inc |  -1.05e-07   .0000134    -0.01   0.994    -.0000263    .0000261
       risktolerance |   .0125772   .0055883     2.25   0.024     .0016243    .0235301
     number_children |  -.0389959   .0140751    -2.77   0.006    -.0665827   -.0114091
           homeowner |   -.054245    .040002    -1.36   0.175    -.1326476    .0241575
             married |   .0219434   .0359337     0.61   0.541    -.0484855    .0923722
               _cons |   .1665422   .2708018     0.61   0.539    -.3642196    .6973041
    ----------------------------------------------------------------------------------
    Underidentification test (Anderson canon. corr. LM statistic):           9.715
                                                       Chi-sq(1) P-val =    0.0018
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):                9.682
    Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                             15% maximal IV size              8.96
                                             20% maximal IV size              6.66
                                             25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    ------------------------------------------------------------------------------
    Sargan statistic (overidentification test of all instruments):           0.000
                                                     (equation exactly identified)
    ------------------------------------------------------------------------------
    Instrumented:         cogn_ability
    Included instruments: finance_literacy age age_squared2 sa_fl graduation_gdr
                          gender mth_net_hh_inc risktolerance number_children
                          homeowner married
    Excluded instruments: f20s1
    ------------------------------------------------------------------------------
    
    Warning: variables have been centered
    _z_cogn_ability_finance_literacy_eps invalid name
    r(198);
    Can somebody explain why I get the warning: variables have been centered
    _z_cogn_ability_finance_literacy_eps invalid name
    r(198);?

    How can I solve this problem?

    Attached Files
    0
    +
    0%
    0
    -
    0%
    0

  • #2
    ivreg2h is from SSC (FAQ Advice #12).

    Can somebody explain why I get the warning: variables have been centered
    _z_cogn_ability_finance_literacy_eps invalid name
    r(198);?
    These are two different issues. On the centering, the command is simply informing you that centering has been done on the regression sample. This (subtracting a constant from every value of a variable) affects the intercept, but not the slopes.

    _z_cogn_ability_finance_literacy_eps invalid name
    The authors of ivreg2h define a variable as _z_+ endogenous variable name+ "_" + regressor name+ "_"+ eps in their internal routines but are not too careful to consider Stata variable name length limits. So as in your case, you encounter errors if you have long variable names to begin with and the combined variable name is greater than 32 characters.

    Code:
    help limits
    You can resolve this by renaming your long variable names to something shorter, e.g.,

    Code:
    rename (finance_literacy graduation_gdr number_children ///
    mth_net_hh_inc risktolerance) (fin_lit grad_gdr nkids nethhinc risktol)
    
    ivreg2h self_empl (cogn_ability=f20s1) fin_lit age age_squared sa_fl ///
    grad_gdr gender nethhinc risktol nkids homeowner married, first
    Last edited by Andrew Musau; 16 Aug 2022, 06:24.

    Comment

    Working...
    X