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

            Working...
            X