03-17-2015 12:24 PM
Is your data already in a SAS data set?
If not, what are your plans to get it into a SAS data set?
If it is already a SAS data set, what are the names of the variables? Which ones are character and which ones are numeric?
Is the data complete (no months skipped in the middle)?
Do you want month over month returns, or some other returns?
03-17-2015 12:31 PM
Yes its already in Sas. The Variable names are DATE TICKER PRICE .....All of them are Character. All months are available. And i want month over month returns
03-17-2015 12:56 PM
proc sort data=sashelp.stocks out=stocks;
by stock date;
if first.stock then return=.;
03-17-2015 01:00 PM
Hi, I wondering you are having problems in how to frame or ask a question by explaining the right set of details. Let the folks know,
1. what does your input dataset have
2. variable names and type
3. Your wanted output i.e present us a figure of your sample dataset: have(your input dataset) and want(your output dataset)
4. a Convert business logic or formula, something like a defined business requirement that is meant to be used in the input to get your wanted output.
5. size of the dataset, long or wide and how big?
03-17-2015 01:22 PM
Just another step, how do i compute the trailing/rolling standard deviation for the returns i have generated for the different Tickers/stocks
09-22-2017 07:52 AM - edited 09-22-2017 07:56 AM
proc sort data=input; by tic date; run; proc expand data=input out=output method = none ; by tic; convert ret= ret; convert ret=RETVOL / transformout=(MOVSTD 4); * 4 = number of 4 past/trailing obs to calculate std; label RETVOL =rollingSTDofRET; run;