Announcement

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

  • Seek help for concentration curve

    Dear Sir/Madam, colleagues,

    I tried to plot a concentration curve with the following commend from some literatures but did not get a figure.
    Please kindly correct and guide me further.

    glcurve outcome1 [aw=wgt], glvar(g1) pvar(p1) sortvar(v191) lorenz nograph
    glcurve outcome2 [aw=wgt], glvar(g2) pvar(p2) sortvar(v191) lorenz nograph
    glcurve outcome3 [aw=wgt], glvar(g3) pvar(p3) sortvar(v191) lorenz nograph
    glcurve outcome4 [aw=wgt], glvar(g4) pvar(p4) sortvar(v191) lorenz nograph

    label variable g1 "g1"
    label variable g2 "g2"
    label variable g3 "g3"
    label variable g4 "g4"

    graph twoway (line g1 p1, sort yaxis(1 2)) ///
    (line g2 p2, sort yaxis(1 2)) ///
    (line g3 p3, sort yaxis(1 2)) ///
    (line g4 p4, sort yaxis(1 2)) ///
    (function y=x, range(0 1) yaxis(1 2)) ///
    , aspect(1) xtitle("cumulative proportion share, p") ///
    title("Lorenz curve comparison") ///
    ytitle("cumulative proportion wealth") ///
    legend(label(1 "outcome1") label(2 "outcom2") label (3 "outcome3") label(4 "outcome4") ///
    saving(test.gph)

    Where outcome 1-4 are the dichotomous (0 1) and v191 is the continuous variable.
    I tried to include all 4 outcomes in single figure as the inquality variable is the same.
    Thanking in advance.

    SHOW

  • #2
    Hi Show,

    It would be helpful if you can provide an example of your data. Saying "did not get a figure" is somewhat vague. Another way to plot a CC is to use -lorenz- command written by Ben Jann (type ssc install lorenz for installation).

    Hope this helps.

    Comment


    • #3
      Dear Dung,

      Thank you for your reply. I am doing an inequality analysis using DHS data.
      Outcome 1 would be like healthcare seeking and v191 is the wealth index in continuous variable.
      I hope this is what you mean. Thanks. Will also explore Ben Jann commend too.

      SHOW

      Comment


      • #4
        Actually, what I meant is an example of data and normally people here use -dataex- command to do so. See "12. What should I say about the commands and data I use" in FAQ for more detail. However, If y is your outcome then try this.
        Note: title, labels, xtitle and ytitle depend on your purpose so I left those options blank.
        Code:
        lorenz y, pvar(v191) ///
            graph(aspectratio(1) xlabels(, grid) overlay legend(cols(1)) noci ///
            title("") labels("") lpattern(dash) xtitle("") ytitle(""))
        Last edited by Dung Le; 27 May 2021, 02:41.

        Comment


        • #5
          Dear Dung,

          Thank you very much for your kind guidance.
          It worked with the lorenz commend.

          Comment


          • #6
            Dear Dung and all,

            Please kindly also guide me how to get 95%ci for concentration index.
            I used the following commend to get concentration index.
            Thanks

            conindex outcome [pw=wgt], rankvar(variable) bounded limits(0 1) erreygers cluster(v001)

            SHow

            Comment


            • #7
              Hi Show,

              Computing SE is quite straightforward, try this
              Code:
              conindex outcome [pw=wgt], rankvar(variable) limits(0 1) bounded erreygers  cluster(v001)  
              * Store standard error of CI
              sca SE = r(CIse)
              * Generate lower bound of 95% CI
              gen lb =  CI - invttail(e(df_r),0.025)*SE
              * Generate a upper bound of CI
              gen ub = CI + invttail(e(df_r),0.025)*SE

              Comment


              • #8
                Dear Dung,

                Thank you very much.

                Show

                Comment

                Working...
                X