Programming the statistical procedures from SAS

Standard Deviation over last 8 periods

Accepted Solution Solved
Reply
Contributor
Posts: 58
Accepted Solution

Standard Deviation over last 8 periods

Hi,

I have a monthly price variable and want to calculate its standard deviation over last 8 month. I will be thankful if anyone can help.

Additional Information:

I have lot of firms and i want to calcualte these standard deviation in each firm.

every firm has many years of Monthly data and resulting varibale will be for each month on the basis of lag 8 month (last 8 month) 
Thanks


Accepted Solutions
Solution
‎06-05-2017 07:00 PM
Super User
Posts: 18,498

Re: Standard Deviation over last 8 periods

Concept is here:

http://support.sas.com/kb/22/104.html

 

Change the idea from average to standard deviation is changing the function used (mean to std), otherwise everything else is the same. Note one of hte later examples shows how to do this with BY groups, ie by Firm.

View solution in original post


All Replies
Solution
‎06-05-2017 07:00 PM
Super User
Posts: 18,498

Re: Standard Deviation over last 8 periods

Concept is here:

http://support.sas.com/kb/22/104.html

 

Change the idea from average to standard deviation is changing the function used (mean to std), otherwise everything else is the same. Note one of hte later examples shows how to do this with BY groups, ie by Firm.

Contributor
Posts: 58

Re: Standard Deviation over last 8 periods

Thank you very much. Proc Expand is really amazing procedure.
Good day
PROC Star
Posts: 7,416

Re: Standard Deviation over last 8 periods

It would help if you can provide examples of the data you have, and the dataset you want, for at least one firm.

 

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 58

Re: Standard Deviation over last 8 periods

Thank you very much for your cooperation. Someone else suggested helpful article which solved my issue perfectly.
Good day
☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 136 views
  • 0 likes
  • 3 in conversation