Hello everyone, I'm working with a dataset of trade information. I have a variable with the import of the transaction by id, by country and by product. If a company exported wood to 10 different countries, there are 10 different observations and just one id. The thing is a single company can trade several products. I want to create a variable by id that show me the import of the transaction ($) by product, no matter what country. I came up with this, but obviously it does not work, by(id2): egen prueba=sum ( fob_2012), by(productos) Any ideas? I would very much appreciate any help.
↧