Hello
I am working with a large dataset in Stata with 40,000 stroke patients admitted to a hospital, and I could really use some help regarding duplicates.
Some patients in my dataset have been admitted several times during the study period, and I want to keep only first visits, but it appears, that some patients were registered twice during the hospital stay with the same stroke - i.e. they were actually registered twice during the first visit (due to transfer between hospitals). In that case I want to keep both first and second entry of this patient, because it is in fact the same stroke, that is being treated.
For each observation I have a:
Personal identification number “pnr”
I have generated a variable “visit_n” (1 for first, 2 for second, 3 for third visit and so on).
I have the admission date “acutedate” (days after 1st Jan 1960).
I want to keep visit 1 for all patients and delete all visits with a value >1, except if visit 2 is within the first 2 days after visit 1.
I hope this is understandable, and that you can help me, thanks in advance!
Kind regards
Sine Mette Buus
Related Posts with Duplicates - keep first and sometimes second...
Is it okay to use multiple imputation to create imputed values in a second dataset?Say I have two datasets A & B. They have the same variables in each except that set A has one ad…
Using outreg2 to export Heckman results to LaTeXHi, I'm having problems using outreg2 to export the results from a Heckman model to LaTeX (same prob…
Reshaping Datastream Data (Currency) for StataI have been trying to transpose Datastream data by date. I know how to do this in SAS but I am havin…
Univariate analysisHello, So I want to apply this univariate test, subdividing my sample into high and low groups by t…
Productivity effectsDear Statalist users, I am trying to examine the impact of export participation of the firm on firm…
Subscribe to:
Post Comments (Atom)
0 Response to Duplicates - keep first and sometimes second...
Post a Comment