Standard deviation of trailing values

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

Standard deviation of trailing values

Hi there,

I am trying to compute the standard deviation of the trailing 12 months stock returns. What program code can i use? Thanks in advance for your help


Accepted Solutions
Solution
‎03-12-2015 03:22 AM
SAS Employee
Posts: 340

Re: Standard deviation of trailing values

Posted in reply to ivanpersie

All Replies
Respected Advisor
Posts: 3,852

Re: Standard deviation of trailing values

Posted in reply to ivanpersie

Do you have SAS/ETS software?

Contributor
Posts: 30

Re: Standard deviation of trailing values

Posted in reply to data_null__

Yes i have SAS  software

Esteemed Advisor
Posts: 5,540

Re: Standard deviation of trailing values

Posted in reply to ivanpersie

SAS/ETS is a collection of tools for econometrics and time-series data processing and analysis. It includes PROC EXPAND, a procedure for transforming time series data in many ways, including your requirement for the standard deviation of a moving time window. - PG

PG
Super User
Posts: 6,785

Re: Standard deviation of trailing values

Posted in reply to ivanpersie

If you only have SAS, but not SAS/ETS, there are still ways to do this.

This forum has addressed how to calculate a moving sum (for the last 12 observations, for example).

You would also have to calculate the moving sum of the squared values, using similar techniques.

If you know SUM, SUM of the squared values, and N=12, you can calculate the standard deviation.

But it's easier of you have SAS/ETS.

Contributor
Posts: 30

Re: Standard deviation of trailing values

Posted in reply to Astounding

Please send me that link for calculating a moving sum

Solution
‎03-12-2015 03:22 AM
SAS Employee
Posts: 340

Re: Standard deviation of trailing values

Posted in reply to ivanpersie

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 413 views
  • 0 likes
  • 5 in conversation