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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.