BookmarkSubscribeRSS Feed
Helli
Calcite | Level 5

Hello,

 

I have to divide transaction data into ten minute intervals and then run a regression for the data of each interval. So for each time t, for example 18JUN2016, I have the respective transaction volume and price change. I was trying the following:

 

proc timeseries
data=datasets.&symbol.
    out=datasets.&symbol._10min;
    id time interval=MINUTE10.
    accumulate=NONE;
    
run;

 

 

Which didn't lead to a result. I wanted to, firstly, "cut off" the data for the first 10min interval to later run a regression.

 

I'm grateful for every hint!

 

2 REPLIES 2
Reeza
Super User

Assuming you have a time variable, look at the round function. 

 

Time is represented in seconds so ten minutes is 600

 

roumd(var,600) will group your data into 10 minute intervals. 

PGStats
Opal | Level 21

18JUN2016 looks more like a SAS date than a SAS time or a SAS datetime, but, of course, it could be a SAS datetime value, formatted as a date. 

 

Assuming those times are SAS datetimes, you can assign them to the center of 10 minute bins with:

 

data myData10min;
set myData;
time10min = intnx("minute10.", time, 0, "MIDDLE");
run;

 

PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1351 views
  • 1 like
  • 3 in conversation