Hi @JacAder,
PROC ARIMA can be used to fit a regression model with ARMA errors, as shown in the link below:
https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_arima_gettingstarted25.htm&docse...
However, if you want to fit the model:
"change in sale = f(price, income, lag1 of change in sale, lag1 error, lag2 error, error term)"
then you can use other SAS procedures, such as PROC UCM or PROC VARMAX. For your desired model, PROC VARMAX provides the most straightforward approach. Your model, residual plot, and saved output can be obtained with the following code. Note: Although PROC VARMAX supports an OUTEST= data set, the code below illustrates how to output the ParameterEstimates table via an ODS OUTPUT statement. It saves the parameter estimates table in a different format than the OUTEST= data set.
proc varmax data=have plots=(model residual);
ods output ParameterEstimates=arma_est;
id date interval=month;
model sales = price income / p=1 q=2 dify(1);* difx(1);
output out=out lead=0;
run;
proc print data=arma_est;
run;
data all_varmax;
merge have out;
by date;
run;
proc print data=all_varmax;
var date sales price income for1 res1;
run;
When the response variable is differenced, it is common to apply the same order of differencing to the input variables as well. I included the DIFX option in the MODEL statement to illustrate how to difference the input variables, but commented it out, since that was not used in your model description.
For more details on the mathematical models fit by the ARIMA and VARMAX procedures, please see the following links:
ARIMA: https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_arima_gettingstarted13.htm&docse...
VARMAX: https://go.documentation.sas.com/?docsetId=etsug&docsetTarget=etsug_varmax_details02.htm&docsetVersi...
I hope this helps!
DW