Announcement

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

  • How to create Time-Series Data if there are Multiple Observations on a Date

    I would like to examine how volume of intraoperative fluid used for a specific procedure has changed over time -- I have ~200 different observations with fluid data over the span of 8 years with some patients having the same date of operation. When using the tsset command, I continue to receive an error message that I have duplicate dates. Is there a way around this? Such as jittering the duplicate dates? Or an alternative way to assess this question? Thank you!

  • #2
    I think you you actually have a kind of panel dataset, not a single time series. Try

    Code:
     tsset patient_id time_var
    This may not actually help you all that much if you want to fit some TS model. If that is the case, you can might want to calculate means or medians by some unit of time (maybe year-month or year) and then
    Code:
    tsset time_var
    and then do your analysis.

    Comment


    • #3
      Not disagreeing necessarily with Dimitriy, as your goals and the nature of your data remain unclear, but if you want to pool patients and your data are irregularly spaced in time then xtset in terms of an identifier may be as far as you can or need go. Then time would just be a predictor and not a time series index.

      Comment

      Working...
      X