time-to-event analysis

Hello.
How can I create a coxregression by comparing the survival before an event, within an event and after the event?

It is the survival within 0 and 5 years before a flooddisaster, within the disaster and after the flooddisaster.

My approach would be to create start-variable, end-variable and dummy-variable:

start: date of the event (Birthday of the child)
end: date of the event (we censor after the fifth birthday)

dummy: 1=has occurred; 0=has not occurred

time1 and time2 variables then indicate the difference between the time elapsed between the events

time_Var = start: birth of the child (0, because we watch from birth)
time2_Var = end: The event (Before the flood, within the flood, after the flood, 5 (we censor after the fifth birthday))

I hope you can help me!
Thanks :slight_smile: