Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: FW: grouping observations and performing cals


From   "Rajesh Tharyan" <[email protected]>
To   <[email protected]>
Subject   st: FW: grouping observations and performing cals
Date   Fri, 17 Feb 2006 15:28:59 -0000

Hi all,

I have some data in the following format

Time ����X

-5�������� 2
-4�������� 3
-3�������� 2
-2������ ��4
1��������� 1 
0������ ���2
1������ ���2
2������ ���1
3����� ����2
4����� ����2
5����� ����1

I need to compute y= Mean(X)/SD(X) for different time windows. 

For example,

-5,-4 would be window 1
-3,-2 would be window 2 etc. 

My present solution is this ( example for window 1)

Egen a=mean(X) if time>=-5 & time<=-4 (and so on for all the different
windows)

Egen b=sd(x) if if time>=-5 & time<=-4 (and so on for all the different
windows)

Gen y=a/b

Is there an easier way to do this???


Thanks very much

Regards
rajesh



*
*   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