Dear all,
I have a dataset on the number of visits made to doctors by person along with their occupation and the city they come from. I would like to make a table with the percentage of visits made by each occupation for each city, e.g. percentage of people who never visited doctor in each occupation code for each city.
I realize that this might be trivial but I have been having really having trouble with it. A snapshot of the data is below.
Should I decode the occupation and city variables to string? Thank you!
Sincerely,
Chiara
I have a dataset on the number of visits made to doctors by person along with their occupation and the city they come from. I would like to make a table with the percentage of visits made by each occupation for each city, e.g. percentage of people who never visited doctor in each occupation code for each city.
I realize that this might be trivial but I have been having really having trouble with it. A snapshot of the data is below.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte id long(visit occ_code city) 1 3 1 3 2 1 2 2 3 2 3 1 4 1 3 2 5 2 1 1 6 3 2 3 end label values visit visit label def visit 1 "more than once", modify label def visit 2 "never", modify label def visit 3 "once", modify label values occ_code occ_code label def occ_code 1 "agri", modify label def occ_code 2 "manufac", modify label def occ_code 3 "services", modify label values city citi label def citi 1 "Canberra", modify label def citi 2 "Melbourne", modify label def citi 3 "Sydney", modify
Sincerely,
Chiara
Comment