[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: generating new observations
At 12:45 PM 3/29/2006, Kremena wrote:
You can do...
I have a data set with the following variables:
importer exporter commoditycode tradevalue
Belgium Argentina 1 123
Belgium Argentina 2 456
Luxemburg Argentina 1 789
Luxembourg Argentina 3 147
I want to generate new observations such that importer is Belgium-Luxembourg
and tradevalue is the combined trade value for the two countries for the
Can someone tell me how I can do that?
collapse (sum) tradevalue , by(commoditycode)
This will sum to the level of commoditycode, regardless of importer
or exporter (and it won't create a combined importer identifier). If
you want specific groups of importers or importer/exporter
combinations, you will need to do that in advance, creating another
variable, and then put that variable into the by() option.
* For searches and help try: