turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Divide data into intervals and run regression for ...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-18-2016 01:26 PM

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!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-18-2016 02:23 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-18-2016 02:41 PM

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