Announcement

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

  • How could I calculate frequencies in past XX days?

    Hi All:

    Now I want to know in past 45 days, how many different ID appear in my form. For example, data in 2016-2-15 shows _freq from 2016-1-1 to 2016-2-15, data in 2016-2-16 shows _freq from 2016-1-2 to 2016-2-16

    First I want to use cumulative frequencies and gen date=_N, then use( _n-45) but cannot deal with repeat ID.

    sample:

    ID DAY _freq
    1 1 1
    2 2 2
    3 3 3
    1 4 3
    5 5 4
    ... ... ...
    5 45
    6 46
    2 47
    3 48

    Thank you so much to view.





  • #2
    See https://www.statalist.org/forums/for...nge-by-inrange for what looks like the same question.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      See https://www.statalist.org/forums/for...nge-by-inrange for what looks like the same question.
      Hi Nick

      You are so helpful, thank you so much.

      Comment

      Working...
      X