Statalist


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

st: A loop for S.D. or Mean in Panel Data set


From   Asgar Khademvatani <[email protected]>
To   [email protected]
Subject   st: A loop for S.D. or Mean in Panel Data set
Date   Tue, 22 Apr 2008 02:34:44 -0600

Dear All friends,

Hope you are fine. I am using stata 8.2 platform in Windows. I have loaded a panel data set in a long-format for 4 sectors each sketched from 1958 to2000. Thus, I have 172 observations for each variable. My target is calculating S.D or mean cross-4 sectors for each year and graph over time. For more clarity, for instance, I would like to calculate S.D. of 4-sectors for year 1958. In doing so, I need to have a loop to use observations numbers: 1, 45, 87, and 131 in calculation of S.D for year 1958, and this continues for calculation of S.D cross-sectors for other years, and so on and so forth. I understand I must write a "for values loop" for performing such calculations of S.D or mean for each year cross-sectors. I am not sure how to initiate such for values loop or another solution in Stata. May somebody help me out on this matter?

Your help is much appreciated in advance.

Thanks
Asgar Kh.
University of Calgary-Canada
*
* 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