Announcement

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

  • Oaxaca decomposition

    Dear user, I want to do oaxaca decomposition following https://www.stata-journal.com/articl...article=st0151
    However, i have to correct selection in my specification. Therefore, i used following code by going through https://www.stata.com/statalist/arch.../msg00036.html
    use oaxaca.dta
    reg lnwage educ if female==0
    estimates store male
    reg lnwage educ if female==1
    estimates store female
    oaxaca male female

    But unfortunately i am getting following error. variable male not found. Can any one help me?





  • #2
    You have written more than 2 dozens posts, hence I assume you may be aware of the FAQ recommendations. Just as a remind, please try to provide data/output/command under code delimiters.


    That said, the command seems according to the recommendation.

    I wonder whether you have the updated version.
    Best regards,

    Marcos

    Comment


    • #3
      Marcos, I am not aware of copyrights to download data and share directly. The data on which i wrote, can be obtain by typing "use oaxaca.dta". Priory to this you need to use "ssc install oaxaca". I am using Stata 13.0 MP. I am providing do file. The command does not seem to correct. Somewhere, mistake is there. Please revert to this problem.

      The Output are:

      reg lnwage educ if female==0

      Source | SS df MS Number of obs = 751
      -------------+------------------------------ F( 1, 749) = 131.04
      Model | 25.5751083 1 25.5751083 Prob > F = 0.0000
      Residual | 146.182033 749 .195169604 R-squared = 0.1489
      -------------+------------------------------ Adj R-squared = 0.1478
      Total | 171.757142 750 .229009522 Root MSE = .44178

      ------------------------------------------------------------------------------
      lnwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      educ | .0753016 .0065781 11.45 0.000 .0623879 .0882153
      _cons | 2.55059 .0793699 32.14 0.000 2.394776 2.706404
      ------------------------------------------------------------------------------

      .
      . estimates store male

      .
      . reg lnwage educ if female==1

      Source | SS df MS Number of obs = 683
      -------------+------------------------------ F( 1, 681) = 80.21
      Model | 23.3493995 1 23.3493995 Prob > F = 0.0000
      Residual | 198.250744 681 .291117099 R-squared = 0.1054
      -------------+------------------------------ Adj R-squared = 0.1041
      Total | 221.600144 682 .324926897 Root MSE = .53955

      ------------------------------------------------------------------------------
      lnwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      educ | .078652 .0087823 8.96 0.000 .0614085 .0958956
      _cons | 2.383336 .1007802 23.65 0.000 2.185459 2.581214
      ------------------------------------------------------------------------------

      .
      . estimates store female

      .
      . oaxaca male female
      variable male not found
      r(111);
      Attached Files
      Last edited by Biswa bhusan; 26 Jun 2018, 07:40.

      Comment


      • #4
        I wonder whether this is what you wish:

        Code:
        . oaxaca lnwage educ, by(female)
        
        Blinder-Oaxaca decomposition                    Number of obs     =      1,434
        
                   1: female = 0
                   2: female = 1
        
        -------------------------------------------------------------------------------
               lnwage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        --------------+----------------------------------------------------------------
        Differential  |
         Prediction_1 |   3.440222   .0174724   196.89   0.000     3.405977    3.474467
         Prediction_2 |   3.266761   .0218257   149.68   0.000     3.223984    3.309539
           Difference |   .1734607   .0279579     6.20   0.000     .1186642    .2282573
        --------------+----------------------------------------------------------------
        Decomposition |
           Endowments |   .0457899   .0112163     4.08   0.000     .0238064    .0677734
         Coefficients |   .1296214   .0264739     4.90   0.000     .0777334    .1815094
          Interaction |  -.0019506   .0064022    -0.30   0.761    -.0144987    .0105976
        -------------------------------------------------------------------------------
        Best regards,

        Marcos

        Comment

        Working...
        X