Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Computing averages per good per country


From   "Dev Vencappa" <[email protected]>
To   <[email protected]>
Subject   Re: st: Computing averages per good per country
Date   Fri, 10 Dec 2004 15:42:44 +0000

>>
Is this what you are looking for?

egen avgprice=mean(pricevariable) if pricevariable!=., by (article country)


Dev


>>> [email protected] 12/10/04 3:35 pm >>>

Dear all,

I am looking for the easiest way to compute averages per good per country. 
My a dataset looks about the following:

Article 1	US	10
Article 1	FR	15
Article 1	FR	20
Article 1	UK	10
Article 1	UK	18
�		
Article 2	US	10
Article 2	US	15
Article 2	UK	20
Article 2	UK	10
...

In other words, I have prices for different goods, originating from 
different countries. I am interested in the average price for each of the 
goods per country, i.e. the average price charged for article 1 in the US, 
the average for article 1 in France, in the UK; similarly for article 2 
etc. A complication is that for a number of goods I only have observations 
for a subset of countries, and the number of observations varies good and 
country (e.g. for article 1 I have, say, 5 observations from Greece, but 
none from Italy, whereas for good 3 I have ten observations from Italy, but 
none from the US or France). 

So far I've only been able to come up with relatively clumsy solutions, so 
help is greatly appreciated,

Philipp



-- 
_____________________________________________________________________
Zon Gratis ADSL. De voordelen van gratis internet met de snelheid van
ADSL. Zonder abonnementskosten en zonder vast contract. Je betaalt
alleen voor de tijd online. Nu zonder aansluitkosten en met gratis
modem. Bestel snel op zonnet.nl.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/


This message has been scanned but we cannot guarantee that it and any
attachments are free from viruses or other damaging content: you are
advised to perform your own checks.  Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index