BookmarkSubscribeRSS Feed
Louise_svk274
Fluorite | Level 6

Hej, 

I'm working with time series data where I have observation from 24 of may 2020 to 20 of jun 2020 for Co2.
I have observations for co2 emissions every five minutes. I wish to aggregate to a daily average, by using 'proc timeseries' but it will only let me aggregate to a hourly average. 

When I run the following proc timeseries code: 

 

proc timeseries data=co2 out=co2_average_hour;
id minutes5dk interval=day accumulate=average setmissing=missing;
var co2;
run;

 

It comes out with an error that says "The ID variable value Minutes5DK=24MAY2020:00:05:00 is extreme and invalid at observation number 2 in data set WORK.CO2." But if I change hour to day, it has no problem running the code. 

 

I have copied a example of the data set so you cans what I'm working with. The data continues until the 24. of jun. 

Louise_svk274_0-1638462760320.png

Hope you can help me with aggregating to daily average 🙂 

1 REPLY 1
Reeza
Super User
What happens if you explicitly specify your start/end datetimes using START/END?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 384 views
  • 0 likes
  • 2 in conversation