Time Series Analysis Package
Example
This example uses the TSMODEL procedure to analyze the frequency of the time series Air and then conducts a count distribution analysis.
The following DATA step loads the Sashelp.Air data set onto the CAS server. This DATA step assumes that your CAS engine libref is named mycas, but you can substitute any appropriately defined CAS engine libref.
data mycas.air (replace=yes);
set Sashelp.air;
run;
proc tsmodel data=mycas.air outobj=(of=mycas.outfreq(replace=YES)
odpe=mycas.dpe(replace=YES)
odprob=mycas.dprob(replace=YES)
);
var air;
id date interval=month;
require tsa;
submit;
declare object f(FREQ);
declare object of(OUTFREQ);
declare object dpf(DPF);
declare object odpe(OUTDPE);
declare object odprob(OUTDPROB);
rc = f.Initialize();
rc = f.SetOption("SEASONALITY",12);
rc = f.SetY(air);
rc = f.Run();
rc = of.Collect(f);
rc = dpf.Initialize(f);
rc = dpf.SetOption("SELECT","AIC","METHOD","POISSON");
rc = dpf.Run();
rc = odpe.Collect(dpf);
rc = odprob.Collect(dpf);
endsubmit;
run;
Last updated: January 27, 2023