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.
xtreg, fe vs areg, & size of FE constantI have a panel of N = 3810 & T = 6, and after reading forum posts have run areg, absorb(company)…
Collinearity problem in Difference in difference estimation with leads // Stata/IC 15.0Dear Statalist users, I am Gabriele Dini, I study Economics at the University of Bologna and I'm d…
STATA: Statistic significance test within groups?Hi all, I am stuck at the following problem: I need to determine if there is a significant differenc…
Convergence Not Achieved: after Running p-varHello guys, I am new to STATA. Now I am having problem. After running pvar, there are results, but…
loop to append multiple files and add new variableHi there, I have a number of files named filename1990.dta, filename1991.dta etc until 2018. I would…
Subscribe to:
Post Comments (Atom)
0 Response to Finding two adjacent events in time.
Post a Comment