BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ubshams
Quartz | Level 8

I was having problems getting seasonal factors for a short dataset (2018Q3 to 2020Q4), creating synthetic data here to replicate my issue but having problems:

 

data have;
input quarter variable1 variable2 variable3;
cards;
2018Q3 501 500 95
2018Q4 520 502 96
2019Q1 510 502 101
2019Q2 515 400 105
2019Q3 506 402 106
2019Q4 530 400 98
2020Q1 515 399 95
2020Q2 520 399 95
2020Q3 510 399 95
2020Q4 540 399 95
;
run;


proc x12 data=have date= quarter interval=quarter;
var variable1;
x11;
output out = out a1 d10 d11 d12 d13;
run;

 

I get following error:

 

NOTE: This release of the X12 procedure is based on the Census Bureau X-13ARIMA-SEATS Release Version 1.1.
ERROR: Time ID variable quarter contains missing values.
NOTE: The SAS System stopped processing this step because of errors.

 

2 questions:

1. How do I get rid of this error?

2. Can I still get Seasonal factors (i need d10 value from proc x12) for a short time series like this whereby data starts in 2018Q3 and ends in 2020Q4?

Thanks in Advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
jimbarbour
Meteorite | Level 14

It appears that you're not reading in your date values properly.  SAS wants dates to be stored as SAS dates which are numeric.  I think you need to apply an INFORMAT as you read your dates so that they will be stored as SAS dates.  Without an INFORMAT, SAS will treat them as character data -- which should produce a Note in the log.  Can you post your log from the Data step?

 

I think you should try INFORMAT YYQ6.  Like this:

data have;
input quarter : YYQ6. variable1 variable2 variable3;
cards;
2018Q3 501 500 95
2018Q4 520 502 96
2019Q1 510 502 101
2019Q2 515 400 105
2019Q3 506 402 106
2019Q4 530 400 98
2020Q1 515 399 95
2020Q2 520 399 95
2020Q3 510 399 95
2020Q4 540 399 95
;
run;

 

Jim

View solution in original post

3 REPLIES 3
jimbarbour
Meteorite | Level 14

It appears that you're not reading in your date values properly.  SAS wants dates to be stored as SAS dates which are numeric.  I think you need to apply an INFORMAT as you read your dates so that they will be stored as SAS dates.  Without an INFORMAT, SAS will treat them as character data -- which should produce a Note in the log.  Can you post your log from the Data step?

 

I think you should try INFORMAT YYQ6.  Like this:

data have;
input quarter : YYQ6. variable1 variable2 variable3;
cards;
2018Q3 501 500 95
2018Q4 520 502 96
2019Q1 510 502 101
2019Q2 515 400 105
2019Q3 506 402 106
2019Q4 530 400 98
2020Q1 515 399 95
2020Q2 520 399 95
2020Q3 510 399 95
2020Q4 540 399 95
;
run;

 

Jim

ubshams
Quartz | Level 8

Thank You the : YYQ6. fixed it!

 

But I get this other error error:

NOTE: This release of the X12 procedure is based on the Census Bureau X-13ARIMA-SEATS Release Version 1.1.
ERROR: Series to be modeled and/or seasonally adjusted must have at least 3 complete years of data.
ERROR: An error was found in PROC X12 input. Processing skipped for variable variable1.

 

Any way to get around this issue if I only have 10 quarters of data (and not the full 12 quarters for the 3 years)?

 

 

 

jimbarbour
Meteorite | Level 14

@ubshams wrote:

Thank You the : YYQ6. fixed it!


You're welcome.  🙂

 


@ubshams wrote:

But I get this other error error:

NOTE: This release of the X12 procedure is based on the Census Bureau X-13ARIMA-SEATS Release Version 1.1.
ERROR: Series to be modeled and/or seasonally adjusted must have at least 3 complete years of data.
ERROR: An error was found in PROC X12 input. Processing skipped for variable variable1.

 

Any way to get around this issue if I only have 10 quarters of data (and not the full 12 quarters for the 3 years)?


Hmmm.  Good question.  I've not used Proc X12, so I am not sure.  What I would do is:

1.  Mark this topic as solved.

2.  Post a new topic specifically asking about what to do for Proc X12 if one only has 10 quarters worth of data.

 

Jim

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 517 views
  • 0 likes
  • 2 in conversation