How to write the code to fit the AR model
How to write the code to fit the AR model, I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
DATA SILVER
TITLE 'MONTH END STOCKS OF SILVER'
INPUT SILVER @ @
Thornton N _
RETAIN DATE '01DEC76'D LSILVER1-LSILVER4
DATE=INTNX ('MONTH',DATE,1)
FORMAT DATE MONYY.
OUTPUT
LSILVER4=LSILVER3
LSILVER3=LSILVER2
LSILVER2=LSILVER1
LSILVER1=SILVER
CARDS
846 827 799 768 719 652 580 546 500 493 530 548 565
572 632 645 674 693 706 661 648 604 647 684 700 723
741 734 708 728 737 729 678 651 627 582 521 519 496
501 555 541 485 476 515 606 694 788 761 794 836 846
RUN
PROC PRINT DATA=SILVER
RUN
PROC REG DATA=SILVER
MODEL SILVER=LSILVER1 LSILVER2
LSILVER3 LSILVER4 / SS1
RUN
PROC REG DATA=SILVER
MODEL SILVER=LSILVER1 LSILVER2
RUN
After reading the above, have you mastered how to write the code to fit the AR model? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!