Hi,

I have these variables in a database: exporter / importer / productcode / milk
milk is the value of imports of product i from country k to country l


How can I calculate these shares using Stata:

- The market share of country k (exporter) in product i in market l (importer): ailk = milk / sumk (milk)

- The product i share of country l total imports: bil = sumk (milk) / sumi sumk (milk)

- The country l share of world imports: cl = sumk sumi (milk) / sumk suml sumi (milk)

Thanks!!