I am trying to do a seasonal adjustment on a data set using procX12. My error is as follows:
ERROR: Interval of date variable does not match INTERVAL=YEAR
The data set is an excel document that was properly imported (I know this because I have made a time series plot with the data).
The year is a 4 digit year such as 1999.
My code is as follows:
format date Year;
proc x12 data=seasonlogsun date=date interval=year;
ods select d11;
Any help would be greatly appreciated.
To clarify, are your date variable values before formatting are something like 01JAN1999, 01JAN2000, 01JAN2001, ... ?
In other words, does the date variable contain month and day information that is consistent and the interval of that data is one year? If you have monthly data then it would need to be accumulated yearly first using proc timedata.
A sample of the data before formatting would be helpful
I think the problem is that your input is not in a SAS date format in which the numeric value represents the number of days since Jan 1, 1960. So each successive year is being interpreted as the next day rather than the next year.
To input the data correctly you need to use an informat.
Try using date = mdy (1,1,year); in your data step instead of date = year;
EDIT: In addition, to have the date display correctly, you will want to change your format statement to the following:
format date year4.;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.