BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
somebody
Lapis Lazuli | Level 10

I have a dataset of daily observations. I am using thhe PROC EXPAND to compute rolling standard deviation over the past 252 days for each stock. For some stocks, there are missing values. How can I tell SAS not to use these missing values?  I have an option to set it to 0 (using TRANSFORMIN=(SETMISS 0)) but what if I don't want that? For example, if there are 100 missing values over the past 252 days, I would like to use only 152 obs with values. 

PROC EXPAND DATA=daily_returns OUT=daily_returns2;

CONVERT return=std /TRANSFORMIN=(SETMISS 0) TRANSFORMOUT=(MOVSTD 252);

by stock;

RUN;  

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

That is the default behavior of PROC EXPAND. Read the Missing Values section of the PROC EXPAND: Transformation Operations Documentation. 

View solution in original post

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

That is the default behavior of PROC EXPAND. Read the Missing Values section of the PROC EXPAND: Transformation Operations Documentation. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1921 views
  • 1 like
  • 2 in conversation