Hi Statalist,
This is my first post but I have found this forum invaluable in the past.
Hopefully a simple question from me.
I am doing a study on trauma patients. We are looking at whether receiving blood prior to being admitted to a trauma center has any benefit to patients.
The data from this study comes in two datasets that I am trying to merge
Dataset1 contains informations on injury scores and co-mobidities
Dataset2 contains information on whether the patients received a pre-hospital blood transfusion.
Both datasets have 3 common variables that I am trying to merge with. These are Age, Sex and date of injury (or DOIJ as the variable in stata).
Therefore the code I should use to merge these datasets seems simple
However, patients may get a blood transfusion the day before they actually arrive in hospital (ie injury happened just before midnight so they receive the transfusion at 11pm and then arrive at hospital at 1am the next day.
Is there a way I can merge my dataset using a range of dates for DOIJ.
Note I have changed all dates to stata format.
Thanks in advance
Dilshan
This is my first post but I have found this forum invaluable in the past.
Hopefully a simple question from me.
I am doing a study on trauma patients. We are looking at whether receiving blood prior to being admitted to a trauma center has any benefit to patients.
The data from this study comes in two datasets that I am trying to merge
Dataset1 contains informations on injury scores and co-mobidities
Dataset2 contains information on whether the patients received a pre-hospital blood transfusion.
Both datasets have 3 common variables that I am trying to merge with. These are Age, Sex and date of injury (or DOIJ as the variable in stata).
Therefore the code I should use to merge these datasets seems simple
Code:
use Dataset1 merge 1:1 Age Sex DOIJ using Dataset2
Is there a way I can merge my dataset using a range of dates for DOIJ.
Note I have changed all dates to stata format.
Thanks in advance
Dilshan
Comment