Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Aggregating information over several records

From   "Palan, Stefan (" <>
To   "" <>
Subject   st: Aggregating information over several records
Date   Mon, 22 Nov 2010 08:08:48 +0100

Hi everybody,

I have a dataset where every row corresponds to one trade in a market and contains the variables market (which market the trade was in), period (which period the trade was in), price, seller (the id of the selling subject) and buyer (the id of the buying subject). Trades are always for one unit of the good and each subject can both buy and sell.

What I would like to do is aggregate information across trades, such that I start with the initial endowment of cash and the traded goods for each subject and get e.g. the total money earned from selling goods/paid for buying goods for each subject in each period/market. Unfortunately, I don't know how to efficiently add up the information in this way, and I also don't quite know how to deal with the fact that the same subject may in one trade appear as a seller and in the next may appear as a buyer.


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index