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.
The robust standard error in a fixed effects modelHi I have a question about the vce(robust) option. (the option is same with vce(cluster pid) in xtre…
Query about using aweight while running probit in STATADear all, I am a PhD student at the University of Canterbury, NZ. I wanted to use aweight while run…
Weak instrument issue with control function approach, in nonlinear modelsDear all, I'm applying the control function (CF) approach in a nonlinear model, the fractional resp…
Using esttab to create a tableHi, I am trying to create a table (example attached) using esttab command. I have run different spe…
Python Integration: Pandas Package Causing Stata to CloseAfter setting my python_userpath and python_exec, attempting to execute the following lines from a d…
Subscribe to:
Post Comments (Atom)
0 Response to Finding two adjacent events in time.
Post a Comment