Hi,
It may be a relatively simple problem to order dates, but I cannot find an elegant solution.
I have the dates of several events. The events can occur in any order.
I would like to identify for each observation, the order of each event, and report event_1 1st n,%, event_1 2nd n,%, event_1 3rd n,%....., event_2 1st n,%, event_2 2nd n,%, ….. etc.
My solution is clumsy, loop by each observation, to identify event position in the sequence of events, 1st,2nd, 3rd etc.
Thank you,
Horia
Related Posts with Group by order of event occurrence
Collapse by several variablesHi, I am working with panel data where I have 9 different regions and in each region there are a dif…
Calculating time between specific events in panel dataHello, I have panel data with 1 to 10 events per patid. The eventdate is the date of the stroke and…
How to identify all cases with missing observationDear All How can I identify and list all cases with missing observation(denoted by .a) from a data …
Sample size for 3 arm, 2 comparison sub-studyHi, I am looking to power a sub-study within a larger 2 arm randomised study. The outcome is a cont…
Can I match on a baseline dataset from 2018 (treatment) and 2020 (control)?Dear Statalisters, I am currently writing my thesis on the topic of Multidimensional Empowerment. F…
Subscribe to:
Post Comments (Atom)
0 Response to Group by order of event occurrence
Post a Comment