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

RE: st: geometric mean with foreach


From   Maarten buis <[email protected]>
To   [email protected]
Subject   RE: st: geometric mean with foreach
Date   Mon, 12 Dec 2005 20:22:17 +0000 (GMT)

AbdelRahmen:

You will need to get the -egenmore- package from ssc, use -reshape- to make a single variable
representing price, make a variable telling you the year (since it appears you have monthly data
and you want yearly means), than using -egen geomprice = gmean(price), by(year)- to get the
variable you want. 

HTH,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------

> I have monthly price data in the follwing form
>
>                 p801    p802............p036
> 
> good1           100     100.3...........
> good2           100     100.5...........
> .
> .
> goodn          100      100.6..........
> 
> p801 denotes price at january 1980
> I want to construct a geometric mean of monthly prices for
> each possible year
> say price index for year going from january 80 to december 80
> and feb 80 to january 81
> .... to may 2002 to june 2003



		
___________________________________________________________ 
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/
*
*   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