Announcement

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

  • How can I pick measurements three months apart from a semi-irregular time series?

    Hi Stataforumers

    I have a dataset where measurements were taken at approximately (but slightly irregular) three month intervals with some random measurements in between. The data consists of dates and measurements. How can I pick out the longest series of measurements that are roughly three months apart? If I just picked the first measurement and looked for the next measurement within 2.5-3.5 months (say), the first measurement could be one of the random ones, and I would miss the longest series.

    Thankyou

    Karin

  • #2
    Some example data might be helpful to help us get a handle on the problem. If you can average your measurements, one thing you could try: collapse your data over 3 month intervals.

    Also, I think on a forum like this, judicious use of the word 'random' is a good thing.

    Comment


    • #3
      I guess "random" will be understood here as meant informally.

      panelthin
      from SSC is dedicated to a similar problem. It does not guarantee the longest series, but it might give you a start. In many cases taking what panelthin suggests but always including the last measurement subject to some criterion might help.

      Ultimately if you want something a bit different, you could clone the program and write your own.

      Comment


      • #4
        Thanks David and Nick. Of the two suggestions, I think that panelthin fits my needs better. Will explore and tinker with a clone of it. Thanks again, Karin.

        Comment


        • #5
          Do please report back at your convenience on what works. This kind of problem seems to arise quite often and solutions could be of wide interest.

          Comment

          Working...
          X