Announcement

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

  • Managing duplicate date/time values that occur for different id's

    I am currently working with a dataset that includes information on incidents that have occurred from a large sample of participants. Specifically, my dataset includes over 20 years of data, and I have the date that incidents have occurred for each participant from the time they entered the environment, up until data collection. Some participants have nearly 100 incidents that occurred during the study period, while others have none. All participants have the been present for the full observation period, so there is no concerns regarding time at risk.

    I am currently in the process of cleaning my data so I can run various models (i.e. group based trajectory, hazard), but I am having trouble creating a "complete" dataset. What I want to do is create missing observations for years where a participant did not have an incident occur, so that I will have the same number of observations for each participant.

    I first tried to set my data as timeseries so I could fill in the missing time gaps, however I have multiple dates that re-occur for various participants. Thus, I receive the error "repeated time values within panel".

    Was hoping that there may be some suggestions out there on how to handle this. I very much appreciate any suggestions or advice! I have included an example below,
    Id Date Incident Occurred
    1 02jan1996
    1 02jan1996
    1 05may2022
    1 22mar2023
    2 18feb2005
    2 19dec2018
    2 05may2022
    3 14mar1998
    3 09may1999
    4 .
    5 09may1999
    5 15aug2001
    5 23oct2021

  • #2
    Maybe collapse the data by id and dateincidentoccurred and create a count of accidents on that date, which may exceed 1.

    CODE] fillin [/CODE] does the work if filling in for missing values.

    Comment

    Working...
    X