Announcement

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

  • Composite date variable generation

    Hi good people of Statalist

    I have a dataset where people can get hospitalized up to 4 times. These are logged with dates for each hospitalization. The variables are called dahosp1, dahosp2… (date of hospitalization first, second… time) and are in DD-NN-CCYY format.

    I need to make a new variable for hospitalization in a specific time range (01/04/2014 - 01/04/2015). This new variable should contain the date of the first hospitalization in this period. As my data is for a long period of time the 1sthospitalization (dahosp1) could be before (or after) this time range so the 3rd hospitalization could be in this time range. I am not interested in them being hospitalized multiple times in the time range as they will be censored after first hospitalization.

    I do not know how to solve this. Sorry for the complicated explanation.

  • #2
    Duplicate thread. If interested please follow https://www.statalist.org/forums/for...ble-generation

    Comment

    Working...
    X