I have a time series data containing more than15 variables by group (district). I am trying to run a pro x11 such that the output will have the 15 variables and its accompanying adjusted values. I am currently using the following code for one variable. My goal is to eventually create a sgpanel of a time series each of the variable by district. Instead of coding for each variable, I thought automating it in someway would be helpful. I think I would have to find a way produce a dataset that has all the variable along side with its adjusted values.I saw that loops can be used to produce graphs, I was wondering if it can be used for proc x11.
PROC X11 allows you to specify more than one variable in the VAR statement, therefore, you can obtain your desired output data set by specifying something like the following, where Var1, Var2, Var3 and Var4 are the analysis variables:
proc x11 data = _all_clean_non noprint;
monthly additive date = date_new;
var var1 var2 var3 var4;
tables a1 d12;
output out = test_all_mal a1 = var1 var2 var3 var4
d12 = var1_adj var2_adj var3_adj var4_adj;
For more details, please see the following link to the OUTPUT statement in the PROC X11 documentation:
If you have a large number of analysis variables and you do not want to list out the variable names in the A1= and D12= options in the OUTPUT statement, then you might want to consider using PROC X13 for your analysis rather than PROC X11. The following code will perform a similar analysis to the code above without having to specify the variable names in the OUTPUT statement. They are generated automatically by the procedure:
proc x13 data=_all_clean_non noprint date=date_new interval=month;
var var1 var2 var3 var4;
output out=test_all_mal a1 d12;
In this case, the OUT= data set generated by PROC X13 will have variables:
district date_new var1_a1 var1_d12 var2_a1 var2_d12 ... var4_a1 var4_d12
The D12 table results generated by PROC X13 might be slightly different than those generated by PROC X11 due to updates to the Census Bureau algorithms used to generate the trend-cycle component.
I hope this helps you generate the output data set you want to use in your subsequent PROC SGPANEL steps.
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.