Announcement

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

  • New command - conindex - available from SSC

    Dear Stata colleagues,

    Thanks to Kit Baum, conindex is now available from SSC. This command computes a range of rank-dependent inequality indices, including the Gini coefficient, the concentration index, the generalized (Gini) concentration index, the modified concentration index, the Wagstaff and Erreygers normalised concentration indices for bounded variables, and the distributionally sensitive extended and symmetric concentration indices (and their generalized versions).

    Sincerely,
    Owen O'Donnell, Stephen O'Neill, Tom Van Ourti and Brendan Walsh

  • #2
    Thank you so much for this great command! I have been finding it incredibly useful.
    I have one question regarding the command's calculation of the standard errors of the CI estimate. I am currently working with data from the Demographic and Health Surveys (DHS) and I realised that the available sample do-file (https://ideas.repec.org/c/boc/bocode/s458111.html) for conindex does also use DHS data. Conindex allows for specifying the cluster/primary sampling unit. However, it does not seem to be possible to specify the sample strata. The DHS team recommends taking both the cluster and the strata into account when calculating standard errors. I therefore normally work with the svy command (svyset[pw=wgt], psu(hv021) strata(hv022) singleunit(centered)).
    I was now wondering whether conindex calculates the correct standard errors despite not taking into account the sample strata? I have been using the convenient regression method (as outlined in "Analyzing Health Equity Using Household Survey Data, O'Donnell et al, 2008) together with the svy command to calculate the concentration index. The standard errors I obtained were slightly different from those I obtained when using the conindex command.
    Thank you very much for you help and once again for this great command.

    Comment


    • #3
      Hi Sophia,

      We are glad you are finding conindex useful. You are correct that the command is not compatible with the "svy:" prefix. We have now updated the command to include an option to allow conindex to be used in conjunction with svyset. In the case of the DHS, the convenient regression you discuss should be identical to the following:

      svyset[pw=wght], psu(psu) strata(strata) singleunit(centered)
      conindex h [pweight=wght], rankvar(Y) truezero clus(psu) robust


      in the updated version of the command this is equivalent to

      conindex h, rankvar(Y) truezero svy

      Note: that "svy" is included as an option here rather than including "svy:" as a prefix.
      Regards,
      Stephen

      Comment


      • #4
        Note that there is a bug in the current version of conindex preventing the command from running and giving the error "unrecognised command (error occurred while loading conindex.ado)". This is due to the first line not being read correctly. If you open conindex.ado and delete the first row the command should then run. An updated version will be available soon to correct his issue.

        Comment


        • #5
          Thanks to Kit Baum, the updated version of conindex is now available from SSC.

          Comment


          • #6
            Dear Stephen,

            thank you for the really useful command. Just a question about the graph of the concentration curve. Is there any way to include the curves of two or more variables in the same graph?

            Many thanks.

            Nikos

            Comment


            • #7
              Hi Nikos,
              Apologies for the delay in replying I have only noticed this now. The command does not currently allow this. You can save the rank using the keeprank(...) option to get the variable for the x-axis, however you would need to manually calculate the values for the y-axis. Alternatively you can edit the conindex ado file to save the required information. You can do this by inserting the following on line 352 of the ado file:
              gen y_`varlist'=`cumlhs1'

              conindex will now create a variable prefixed with "y_" that contains the required values for the y-axis.. Then you can manually create the graph. Below is a simple example (Note you need to have saved the ado file with the adjustment I mention above first):

              clear
              set obs 1000
              * Create some artificial data:
              gen rank =_n
              gen Y1=invnormal(uniform())^2
              gen Y2=invnormal(uniform())^2

              * Run the first concentration curve
              conindex Y1, truezero rankvar(rank) graph keep(ranked1)
              * Run the second concentration curve
              conindex Y2, truezero rankvar(rank) graph keep(ranked2)

              * Now make your combined concentration curve graph:
              twoway (line y_Y1 ranked1, sort clwidth(thick) clcolor(blue))(line y_Y2 ranked2, sort clwidth(thick) clcolor(blue)), ytitle(`ytitle', size(medsmall)) yscale(titlegap(5)) xtitle(`xtitle', size(medsmall)) legend(rows(5)) xscale(titlegap(5)) legend(off) plotregion(margin(zero) lcolor(none)) aspect(1) ysize(8) xsize(8) graphregion(color(white)) bgcolor(white)

              If you have problems doing this feel free to email me directly at [email protected].
              Regards,
              Stephen

              Comment


              • #8
                Thanks for sharing the information. This looks really helpful!

                Comment


                • #9
                  I wonder if the conindex command can incorporate the dynamic part of the data. Does the command have special feature for the longitudinal data? I am referring to Jones and Loopez Nicolaas (2004).
                  The paper shows how to calculate concentration index in longitudinal data. However, I don't know if there is a command to help to calculate the index.

                  Thanks

                  Comment


                  • #10
                    Hi Shadrack,
                    At the moment the command does not incorporate the approach in Jones and Lopez Nicolas (2004). However you could use our command to calculate CI for each period (i.e. CI^t in their notation) and then use the formula they provide in equation (5) to manually calculate the CI for average health.
                    Regards,
                    Stephen

                    Comment


                    • #11
                      Thanks Stephen
                      I did think of that but I feared I will encounter a computation problem because I am working with national representative survey with thousands of people. In the equation, I need to use every individual's reported health status in every wave (I am studying health inequality). Unless I miss interpreted the equation (5). That would be rather too cumbersome.

                      Thanks again
                      Shadrack

                      Comment


                      • #12
                        Hi Shadrack,
                        I have not looked at this properly so could be wrong, but I suspect you can use the fact that N*cov(x,y) = sum (xi -meanx)(yi-meany) to avoid having to do the calculation for each individual. If you email me in about a week ([email protected]) I should have a little time to look at it properly and see if I can help you with it.
                        Regards,
                        Stephen.

                        Comment


                        • #13
                          Dear Stephen

                          Thank you,

                          I will surely contact you


                          Thank you
                          Shadrack

                          Comment


                          • #14
                            Hi Shadrack,
                            I have attached a quick do file that uses our conindex command to calculate the Concentration indices and mobility indices. From some initial tests it seems correct but please let me know if you encounter any issues using it as I have not fully tested it.
                            Regards,
                            Stephen
                            Attached Files

                            Comment


                            • #15
                              Dear Stephan. Thank you and your colleague very much for the conindex. I would like to know for for Wagstaff normalized concentration indices, which bound (1-μ ) or (1+μ) is used . The normalized CI =CI/(1-μ) or CI= CI/( 1+μ).? Thank you so much

                              Comment

                              Working...
                              X