HI,
I have a dataset of some firms which provide services to some clients in 10 different regions. How can I calculate market share of each firm in each region based on the number of their clients?
my variables are: firm_id, firm_name, client_id, region

for example:
firm_id, firm_name, client_id, region
10,firm1,client1,region1
10,firm1,client2,region1
10,firm1,client3,region1
20,firm2,client4,region1
20,firm2,client5,region1
30,firm3,client6,region2
30,firm3,client7,region2
40,firm4,client8,region2
10,firm1,client9,region2
so on
in region 1, the market share of firm1 is 60%, but in region 2, its market share is 25%
​​​​​​​thank you