I'm trying to use proc x12 to adjust seasonality. I use the following code. My data is quarterly.
proc x12 data=HAVE date=yyqq interval=4 noprint;
by company_id;
var assets;
x11 mode=add outforecast;
output out=WANT;
run;
There is error showing "Time ID variable DATADATE contains gaps." This is because some of my observations ended the third quarter of the year instead of the fourth quarter of the year. Is there any way to fix this??
Also, those firms with adjusted assets results have the exact same values of adjusted assets with unadjusted assets. Is this because none of the firm in my data has seasonality pattern in terms of assets OR there is some mistake in my coding? Please help.
You can use PROC TIMESERIES to covert your data into a proper time series with no gaps in the dates.
For example, this will set to 0 the values of all numerical variables for the dates for which there are no observations. You can look at the SETMISS= option in the manual to see other options.
proc timeseries data=have out=mseries;
by company_id;
id yyqq interval=quarter
accumulate=total
setmiss=0
var _numeric_;
run;
You can use PROC TIMESERIES to covert your data into a proper time series with no gaps in the dates.
For example, this will set to 0 the values of all numerical variables for the dates for which there are no observations. You can look at the SETMISS= option in the manual to see other options.
proc timeseries data=have out=mseries;
by company_id;
id yyqq interval=quarter
accumulate=total
setmiss=0
var _numeric_;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.