Statalist


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

st: AW: AW: Calculate the average bid-ask spread for each centile


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: AW: Calculate the average bid-ask spread for each centile
Date   Fri, 27 Mar 2009 13:03:28 +0100

<> 

In addition, Emanuele might just want to take a look at the averages
interactively, without creating a new variable, so he could just 

*************
table centile, contents(mean spread )
*************

and be just as happy. No need for a loop here, either...


HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Martin Weiss
Gesendet: Freitag, 27. März 2009 11:50
An: statalist@hsphsun2.harvard.edu
Betreff: st: AW: Calculate the average bid-ask spread for each centile


<> 

no need for a loop...

*************
bys centile: egen avgspread=mean(spread)
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von emanuele
canegrati
Gesendet: Freitag, 27. März 2009 11:46
An: statalist@hsphsun2.harvard.edu
Betreff: st: Calculate the average bid-ask spread for each centile

Dear users,
 
I have a time series of bid-ask spreads, grouped in centiles, with respect
to trading time. Now I want to calculate the average spread for each
centile. The structure of data is the following
 
day          spread   hhmmss  centile
20080602     xxxx     090302   1
20080602     xxxx     090510   1
...
20080602     xxxx     100408   2
20080602     xxxx     100908   2
...
20080602     xxxx     160007   100
20080602     xxxx     160107   100
...
20080603     xxxx     090302   1
20080603     xxxx     090510   1
...
20080603     xxxx     100408   2
20080603     xxxx     100908   2
...
20080603     xxxx     160007   100
20080603     xxxx     160107   100
...
 
What is the loop I have to write?
 
Thank You,
 
Emanuele Canegrati, Ph.D.
 
_________________________________________________________________
Drag n? drop?Get easy photo sharing with Windows Live? Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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