Announcement

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

  • using rangerun with entropyetc

    Hello, I have this example dataset.
    I am attempting to calculate Simpsons Index using entropytec but I would like to do it over a one year rolling window.
    I tried:

    Code:
    program entropy
        entropyetc STAFF, by(CUSTOMER YEAR) gen(3=R)
    end
    
    rangerun entropy,interval(YEAR 0 1)
    But of course, this doesn't solve the problem. Would you have any suggestions?

    Code:
    clear
    input str1 CUSTOMER double(STAFF YEAR)
    "A" 1 2015
    "A" 1 2015
    "A" 1 2015
    "A" 2 2016
    "A" 2 2015
    "B" 1 2014
    "B" 1 2014
    "B" 1 2014
    "B" 1 2015
    "B" 1 2015
    "A" 2 2016
    "B" 2 2015
    end

  • #2
    Well, interval(0 1) is a two-year rolling window. So, that needs to be clarified.

    That said, I think https://www.statalist.org/forums/for...rolling-window is your problem in different guise for the Gini-Turing-Yule-Simpson-Hirschman-Herfindahl-Blau-goodnessknowswhoelse sum of squared probabilities.

    Last edited by Nick Cox; 21 Jan 2020, 12:37.

    Comment


    • #3
      Oh, yes, sorry I meant 2-year rolling window.

      Thanks for the link, it works!

      Comment

      Working...
      X