Dear stata experts,
I would appreciate your advice, please. I have 93 IDs with multiple rows each and multiple visits & cost per hospital per ID. How can I create a new variable adding/summing all the visits per ID? For example, my data looks like below and I would like to have one row per ID adding the TOTAL_visits_per_hospital= 35 & Total_cost_per_ Hospital = £3500. How can I do this, please? many thanks, Maria
ID TOTAL_visits_per_hospital Total_cost_per_ Hospital
1 10 £1000
1 20 £2000
1 5 £500
I would appreciate your advice, please. I have 93 IDs with multiple rows each and multiple visits & cost per hospital per ID. How can I create a new variable adding/summing all the visits per ID? For example, my data looks like below and I would like to have one row per ID adding the TOTAL_visits_per_hospital= 35 & Total_cost_per_ Hospital = £3500. How can I do this, please? many thanks, Maria
ID TOTAL_visits_per_hospital Total_cost_per_ Hospital
1 10 £1000
1 20 £2000
1 5 £500

Comment