| Date: | Wed, 8 Nov 2006 02:36:39 -0500 |
| Reply-To: | Jim Groeneveld <jim2stat@YAHOO.CO.UK> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Jim Groeneveld <jim2stat@YAHOO.CO.UK> |
| Subject: | Re: Looping problem |
|
Hi Sum,
See http://home.hccnet.nl/jim.groeneveld/StatText/RunStats.rtf
Regards - Jim.
--
Jim Groeneveld, Netherlands
Statistician, SAS consultant
home.hccnet.nl/jim.groeneveld
On Tue, 7 Nov 2006 20:31:49 -0800, SUM <sumanta24@GMAIL.COM> wrote:
>Hi Arthur,
>
>Thanks for suggestion. My problem is to calculate sd and mean on a
>rolling basis with 12 month window starting from 199001.
>
>Sumanta.
>
>Arthur Tabachneck wrote:
>> Sumanta,
>>
>> Why use a loop? If Month is already a date, get year using year(Month).
>>
>> Then, use proc means, and use year as a class or by variable.
>>
>> HTH,
>> Art
>> -------
>> On Tue, 7 Nov 2006 18:23:14 -0800, SUM <sumanta24@GMAIL.COM> wrote:
>>
>> >Hi SAS Experts,
>> > I have a problem of calculation in loops.
>> >Suppose i have a data like this:
>> >
>> >
>> >
>> >Month Obs
>> >199001 40
>> >199002 45
>> >199003 22
>> >..
>> >
>> >
>> >199012 25
>> >.
>> >.
>> >.
>> >
>> >
>> >200605 42
>> >
>> >Now i have to calculation mean and standard deviation using each 12
>> >months data. First calculation will be done for 199001 - 199012,
>> >second will be 199002 - 199101, third will be 199003 - 199102, and so
>> >on. How can i proceed using a loop? Please help.
>> >
>> >Sumanta.
|