Dear all,
I have three datasets containing, among other, the following variables:
- dataset_1: id_1, which is different for every obs
- dataset_2: id_2, which is different for every obs, cat_2 which can be a, b or c, and date_2 which is a date
- dataset_3: id_1 and id_2, with repeated values, although not covering every value of id_1 and id_2 from the other datasets.
In dataset_1 I want to create a dummy variable that equals 1 when there is an observation in dataset_3 that links the obs in dataset_1 to an obs in dataset_2 (as in, for example, for the third obs in dataset_3, id_1=3 and id_2=7, so those observations are linked) and for the linked obs in dataset_2 it is true that: cat_2 = a AND date_2 is after a fixed date (which is fixed for the entire dataset_1).
After that, I will also create other dummies based on the constellation of cat_1 and date_1.
Thank you in advance for your help.
Best regards,
Marco
I have three datasets containing, among other, the following variables:
- dataset_1: id_1, which is different for every obs
- dataset_2: id_2, which is different for every obs, cat_2 which can be a, b or c, and date_2 which is a date
- dataset_3: id_1 and id_2, with repeated values, although not covering every value of id_1 and id_2 from the other datasets.
In dataset_1 I want to create a dummy variable that equals 1 when there is an observation in dataset_3 that links the obs in dataset_1 to an obs in dataset_2 (as in, for example, for the third obs in dataset_3, id_1=3 and id_2=7, so those observations are linked) and for the linked obs in dataset_2 it is true that: cat_2 = a AND date_2 is after a fixed date (which is fixed for the entire dataset_1).
After that, I will also create other dummies based on the constellation of cat_1 and date_1.
Thank you in advance for your help.
Best regards,
Marco
Comment