Announcement

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

  • Additive index

    Hi dears,
    I have an issue in creating of an additive index.
    I have 11 variables that are normalized using the min-max method. Therefore, their interval varies from 0 to 1.
    However, by typing the command:
    g index= x1+....+x11
    The index does not take values between 1 and 11.
    How Can I solve it?

  • #2
    What values do you get? Theoretically, they should be between 0 and 11. Maybe check on the input first:
    Code:
    summarize x1 - x11
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment


    • #3
      I have values from 2 (min) and 6.8 (max).
      Each variable has a min value equal to 1 and a max value equal to 10. The variables are 11 and I have expected that the index takes value from 1 to 11.

      Comment


      • #4
        Now I am confused. In your first post you say that the input vars are normalized between 0 and 1, now you say they have values from 1 to 10. This will clearly affect your resulting scale. Maybe you want to standardize or normalize it after adding them up?
        Best wishes

        Stata 18.0 MP | ORCID | Google Scholar

        Comment


        • #5
          I'm sorry I have made confusion, the vars range between 0 and 1. I have tried to normalize it after adding them, but now the index range between 0 and 1.
          I want that the index to range between 1 (the minimum value) to 11 (the maximum value).

          Comment


          • #6
            I agree with Felix Bittmann

            If each variable of 11 is scaled from 0 to 1, then

            1. The maximum possible for their sum will be 11, but that will occur if and only every value is 1 in an observation.

            2. The minimum value for their sum will be 0, but that will occur if and only every value is 0 in an observation.

            If the logic doesn't convince, an example with 3 variables may help.

            Code:
            * Example generated by -dataex-. For more info, type help dataex
            clear
            input float(var1 var2 var3)
            1 1 0
            0 0 1
            0 1 0
            1 1 1
            0 0 0
            end
            Here the sum will be 3 and 0 in the last two observations, so the maximum and minimum possible are -- indeed -- possible -- but their existence in data isn't guaranteed by the rules.

            Comment


            • #7
              I have understand it. But the variables take value from 0 to 1 not only 0 and 1. And, when I create the index I have an issue.
              How can I solve it? I want to create an index by adding up them and it should take value from 1 to 11.

              Comment


              • #8
                The fact that values may lie between 0 and 1 doesn't disturb the principle behind my post.

                Comment


                • #9
                  Ok, but I would like that my index has discrete values from 1 to 11. However, when I add the variable by summing them the index takes continuous values.

                  Comment


                  • #10
                    Again, do you want your limits to be attained in the data or just possible? You can enforce a range of 1 to 11 by a linear transformation and integer values can be insisted by using a rounding function such as round() floor() ceil().

                    A small but realistic data example would allow us to suggest code, but if you want integers only you need to state your rounding rule.
                    Last edited by Nick Cox; 17 Jun 2021, 04:08.

                    Comment


                    • #11
                      These are the variables in my dataset.
                      Variable Obs Mean Std. Dev. Min Max
                      X1 110 0.192 0.218 0 1
                      X2 103 0.206 0.28 0 1
                      X3 110 0.019 0.095 0 1
                      X4 110 0.549 0.254 0 1
                      X5 110 0.457 0.285 0 1
                      X6 110 0.238 0.281 0 1
                      X7 110 0.537 0.165 0 1
                      X8 100 0.062 0.13 0 1
                      X9 107 0.491 0.228 0 1
                      X10 105 0.501 0.236 0 1
                      X11 110 0.652 0.261 0 1

                      Comment


                      • #12
                        Sorry, but that's not a data example. It's the results of summarize.

                        Comment


                        • #13
                          In theory your index can take the values from 0 (not 1) to 11, but that does not mean that it will take that range in your data. What is required for your index to take the minimum value for an observation? All variables X1 to X11 would have to have the value 0 for that observation. This is possible, but there is nothing that guarantees that such an observation exists in your data. Similarly, in order for an observation to have the maximum value of 1, all variables X1 to X11 have to have the value 1 for that observation. Again, this is possible, but nothing guarantees that such an observation exists in your data. The fact that your variable does not exhaust its theoretical range is not a problem, it is just an empirical result, and a fairly common one at that.
                          ---------------------------------
                          Maarten L. Buis
                          University of Konstanz
                          Department of history and sociology
                          box 40
                          78457 Konstanz
                          Germany
                          http://www.maartenbuis.nl
                          ---------------------------------

                          Comment

                          Working...
                          X