At 03:11 PM 9/15/2005, you wrote:
I would really appreciate someone's help with this question.
I'm trying to generate a dataset of statistics by collapsing another
dataset, but each of the id's I'm collapsing by, I want to use every
observation in the dataset except the one for the id under consideration.
Would there be a way to do this?
For example, I have data of the form:
company product markup
100 31 .3
100 55 .2
111 31 0
111 55 .1
120 31 .1
120 55 .1
Now I want to ask the question: for each company, calculate the average
markup of each product it produces, where the average is taken over all
companies that sell the product except the company itself. So I want to
end up with
company product averagemarkup
100 31 .05
100 55 .1
111 31 .2
111 55 .15
120 31 .15
120 55 .15
Obviously collapsing the data the standard way is not going to do this. I
need to do this for hundreds of thousands of observations (hundreds of
companies and thousands of products) so am looking for a way to do this
that would be relatively quick. I would be grateful for any suggestions.
Thanks very much.
* For searches and help try:
Nicholas J. G. Winter 607.255.8819 t
Assistant Professor 607.255.4530 f
Department of Government firstname.lastname@example.org e
Cornell University falcon.arts.cornell.edu/nw53 w
308 White Hall
Ithaca, NY 14853-4601