A Transfer Function Model for the Italian Traffic Accident Data

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: ucmex10.sas
 Description: Example program from SAS/ETS User's Guide,
              The UCM Procedure
       Title: A Transfer Function Model for the Italian Traffic Accident Data
     Product: SAS/ETS Software
        Keys: equally spaced univariate time series data
        PROC: UCM
       Notes:

--------------------------------------------------------------*/

data italy;
   input Injured;
   Date = intnx('month','01jan2001'd, _n_-1);
   format date date.;
   Injured = Injured/1000;
   label injured = "Monthly Traffic Injuries (in thousands)";
   shift03 = date >= '01jul2003'd;
   pulse03 = (date = '01jul2003'd);
datalines;
27874
25240
29910
30674
33630
35483
36136
30027
31355
31925
31704
29328
28181
24904
30527
30709
34085
34263
36267
30741
31635
32537
32464
32178
28305
24847
30607
30576
34753
35608
31378
25884
28440
30139
27747
28191
25653
24406
26801
28744
32054
32502
33291
26718
28511
28936
27743
27820
23483
22314
25373
27027
32561
32194
32883
26951
27588
28614
28192
27678
24236
22338
25388
27578
30553
31443
32427
26475
28323
29215
27749
27230
24866
23168
26995
28178
30057
30508
32751
24523
27161
27599
25227
24817
23740
23549
25912
25609
28132
27929
29924
24889
25568
27149
25045
23299
21442
19945
25122
25245
29409
28319
30741
25159
26072
26885
24867
24052
22655
20954
24100
26740
27733
28168
30328
24167
25551
26827
24974
22523
20306
20163
22323
25842
28212
26793
28064
24599
25757
25508
22280
22172
20109
16596
21533
20680
24582
26223
26710
22980
21909
23352
21532
20658
19363
17208
19908
20494
23009
24693
25029
21339
22597
22000
21152
20629
;

proc sgplot data=italy;
    title "Monthly Traffic Injuries (in thousands)";
    series x=date y=injured;
    refline '01jul2003'd/axis=x lineattrs=(pattern=dash color=orange)
    LEGENDLABEL= "New Traffic Law Introduced"
    name="Forecast Reference Line";
run;
title;

proc ucm data=italy;
   id date interval=month;
   model Injured = shift03;
   irregular;
   level variance=0 noest;
   slope;
   season length=12 type=trig;
   tf pulse03 den=1 tfstart=0 plot=smooth;
   estimate plot=(panel residual) like=marginal;
   forecast plot=decomp;
run;