Announcement

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

  • graph estimated coefficients after oaxaca_rif command

    Dear all,

    I use oaxaca_rif user written command by Rios-Avila (Rios-Avila, F. 2020. Recentered influence functions (RIFs) in Stata: RIF regression and RIF decomposition. Stata Journal, 20(1), 51-94. https://doi.org/10.1177/1536867X20909690). I want to graph pure explained and pure unexplained estimates by deciles/quintiles on one graph. Here is the command for estimating oaxaca decomposition using RIF funcion by deciles:

    webuse nlswork, clear
    forvalues i=10(10)90{
    oaxaca_rif ln_wage age grade tenure if year==88, by(union) rif(q(`i')) rwprobit(age grade tenure) nose
    }

    I don't like graphs by coefplot command, I prefer the graph as it looks like after conditional quintile regression. For example:
    qreg ln_wage age grade tenure
    grqreg, ci ols olsci title(Fig.1a Fig.1b Fig.1c)

    I hope someone will help me, it is important to have nice graph in a paper.

    Thanks

    Best wishes,
    Aleksandra
    Graph_example.gph
    Attached Files

  • #2
    There is no easy way around it, but here is a possiblity:
    Code:
    webuse nlswork, clear
    matrix drop _all
    forvalues i=10(5)90{
    
    oaxaca_rif ln_wage age grade tenure if year==88, by(union) rif(q(`i')) rwprobit(age grade tenure) 
    matrix tb=r(table)
    matrix betas=nullmat(betas)\[`i',tb["b",.]]
    matrix ll=nullmat(ll)\[tb["ll",.]]
    matrix ul=nullmat(ul)\[tb["ul",.]]
    }
    ssc install lbsvmat
    lbsvmat betas, matname name(b)
    lbsvmat ll, matname name(ll)
    lbsvmat ul, matname name(ul)
    ren *, low
    two rarea ll_pure_explained_age  ul_pure_explained_age   b_c1 || line  b_pure_explained_age  b_c1  
    two rarea ll_pure_explained_grade  ul_pure_explained_grade   b_c1 || line  b_pure_explained_grade  b_c1

    Comment


    • #3
      Originally posted by FernandoRios View Post
      There is no easy way around it, but here is a possiblity:
      Code:
      webuse nlswork, clear
      matrix drop _all
      forvalues i=10(5)90{
      
      oaxaca_rif ln_wage age grade tenure if year==88, by(union) rif(q(`i')) rwprobit(age grade tenure)
      matrix tb=r(table)
      matrix betas=nullmat(betas)\[`i',tb["b",.]]
      matrix ll=nullmat(ll)\[tb["ll",.]]
      matrix ul=nullmat(ul)\[tb["ul",.]]
      }
      ssc install lbsvmat
      lbsvmat betas, matname name(b)
      lbsvmat ll, matname name(ll)
      lbsvmat ul, matname name(ul)
      ren *, low
      two rarea ll_pure_explained_age ul_pure_explained_age b_c1 || line b_pure_explained_age b_c1
      two rarea ll_pure_explained_grade ul_pure_explained_grade b_c1 || line b_pure_explained_grade b_c1
      Dear Fernando,

      Thank you very much for your answer, it is quite complicated to make graph. Thank you for your immediate answer, it helped me a lot. I use your oaxaca_rif command often since I work a lot with decomposing gender pay gap.

      Thank you.

      Best,
      Aleksandra

      Comment


      • #4
        Originally posted by FernandoRios View Post
        There is no easy way around it, but here is a possiblity:
        Code:
        webuse nlswork, clear
        matrix drop _all
        forvalues i=10(5)90{
        
        oaxaca_rif ln_wage age grade tenure if year==88, by(union) rif(q(`i')) rwprobit(age grade tenure)
        matrix tb=r(table)
        matrix betas=nullmat(betas)\[`i',tb["b",.]]
        matrix ll=nullmat(ll)\[tb["ll",.]]
        matrix ul=nullmat(ul)\[tb["ul",.]]
        }
        ssc install lbsvmat
        lbsvmat betas, matname name(b)
        lbsvmat ll, matname name(ll)
        lbsvmat ul, matname name(ul)
        ren *, low
        two rarea ll_pure_explained_age ul_pure_explained_age b_c1 || line b_pure_explained_age b_c1
        two rarea ll_pure_explained_grade ul_pure_explained_grade b_c1 || line b_pure_explained_grade b_c1
        Dear Prof.Fernando,
        oaxaca_rif can not control for year and regional fixed effect, for instance “oaxaca_rif lnincome hat $yy $xx i.year i.region, by(urban) wgt(1) rif(q(25)) rwlogit($yy $xx) cluster(region) ”,how can I achive it for control for year and regional fixed effect,many thanks!

        Comment


        • #5
          You have to create the dummies manually

          Comment

          Working...
          X