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.;
Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.
Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.
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.