Announcement

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

  • Calcule Overlap between two variables

    I need to calculate the overlap of two variables (time series). I saw that in R, the command is "calc.overlap". Is there any way to run this in Stata? The goal is to see the similarity (or not) between the preferences of poor and rich people over time - from 1980 to 2018. I'm already satisfied if I can accomplish this for a specific year.


  • #2
    "overlap" can be measured in many different ways - it is not at all clear which you want; you might want to start with
    Code:
    hsearch overlap
    which will give you many hits; in addition, I wrote a program called -overlap-, published in the STB many years ago (1992); use -search- to find and download

    Comment


    • #3
      Thanks, Rich, for you response!


      I need to calculate the index that measures the equal area to two groups. The idea behind this is that the more overlap, the less polarization.

      I found the command "overlap var1 var2" in Stata to calculate the overlapping coefficient and which presents the results of the percentage of the equal variance and the overlap index (OVL). However, I cannot find this (overlap) command in Stata.

      That result is what I found in a techincal publication of Stata:
      overlapi 19.82692 24.77273 4.743297 6.61187 52 22
      MLE of overlap:
      Variances equal: 0.9313 Dissimilarity Index=1-OVL: 0.0687
      Variances UNequal: 0.6421

      Comment


      • #4
        I have no idea what this paragraph from your #3 means: "I found the command "overlap var1 var2" in Stata to calculate the overlapping coefficient and which presents the results of the percentage of the equal variance and the overlap index (OVL). However, I cannot find this (overlap) command in Stata."

        did you try:
        Code:
        search overlap
        ?
        on my machine that certainly locates the program that I wrote many years ago

        I also do not understand anything about your data; if the above does not help, please post using -dataex- (see the FAQ if you don't understand)

        Comment


        • #5
          Sorry, It is really confusing. I need just to calculate the overlapping area between two groups what it represents, for my analyzing, the degree of polarization between rich and poor people.

          I used "search overlap" as you recommended, but I didn't find any command that can give me the overlap index. Maybe because I'm using two continuos variable. So, after that, I found the thecnical paper on internet that has showed the command "overlap" and the syntax is "overlap var1 var2". However, this command (overlap) is not available in Stata.

          Comment


          • #6
            I following these steps:
            Firts: I plot the graph between poor and rich to see the density in two periods.

            two kdens poor || kdens rich if Year>=1991 & Year<=2002
            two kdens poor || kdens rich if Year>=2003 & Year<=2015

            Now, I need to calcule the overlap between these two groups.

            Comment


            • #7
              Originally posted by Rich Goldstein View Post
              "overlap" can be measured in many different ways - it is not at all clear which you want; you might want to start with
              Code:
              hsearch overlap
              which will give you many hits; in addition, I wrote a program called -overlap-, published in the STB many years ago (1992); use -search- to find and download
              Hello Mr. Goldstein,

              I use your overlap command to estimate the intersection of certain attitudes between two groups.
              I would like to ask you if there is a methodological reason why the overlap command does not allow weights.

              Best wishes
              Marcus Gercke

              Comment


              • #8
                sorry, but I don't remember - I can, offhand, not think or a reason it could not use weights, but since weights would mean changing the meaning of "overlap", I would have to think very deeply about whether it would be a good idea - I have no intention at this time to return to this very old program and, if someone else wants to take it over I would be find with that (if so, probably best to rename the command)

                Comment


                • #9
                  Originally posted by Rich Goldstein View Post
                  I would have to think very deeply about whether it would be a good idea
                  Thank you very much for the quick reply. My work-around was to multiply the attitudinal variable and group variable (before dichotomization) by the appropriate weight.
                  Since some of the weighted OVLs are very different from the unweighted coefficients, I've become suspicious and ask myself the same question whether weighting the OVL coefficient is a good idea. However, I lack the basic mathematical understanding to make an assessment.
                  Can you perhaps assess the appropriateness of weighting?
                  Many thanks in advance

                  Comment

                  Working...
                  X