Hi All, I am trying to calculate 30 days moving standard deviation using Proc expand, and able to get the same in the output, I have used group by variable as per the requirement, Now the issue is in the result I am getting is having 0 value in every 1st observation in the output. I know The standard deviation of the first value of a considered data series is always zero, as it is not possible to calculate it with only one value. So I have requirement that the initial standard deviation shall be equal to the one of the second date. Please find the below example for more clarity. Example: As of date Std. 28.11. 0 365 29.11. 365 30.11. 378 1.12. 371 2.12. 392 Below is the current code:- PROC EXPAND DATA = temp1 OUT=Moving_Stdev ; CONVERT Exposure = Moving_Stdev30 / TRANSFORMOUT=(MOVSTD 30); by Instrument_Type Country; RUN; Can anyone please help me to achieve the above requirement, a sample code would really help. Thanks in advance. Regards, Swapna 2)
... View more