搜档网
当前位置:搜档网 › 应用时间序列分析第二版 4.7.7上机程序

应用时间序列分析第二版 4.7.7上机程序

应用时间序列分析4.7.7程序:
data a;
input x@@;
time=intnx('month','01jan1962'd,_n_-1);
format time date.;
cards;
589 561 640 656 727 697 640 599 568 577 553 582 600 566 653 673 742 716 660 617 583 587 565 598 628 618 688 705 770 736 678 639 604 611 594 634 658 622 709 722 782 756 702 653 615 621 602 635 677 635 736 755 811 798 735 697 661 667 645 688
713 667 762 784 837 817 767 722 681 687 660 698 717 696 775 796 858 826 783 740 701 706 677 711 734 690 785 805 871 845 801 764 725 723 690 734 750 707 807 824 886 859 819 783 740 747 711 751 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
;
proc gplot data=a;
plot x*time=1;
symbol1 c=red i=join v=star; run;
data b;
input xx@@;
t=intnx('month','1jan1962'd,_n_-1);
format t year2.;
cards;
613.080 614.744 616.470 616.367 630.186 624.235 613.661 608.640 610.131 614.779 612.891 609.310
624.530 620.223 628.992 632.340 643.189 641.252 632.838 626.929 626.244 625.433 626.191 626.061
653.675 677.204 662.705 662.406 667.460 659.164 650.098 649.283 648.802 651.005 658.332 663.750
684.901 681.588 682.933 678.379 677.862 677.076 673.110 663.509 660.618 661.660 667.198 664.797
704.678 695.833 708.940 709.385 703.000 714.691 704.752 708.217 710.030 710.671 714.855 720.284
742.150 730.899 733.984 736.633 725.538 731.708 735.435 733.619 731.513 731.981 731.480 730.753
746.314 762.677 746.507 747.908 743.741 739.768 750.776 751.909 752.997 752.225 750.321 744.363
764.009 756.102 756.139 756.365 755.010 756.784 768.036 776.295 778.777 770.338 764.729 768.442
780.663 774.731 777.330 774.217 768.013 769.323 785.295 795.601 794.889 795.909 788.003 786.240
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
;
proc gplot; plot xx*t; symbol c=black i=none v=star; run;
Data c;
set b (keep=xx);
t=_n_;
proc reg;
model xx=t;
output out=out p=xxx;
proc print data=out; run;
proc gplot data=out;
plot xx*t=1 xxx*t=2/overlay;
symbol2 c=red v=none i=join; run;
data d;
input st@@;
time=_n_;
cards;
0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955
0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955
0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.9

39 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955
0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955 0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955
0.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.9550.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.9550.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.9550.961 0.913 1.038 1.064 1.154 1.117 1.043 0.984 0.931 0.939 0.902 0.955
;
proc print data=d; run;
data c;
set out(keep=xx keep=xxx);
r=xx-xxx;
proc print; run;
proc gplot data=c; plot r*t; run;
data e;
set out (keep=xxx );
set d (keep=st);
set a (keep=x keep=time);
xtl=st*xxx;
proc print;run; proc gplot
data=e;
plot x*time=1 xtl*time=2/overlay haxis='1jan1962'd to '1jan1976'd by year; symbol1 c=black v=star i=none;
symbol2 c=red v=none i=join w=2 l=3;run;




X-11过程:
①程序:
data a;
input x@@;
t=intnx('month','1jan1962'd,_n_-1);
format t year4.;
cards;
589 561 640 656 727 697 640 599 568 577 553 582
600 566 653 673 742 716 660 617 583 587 565 598
628 618 688 705 770 736 678 639 604 611 594 634
658 622 709 722 782 756 702 653 615 621 602 635
677 635 736 755 811 798 735 697 661 667 645 688
713 667 762 784 837 817 767 722 681 687 660 698
717 696 775 796 858 826 783 740 701 706 677 711
734 690 785 805 871 845 801 764 725 723 690 734
750 707 807 824 886 859 819 783 740 747 711 751
;
proc x11 data=a;
monthly date=t;
var x;
output out=out b1=x d10=season d11=adjusted d12=trend d13=irr;
proc gplot data=out;
plot x*t=1 season*t=2 adjusted*t=2 trend*t=2 irr*t=2/overlay;
symbol1 c=black i=join v=star;
symbol2 c=red i=join v=none w=2;
run;


相关主题