Announcement

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

  • Creating quantile graphs

    Hello, I am trying to create a graph that plots on the a Y axis a continuous variable (gender wage gap), and has the percentiles on the X axis. I have tried using the qplot and the quantile commands, but I am not able to get the desired output. Also, I am attaching an image as an exact reference.

    Thanks,
    Kusha


    Click image for larger version

Name:	Screen Shot 2017-08-16 at 21.07.49.png
Views:	1
Size:	44.3 KB
ID:	1406612

  • #2
    Neither quantile nor qplot (Stata Journal) has any bearing whatsoever on the graph you want. It looks as if you're intending to combine various estimates from various OLS and quantile regressions. You'll perhaps need to tell us a lot more (than zero) about your data and the models you're fitting or intend to fit to get much better advice.

    Comment


    • #3
      Hi, thanks for getting back!

      I am working with the IDHS data (which is cross sectional), and I am working on decomposing the gender wage gap for the case of India.

      For the graph outlined above, I am running the basic OLS regressions (with log of income per hour as the dependant variable) as:

      reg logincph i.edu exp exp2 sex caste religion state married if urban == 0
      reg logincph i.edu exp exp2 sex caste religion state married if urban == 1


      Additionally, I am trying to plot how the the gender wage gaps varies across quantiles for the urban and rural areas to check for the sticky floor or the glass ceiling effect.
      Last edited by Kusha Verma; 16 Aug 2017, 10:52.

      Comment


      • #4
        Stata does allow plotting coefficients or matrices directly. You can only plot variables. The trick is to save all your coefficients in matrices and then save them as variables with svmat. Here is how I would do it in your case:

        Code:
        forvalues q=10/90{
            quiet qreg logincph i.edu exp exp2 sex caste religion state married if urban == 1, q(`q')
            mat qr1=nullmat(qr1)\_b[sex]
            quiet qreg logincph i.edu exp exp2 sex caste religion state married if urban == 0, q(`q')
            mat qr0=nullmat(qr0)\_b[sex]
            mat quantile=nullmat(quantile)\\`q'
        }
        svmat quantile
        svmat qr1
        svmat qr0
        quiet reg logincph i.edu exp exp2 sex caste religion state married if urban == 1
        local ols1 = _b[sex]
        quiet reg logincph i.edu exp exp2 sex caste religion state married if urban == 0
        local ols0 = _b[sex]
        twoway (line qr11 quantile1, lcolor(red)) (line qr01 quantile1, lcolor(black)) , yline(`ols1', lcolor(red)) yline(`ols0', lcolor(black))

        Comment


        • #5
          Thanks a ton! You are a saviour

          Comment

          Working...
          X