Announcement

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

  • psacalc Oster test with a binary independent variable?

    Hello everyone,

    I am currently trying to assess in how far my OLS model suffers from an omitted variable bias by performing an SSC Oster bound test* with psacalc. I am using Stata BE 18.5 on Windows.

    My variable of interest is a dummy variable and I always get the error message: r[111] variable not found.
    This code exemplifies my issue:

    Code:
    clear all
    sysuse auto
    
    reg price i.foreign rep78 mpg headroom trunk, robust
    psacalc delta foreign
    psacalc delta i.foreign
    I tried it both with and without the "i" operator, and with and without the mcontrol() option.
    The output gives me error messages, as can be seen on the attached image.

    Now I am wondering what I am doing wrong. I have been successfully applying the psacalc command with continuous independent variables but with the binary one I always get the error message.
    Do I fundamentally misunderstand the command? Or is there a way to implement it with a binary independent variable? Does anyone have a different solution in mind maybe?

    Thanks a lot for your help in advance.



    *Oster, Emily (2016). "Unobservable Selection and Coefficient Stability: Theory and Validation", Journal of Business Economics and Statistics, Forthcoming
    Attached Files

  • #2
    take the i. off foreign in the model.

    or, use 1.foreign in the psacalc

    Comment


    • #3
      You need to have the right coefficient name.

      Here's a working example with dummies:

      Code:
      . webuse "nlswork", clear
      (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
      
      . reg ln_wage c.grade c.age##c.age c.ttl_exp##c.ttl_exp c.tenure##c.tenure i.(race not_smsa south), coeflegend
      
            Source |       SS           df       MS      Number of obs   =    28,091
      -------------+----------------------------------   F(11, 28079)    =   1528.76
             Model |  2402.43188        11  218.402898   Prob > F        =    0.0000
          Residual |    4011.432    28,079  .142862353   R-squared       =    0.3746
      -------------+----------------------------------   Adj R-squared   =    0.3743
             Total |  6413.86388    28,090  .228332641   Root MSE        =    .37797
      
      -------------------------------------------------------------------------------------
                  ln_wage | Coefficient  Legend
      --------------------+----------------------------------------------------------------
                    grade |     .06293  _b[grade]
                      age |   .0385117  _b[age]
                          |
              c.age#c.age |  -.0007069  _b[c.age#c.age]
                          |
                  ttl_exp |   .0211858  _b[ttl_exp]
                          |
      c.ttl_exp#c.ttl_exp |   .0004437  _b[c.ttl_exp#c.ttl_exp]
                          |
                   tenure |   .0473456  _b[tenure]
                          |
        c.tenure#c.tenure |  -.0020242  _b[c.tenure#c.tenure]
                          |
                     race |
                   Black  |  -.0696064  _b[2.race]
                   Other  |   .0262697  _b[3.race]
                          |
               1.not_smsa |  -.1719493  _b[1.not_smsa]
                  1.south |  -.1000843  _b[1.south]
                    _cons |   .2479303  _b[_cons]
      -------------------------------------------------------------------------------------
      
      . which psacalc
      /Users/dvm/Library/Application Support/Stata/ado/personal/psacalc.ado
      *! psacalc 2.0 13Dec2016
      
      . psacalc delta 1.south
      (8 missing values generated)
      
                       ---- Bound Estimate ----
      -------------+----------------------------------------------------------------
      delta        |       0.50912
      -------------+----------------------------------------------------------------
      
                       ---- Inputs from Regressions ----
                   |      Coeff.                      R-Squared
      -------------+----------------------------------------------------------------
      Uncontrolled |       -0.18690                   0.037
      Controlled   |       -0.10008                   0.375
      -------------+----------------------------------------------------------------
      
                       ---- Other Inputs ----
      -------------+----------------------------------------------------------------
      R_max        |   1.000
      Beta         |    0.000000
      Unr. Controls|   
      -------------+----------------------------------------------------------------
      
      . psacalc delta 2.race
      
                       ---- Bound Estimate ----
      -------------+----------------------------------------------------------------
      delta        |       0.43710
      -------------+----------------------------------------------------------------
      
                       ---- Inputs from Regressions ----
                   |      Coeff.                      R-Squared
      -------------+----------------------------------------------------------------
      Uncontrolled |       -0.14444                   0.019
      Controlled   |       -0.06961                   0.375
      -------------+----------------------------------------------------------------
      
                       ---- Other Inputs ----
      -------------+----------------------------------------------------------------
      R_max        |   1.000
      Beta         |    0.000000
      Unr. Controls|   
      -------------+----------------------------------------------------------------
      
      . psacalc delta grade
      
                       ---- Bound Estimate ----
      -------------+----------------------------------------------------------------
      delta        |       0.65534
      -------------+----------------------------------------------------------------
      
                       ---- Inputs from Regressions ----
                   |      Coeff.                      R-Squared
      -------------+----------------------------------------------------------------
      Uncontrolled |        0.09040                   0.194
      Controlled   |        0.06293                   0.375
      -------------+----------------------------------------------------------------
      
                       ---- Other Inputs ----
      -------------+----------------------------------------------------------------
      R_max        |   1.000
      Beta         |    0.000000
      Unr. Controls|   
      -------------+----------------------------------------------------------------

      Comment


      • #4
        Originally posted by George Ford View Post
        take the i. off foreign in the model.

        or, use 1.foreign in the psacalc
        Thanks a lot for the quick help George. This solved my issue perfectly!


        Thank you also Dimitriy for the additional help!

        Comment


        • #5
          Dear Anna Holeck, I posted a similar query on Statalist based on the Oster test.

          Link to the post-

          https://www.statalist.org/forums/for...max-estimation

          If you find a solution to your query, kindly look into mine's.
          Thank you!
          Best regards,
          Mukesh

          Comment

          Working...
          X