Dear users,
I’m currently stuck in a script and would very much appreciate some help.
I am using a dataset that includes around 20,000 patients admitted to hospital. Many of whom have been admitted several times, some transferred between hospitals and thereby have the same admission date but differ in time and hospital admitted to. For this study each patient has a reference admission on which a certain event happened.
I wish to exclude (remove) all admissions but the one directly succeeding the reference event in time.
I.e. all admissions that took place before as well as all the ones after the admission directly following the reference, keeping only two adjacent admissions.
Part of the dataset includes these variables which I hope would be enough to work this out.
Personal ID (unique to each patient, could therefore be same for different admissions)
Unique admission number
Time/date of admission
Number of admissions
Reference admission
Any help would be much appreciated
Regards
Fredric
Related Posts with Finding two adjacent events in time.
esttab LaTex export problem Hi everyone, I have encountered a problem and could not find a resource which discusses it. I am ex…
How to using instrumental variables in gologit2There is a mutual causal relationship between the independent variable and the dependent variable in…
Change legend automatically in graphDear Statalists, Suppose I have a data like this Code: * Example generated by -dataex-. To insta…
New packages available on SSC: comtrade and htmltab2stataThanks two Kit Baum two new packages are available on SSC. comtrade comtrade downloads trade data f…
Multiple Imputation and mi stset for Cox RegressionDear Stata List I have a good sized data set ( >6000 records) of health data. In this data set I…
Subscribe to:
Post Comments (Atom)
0 Response to Finding two adjacent events in time.
Post a Comment