I am trying to find the commands and code that will allow me to generate a new variable. This is a simplified table example. Each row is a unique individual patient labeled patient_ID. The treating hospital (hospital_ID is not unique). In this example, there are 3 types of treatment (1=resection, 2= ablation, 3=transplantation). I am trying to make a new variable to code an individual hospital as a transplant center. In this example, only hospital 2 and hospital 4 should have a value of 1 for TXP_center.
I have some experience with egen, but I am currently stuck.
thanks
I have some experience with egen, but I am currently stuck.
thanks
patient_ID | hospital_ID | surg_type | TXP_center |
1 | 1 | 1 | 0 |
2 | 1 | 2 | 0 |
3 | 2 | 3 | 1 |
4 | 2 | 1 | 1 |
5 | 3 | 1 | 0 |
6 | 3 | 2 | 0 |
7 | 4 | 3 | 1 |
8 | 4 | 1 | 1 |
Comment