Announcement

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

  • Decomposing CI Results - % Contribution above 100%

    Hi All,

    I'm using Stata 16 and have just decomposed CI. However, the percentage contribution is above 100% at 125%. I'm confused because my Mathematics cap tells me that % contribution to CI should add up to 100% - or below as there may be other factors that are uncounted for in the decomposition of CI.

    My results are as follows:
    Elasticity CI Absolute %
    quintile 0,0537 0,1416 0,0304 65,0554
    fprogram_1 0,0098 0,2221 0,0087 18,6556
    fprogram_2 0 -0,1501 0 0
    gender_1 -0,008 -0,0053 0,0002 0,3594
    gender_2 0 0,0049 0 0
    race_1 -0,0036 0,434 -0,0062 -13,2124
    race_2 -0,0147 -0,0776 0,0046 9,742
    race_3 -0,0045 0,0897 -0,0016 -3,4684
    race_4 0 0,3781 0 0
    geo_1 -0,0005 -0,2184 0,0004 0,9514
    geo_2 0 0,1624 0 0
    level_1 -0,0079 -0,4163 0,0132 28,2196
    level_2 -0,0112 -0,0178 0,0008 1,6991
    level_3 0 0,3638 0 0
    employed_1 -0,0012 -0,1898 0,0009 1,9603
    employed_2 0 0,1243 0 0
    mbmi_1 -0,0024 -0,333 0,0031 6,7107
    mbmi_2 -0,0188 -0,0375 0,0028 6,0164
    mbmi_3 -0,0171 -0,0199 0,0014 2,9055
    mbmi_4 0 0,0304 0 0
    125,5946
    Please advise.

    Regards
    Nthato

  • #2
    Using Statalist is just like making wild mushroom risotto. If I asked you to make my favorite version of risotto, you'd likely need to know what the SPECIFIC ingredients are and the steps you do to make said dish. So far you've given neither, you're asking us for help to make a dish, and you've not given the recipe (the code) or ingredients (the data).

    Precisely, you must give your dataset using dataex and your code that you've tried (formatted accordingly). No dataset, no code=no real assistance.


    You're not new here, so you should know better than to not give properly formatted data and code. Nthato Ras especially given that the answer is likely in the help files or some area of documentation, we HAVE to see what was done and how.

    Comment


    • #3
      Thanks Jared for the response. You are right, Stalist has been of great assistance to me all because I've been providing the whole information about my data.

      The commands for my decomposition is as follows:

      Code:
      conindex obese [aweight=wt], rankvar(quintile) erreygers bounded limits (0 1)
      sca CI=r(CI)
      global X quintile fprogram_1 fprogram_2 gender_1 gender_2 race_1 race_2 race_3 race_4 geo_1 geo_2 level_1 level_2 level_3 employed_1 employed_2 mbmi_1 mbmi_2 mbmi_3 mbmi_4
      qui sum obese [aw=wt]
      sca m_obese=r(mean)
      qui glm obese $X [aw=wt], family(binomial) link(logit)
      qui margins , dydx(*) post
      
      foreach x of varlist $X {
      sca b_`x'=_b[`x']
      }
      foreach x of varlist $X {
      qui{
      conindex `x' [aw=wt], rankvar(quintile) truezero
      sca CI_`x' = r(CI)
      sum `x' [aw=wt]
      sca m_`x'=r(mean)
      sca elas_`x' = b_`x'*m_`x'
      sca con_`x' = 4*elas_`x'*CI_`x'
      sca prcnt_`x' = (con_`x'/CI)*100
      }
      di "`x' elasticity:", elas_`x'
      di "`x' concentration index:", CI_`x'
      di "`x' contribution:", con_`x'
      di "`x' percentage contribution:", prcnt_`x'
      matrix Aaa = nullmat(Aaa) \ (elas_`x', CI_`x', con_`x', prcnt_`x')
      }
      matrix rownames Aaa= $X
      matrix colnames Aaa = "Elasticity""CI""Absolute""%"
      matrix list Aaa, format(%8.4f)
      The results are as below
      Elasticity CI Absolute %
      quintile 0,0537 0,1416 0,0304 65,0554
      fprogram_1 0,0098 0,2221 0,0087 18,6556
      fprogram_2 0 -0,1501 0 0
      gender_1 -0,008 -0,0053 0,0002 0,3594
      gender_2 0 0,0049 0 0
      race_1 -0,0036 0,434 -0,0062 -13,2124
      race_2 -0,0147 -0,0776 0,0046 9,742
      race_3 -0,0045 0,0897 -0,0016 -3,4684
      race_4 0 0,3781 0 0
      geo_1 -0,0005 -0,2184 0,0004 0,9514
      geo_2 0 0,1624 0 0
      level_1 -0,0079 -0,4163 0,0132 28,2196
      level_2 -0,0112 -0,0178 0,0008 1,6991
      level_3 0 0,3638 0 0
      employed_1 -0,0012 -0,1898 0,0009 1,9603
      employed_2 0 0,1243 0 0
      mbmi_1 -0,0024 -0,333 0,0031 6,7107
      mbmi_2 -0,0188 -0,0375 0,0028 6,0164
      mbmi_3 -0,0171 -0,0199 0,0014 2,9055
      mbmi_4 0 0,0304 0 0
      125,5946
      My dataset is:

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input byte(quintile fprogram_1 fprogram_2 gender_1 gender_2 race_1 race_2 race_3 race_4 geo_1 geo_2 level_1 level_2 level_3 employed_1 employed_2 mbmi_1 mbmi_2)
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 1 0 0 1 0 0 1
      1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 1 0 0 1 0 0 1
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 1 0 0 0 1 0 0
      . . . . . . . . . . . 1 0 0 0 1 0 0
      . . . . . . . . . . . 1 0 0 0 1 0 0
      . . . . . . . . . . . . . . . . . .
      2 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0
      . . . . . . . . . . . 1 0 0 0 1 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      3 1 0 0 1 0 1 0 0 1 0 . . . . . . .
      3 1 0 1 0 0 1 0 0 1 0 . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      3 1 0 0 1 0 1 0 0 1 0 . . . . . . .
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      3 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 1
      3 1 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 1
      . . . . . . . . . . . 1 0 0 0 1 0 1
      . . . . . . . . . . . 1 0 0 0 1 0 1
      1 1 0 1 0 0 1 0 0 1 0 . . . . . . .
      1 1 0 1 0 0 1 0 0 1 0 . . . . . . .
      1 . . 1 0 0 1 0 0 1 0 . . . . . . .
      1 1 0 1 0 0 1 0 0 1 0 . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      1 . . 0 1 0 1 0 0 1 0 . . . . . . .
      1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0
      1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1
      1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      1 1 0 0 1 0 1 0 0 1 0 . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      1 1 0 0 1 0 1 0 0 1 0 . . . . . . .
      1 1 0 1 0 0 1 0 0 1 0 . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 0 1 0 1 0 0 1
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 1 0 0 1 0 0 1
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 0 1 0 1 0 0 1
      2 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 1
      . . . . . . . . . . . 0 1 0 1 0 0 1
      1 . . 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . . . . . . . .
      2 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0
      2 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0
      2 . . 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0
      . . . . . . . . . . . . . . . . . .
      2 1 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0
      . . . . . . . . . . . 0 0 1 1 0 0 0
      2 1 0 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 0 1 0 1 0 0 0
      . . . . . . . . . . . 0 1 0 1 0 0 0
      . . . . . . . . . . . 0 1 0 1 0 0 0
      . . . . . . . . . . . 0 1 0 1 0 0 0
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      1 0 1 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      . . . . . . . . . . . 0 1 0 1 0 0 0
      . . . . . . . . . . . 0 1 0 1 0 0 0
      1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0
      1 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 0
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . 1 0 0 1 0 0 0
      . . . . . . . . . . . . . . . . . .
      1 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 0
      end
      Regards
      Nthato
      Last edited by Nthato Ras; 08 Jul 2022, 06:54. Reason: Spelling mistake

      Comment


      • #4
        I believe you are mistaken in your assumption that index decomposition has to add up to 100% or less. Some indexes are not additively decomposable. You can go through the formulas, as your example does, but the results may, in some sense, overlap, yielding a total that exceeds the sum of the parts.

        That's about all I can say on this; I'm not familiar with the particular indexes you are using.

        Comment


        • #5
          Thanks William.

          Comment

          Working...
          X