/* This data is taken from Robert Shiller's website on his book, Irrational Exuberance, 3rd edition. http://www.irrationalexuberance.com/main.html?src=%2F. The name of the xls file is ie_data.xls. Downloaded June 15, 2015. */ data Shiller; input real_price; date = intnx( 'month', '31dec1870'd, _n_ ); format date monyy7.; log_real_price = log(real_price); datalines; 84.41052611 83.01637029 83.80386229 89.43111779 93.82747433 94.52097297 92.75605853 95.43525824 94.17151411 87.93362168 88.89150427 88.75856565 91.00561794 91.38012666 92.97833472 93.48322887 93.48322887 93.25679252 94.08521966 92.29452928 89.98462436 92.37134351 89.33242913 92.84390147 93.57639774 92.27360396 91.55691577 90.30271144 92.47765334 93.95927565 93.77060241 93.77060241 86.60101913 80.892411 80.49236812 85.99960586 89.2746573 91.95672855 90.61569293 89.50185225 87.85351844 89.57715012 88.86038659 89.77799575 91.18391515 92.47490747 94.06196778 93.44449316 93.44449316 93.23866828 94.47361753 94.92457389 93.5503208 93.23336273 93.44622429 93.07693316 93.02050117 91.53047026 93.82256673 94.63858424 97.43509998 98.74588608 98.52742173 95.65204199 95.50642608 97.50514597 96.33038517 91.47306484 85.09151129 83.09191115 80.772602 78.90191482 76.88031443 74.26978944 73.78361719 66.56409231 65.37520388 64.14193939 66.3354287 73.74744388 79.10976156 80.81892308 81.18970296 80.94065479 83.44450125 82.49717658 85.84247675 89.17586702 92.42489223 96.50605331 97.3812283 95.46882581 97.40587445 97.3812283 98.20410703 99.90921433 102.4820104 104.9963219 104.4858486 109.176156 114.0992187 116.0273792 116.9951379 117.8639137 118.0887309 123.9946886 124.0212126 120.1296379 121.2032455 123.3379406 124.5246442 126.4779521 119.9961834 122.9843572 128.6329081 133.2544497 131.6402951 135.4522728 141.1275868 145.4441305 155.7183177 153.66272 155.4060572 153.3752011 161.8813096 163.8736949 156.5807921 149.9128367 145.4724314 141.8191855 144.075896 139.88629 137.791487 133.5175746 133.2869743 132.0639098 129.2792405 127.4412165 135.8450864 138.6596334 143.8945882 141.2828253 136.5072044 138.5179949 137.8064298 133.4528263 136.3832998 140.5685796 139.5156561 144.9460341 145.6175465 139.0101186 141.9840283 138.1327436 141.6460956 137.1057344 132.9976974 136.5922297 136.0787251 132.651157 124.5248593 119.4367468 120.7341315 128.3138528 125.6189895 122.864228 123.108895 124.2379679 121.3753419 123.6749129 126.8412634 125.0967557 126.5753227 129.025193 132.2330397 139.6452056 139.5272436 147.6288255 155.3589973 150.5878013 154.1730508 157.1379171 155.7304074 155.5036019 156.2780584 165.5071223 165.9286954 165.1101629 169.4147109 173.7192589 178.0238069 171.2969364 165.4395429 162.3211315 166.1301111 169.9390907 172.869075 169.8868425 167.7327509 161.5852167 161.4315206 154.1730508 155.2891691 150.8603896 150.2777546 151.1466522 145.4214002 147.6918821 151.4801895 148.5398047 150.6011942 153.8241769 157.6331565 154.9316802 150.0016018 147.1389758 155.3589973 159.0310518 157.6296277 157.3259097 165.6173846 168.4191824 164.9947628 167.1739389 169.1072432 166.032566 164.4952275 161.5779613 167.4852498 165.6173846 164.3721411 167.7965607 172.7968558 171.5669849 170.3371141 160.3992701 155.875166 148.8432036 141.3275951 138.0269507 146.9994987 147.0287083 142.610072 145.6202208 146.7608849 147.3032166 146.6621 151.5815834 165.9286954 165.9286954 165.5071223 170.5511489 178.2154216 178.5388616 185.292258 187.4597471 187.4597471 186.4500896 181.5433324 181.7732613 177.2451017 180.8029414 175.5951755 171.5322911 168.3328681 163.3641365 161.2742434 163.2653566 150.6744626 147.1941426 136.9767382 139.1943371 143.2029536 145.547985 151.7536952 148.4196562 149.4292898 153.6384607 162.7839392 164.9495792 158.8135992 156.6479592 153.3994992 154.6907789 154.963708 154.4102401 154.4102401 155.2041992 153.3994992 151.2338592 151.2338592 151.1587955 157.2759544 158.1796789 161.0287429 165.6866431 166.7243465 164.3030386 158.7686204 151.5338243 151.9197523 160.6182992 158.0917192 161.8816743 163.5544783 163.0136831 152.4479814 143.7690122 151.315942 150.1617341 155.8333759 150.1408325 154.5567117 153.0917192 153.4579673 150.9161777 153.9573674 161.1269507 168.296534 171.4464991 174.6848252 171.4878703 165.4395429 168.9973826 173.6225741 170.826325 163.1093247 160.3031428 159.5877309 177.4910071 180.7382534 187.4981487 187.1423647 183.2287411 189.2770685 198.1865989 213.2698267 215.2735948 218.3440581 218.0860254 208.9991077 201.563442 205.7928028 208.2953385 198.3050262 194.9345312 196.2018102 180.6352702 183.0357389 184.118201 185.6006342 187.9725273 183.4456553 180.1760809 177.9787318 182.6358226 176.156424 184.7880967 199.2390793 213.8705699 217.3796744 225.7003831 233.7944658 256.6148525 243.6895344 267.9639123 246.8695225 247.2040428 242.9743779 240.2409162 242.4473394 235.7068757 243.6475738 245.7479839 246.0480425 251.4206674 247.8766737 243.5468094 249.049056 258.7176157 256.2888542 231.9936114 230.5808394 222.7605936 231.5330395 230.164641 228.6712348 219.3319393 220.0898635 207.9270026 198.370469 191.9994467 185.2119015 181.2845454 184.0030155 192.49997 191.223416 181.8902253 183.3898022 190.0783656 190.448981 190.7419794 198.6529371 203.0039398 209.5442224 221.8535141 228.6220216 230.8606705 235.8976306 246.2513819 256.1231034 253.0100049 243.323209 246.185835 253.9149252 260.3682377 264.2203787 267.9417925 263.4813362 266.9588845 276.1933113 274.2344935 267.5185467 263.8807422 254.030093 257.3507478 259.3539146 272.2756757 277.5513979 263.3953138 265.9208287 260.7067812 256.012399 242.7568604 221.2298398 222.2896234 210.1343177 201.2938123 208.9963816 193.3344906 191.2804721 168.7435443 165.5911974 177.8527453 187.4706053 182.6360146 190.1074879 198.1441142 208.8176231 209.0913028 214.3978299 223.6017772 221.1654382 221.4667929 233.9472437 236.7272624 240.0409998 230.6976643 233.8435416 239.2931544 244.7289656 246.5330393 250.0549398 253.5310356 251.2690192 247.3561806 243.7799218 244.3039978 241.3852271 232.7643261 234.0123503 226.2387253 226.7520601 217.9172189 206.9016232 213.9884847 217.5518443 234.4579516 239.0364021 232.360842 238.0093928 249.8439987 244.3297991 251.2136189 256.6277055 261.7710878 257.8869668 237.8928017 222.6042541 223.8880157 235.2985508 238.8245139 236.5956762 232.1040896 233.954823 234.1551276 233.9109617 236.2273998 236.4739837 239.5267781 238.4097694 237.9261796 235.2664357 229.027643 224.8692551 216.8900235 212.7795102 212.5377153 208.8659227 196.3374571 196.9871283 202.2528838 202.126027 195.728134 188.8633614 190.515036 198.334683 202.9709414 199.141301 196.3374571 195.5510131 194.593603 181.984512 178.4161882 178.4161882 180.1826851 178.4161882 172.4404604 175.4904277 174.875742 181.1898616 192.884626 186.5172327 188.6287485 187.9249099 195.9017475 203.1747465 212.333849 217.6341883 218.0943029 212.5795644 209.6175769 206.9441933 202.7564274 205.2906477 205.3644667 202.5121824 202.1760275 206.6453261 209.2788336 210.3783817 200.1895 193.8203103 178.3116475 183.8406908 172.4534944 164.0200578 164.7776431 162.7241883 155.4815592 144.6697053 134.8033422 123.5697304 117.6146861 122.033885 124.8656291 123.21868 120.3150979 121.58448 120.091466 117.851794 116.6330662 113.8006917 116.4061088 117.1711374 113.453097 112.7350394 115.2615383 117.3236024 119.0470665 125.7705462 129.1356444 129.51035 118.7472503 119.9438534 123.9779961 117.7109843 111.834618 108.4118119 98.42912308 104.2860168 100.3865714 92.71308447 89.79498947 90.11277356 88.71371429 93.2433665 93.83100101 89.51784444 83.17993763 88.67255211 90.92013804 89.08622514 90.46335304 95.31910056 88.18644602 87.42046723 86.3494661 89.50279943 90.72144571 96.14543333 100.1254503 102.355071 104.5984698 109.8241114 116.4930174 121.0335491 119.8984162 120.0310173 126.0450584 129.3282253 131.3916371 124.121381 123.1065101 125.5318512 130.8916381 133.0073435 127.5933077 121.5641734 116.2492976 111.0400895 112.2437368 112.2799913 109.9873277 113.2746202 117.1097948 120.9449694 122.1992052 120.5580877 118.4795 118.0613371 120.2915394 125.1309807 130.1880624 128.179576 125.7811436 132.8072535 139.1620486 144.9148104 146.9972401 142.3123705 141.6243326 145.325722 146.2375543 148.6014068 150.6095339 154.0902876 159.1775429 161.3954078 164.9446447 167.459852 167.7246106 157.2183028 151.9714704 153.890227 162.122796 170.8812903 178.6725333 180.3596503 175.2958057 176.5813113 180.5975655 181.4428914 186.0264333 189.9781116 194.6351092 200.1895 200.4726994 208.4691318 220.8402773 232.0280613 227.1538 233.6717075 239.1505283 240.109322 240.0075953 252.8948392 268.8306784 275.5337209 263.5649228 265.504938 274.0964339 289.9665913 297.5764186 317.6903802 320.7953713 344.4912713 346.292714 354.4627865 354.457013 357.6687024 362.3671257 390.0920416 412.2812659 428.7177283 383.3804861 281.8853306 294.8210814 300.8409292 321.5673018 335.6685479 354.8809494 335.6685479 303.5331952 300.623888 298.56834 296.6269892 257.3518352 240.1377183 228.2754093 238.1512465 259.5983949 266.2750814 242.4625639 221.9361092 217.6570417 224.8756603 218.1278212 186.8816647 163.0087081 167.483266 136.9817781 137.5356434 138.3101113 139.80581 107.0577353 95.30248832 83.10988456 87.29151397 132.1704644 146.0657716 126.8532391 126.5576477 123.3633878 130.2356054 116.6136811 117.1630611 129.5751992 166.8116135 193.8585835 203.133555 191.5418583 189.9262288 171.4362462 175.5650773 178.9758508 189.2081712 201.682397 191.3488466 194.5558105 174.7795331 175.7740642 167.4628157 160.9199179 154.7202882 157.0950407 161.4831704 163.7492791 161.3412015 155.3205708 145.4616927 155.2253159 167.4166848 175.038327 184.205354 196.6586737 200.8097803 206.1716263 223.9090841 223.9090841 236.2721623 249.8372065 257.0226818 257.3686073 243.7045482 252.2411384 265.2577007 268.6099521 271.6565679 285.8741079 293.82916 288.7514671 295.6105539 304.3494674 301.8724162 281.8652161 267.4016493 257.3638028 270.78694 273.56508 233.2260842 199.3052411 183.0304 181.3394569 188.7328373 185.5338553 173.2657652 165.0369373 167.7199163 171.585205 205.7005787 206.8769709 197.4658333 221.0488957 221.2181521 214.7864079 211.5705357 211.3878849 211.2174108 185.9613022 192.829679 196.2638674 201.0717312 198.152671 214.6075482 218.3407929 214.447895 209.3702021 209.6831439 206.8313557 205.6465607 207.6776379 179.0733014 162.5101794 169.0871721 172.6415571 179.9195836 181.6121479 185.8435586 176.9629979 177.2991099 166.2074121 166.0381725 159.740193 155.175234 157.3278803 165.3877102 162.3725765 160.6927258 152.2422856 144.1757032 133.9200542 134.7798643 129.7275538 121.1452888 115.3887304 115.2812804 121.0962252 124.8369366 123.3622915 124.6547952 132.2429868 133.5715315 133.4822296 141.4743379 149.8870834 152.5079145 155.7937333 160.9967149 163.8402229 168.1864167 160.8033908 163.2838167 161.7858 154.2957167 156.3384667 161.37725 160.2877833 164.7818333 160.9967149 163.8402229 170.5835528 174.0376836 171.4940559 168.682678 172.8328073 171.6279311 174.3911742 179.5829725 185.573509 185.440386 190.0996921 196.1861665 197.553111 193.4946972 194.1492801 207.3718541 216.0123481 223.0818431 225.631839 234.6154495 236.5662503 226.988594 240.3073337 239.5207189 235.4384075 216.015654 207.6323911 175.2799662 168.0358293 163.4238362 166.7530079 167.6347158 174.1373116 164.0318922 157.9726667 155.1594548 159.8396164 168.3262806 162.8171618 155.1566322 159.1746326 156.6391312 152.2005885 148.2743447 142.1754 144.8082778 153.3264118 160.1208305 165.3796838 159.4617533 154.1684269 152.4275037 157.2281234 149.7150045 149.3529963 151.65376 147.0539676 148.4478441 147.6284314 147.1535303 138.5069971 147.5744658 152.2312231 153.5771929 158.872511 160.3953567 166.0721127 170.2071455 173.5346549 174.2050275 179.124939 184.3680996 186.5803218 170.8857851 179.7182868 185.2941689 191.3973711 190.2387437 187.19761 197.8700941 202.8442802 198.6598128 201.3233054 200.6374853 197.1608668 200.6374853 209.4205216 213.1723111 211.2733679 203.8385943 209.3286864 216.3033287 213.9838878 214.5244787 213.0835856 212.9938284 218.00228 222.5817124 223.4691993 219.9192517 215.3043199 222.1379689 231.1015865 233.2175421 231.2362166 231.5249778 220.1224395 220.4517438 211.7600019 214.7661981 214.8486993 204.9827483 210.3669344 215.8176766 218.7246086 224.2742059 229.2071814 234.052068 244.2976556 253.0792591 255.1053026 265.4116978 270.6970286 278.0731549 284.5276351 295.6682448 310.3541659 315.9453333 326.5064273 323.9327154 335.1150502 333.6950712 353.0422854 377.4544668 375.1556108 390.5859502 370.9421372 395.9593699 401.1503668 390.3634272 392.8391183 419.8948847 423.2669126 408.4471059 403.0916518 421.8562051 420.884319 405.0788161 398.4357876 394.299776 398.7092739 390.0379482 371.8630949 375.2987327 382.6165932 395.8907864 400.975105 406.1795438 383.8233413 368.2493576 345.3070375 336.6653398 336.4984673 340.6907021 341.8506413 346.4702601 347.1572339 358.3082457 366.9174827 375.70258 391.1053391 401.4364235 417.7529775 428.9775 438.5791318 454.47102 449.0742017 460.4711917 466.5641 473.59116 467.8922385 484.7921459 482.0330342 461.3826263 459.4103061 461.264067 476.0135558 469.3082174 449.5773136 443.4518429 447.6516973 443.555118 458.3875791 447.0199514 452.3835503 438.7744186 427.241848 441.0777091 451.653396 474.8721973 494.3537258 509.8594322 523.456744 528.7843456 521.7868987 516.8865653 537.2391508 531.262078 537.1070667 561.4348573 566.6479553 545.5586043 552.7993681 553.3504355 533.9423825 494.2399805 436.4910321 445.5298426 457.6515076 452.0928289 437.8285207 467.994025 488.2602553 507.1234388 513.8268842 510.199919 534.2065849 544.9280085 542.9148853 533.1191573 547.8615577 562.2952166 561.8544081 558.7000838 568.7782858 586.2626392 593.4711006 604.2837929 613.0259696 619.0074589 613.3416181 634.0748547 626.7947742 635.5225141 646.4942492 648.9031077 637.6627449 654.0675987 658.8523478 657.3530342 663.8625232 673.7483924 637.6896633 636.714832 648.562782 670.2340323 683.1445744 688.8256104 683.529845 695.377795 686.3665534 656.1032997 671.9951827 636.6347375 629.4040599 625.8634018 584.4264021 563.8464768 555.5212058 583.3224745 585.7712909 608.2427827 629.2017702 642.0870842 651.1719227 660.8443919 650.6054465 659.8669638 668.3658481 675.6857676 672.6260516 649.6041698 666.1413776 660.4276645 628.7727851 615.4716417 659.007777 672.2080386 686.2933573 681.0025129 664.2299283 683.8731254 696.780289 705.5219944 710.877 678.9274719 671.8250978 651.801349 661.2657493 680.9316319 641.8610727 609.8474698 603.1567195 603.6386817 606.8183292 607.9420104 572.6613923 566.1314098 543.5091168 549.906161 529.003274 466.919729 461.6425466 460.0650123 473.4319303 499.1855668 507.4170261 504.3157707 536.1346219 556.6155003 576.7190098 590.02791 608.6478055 597.3953945 582.0086571 576.3867568 564.7522833 577.2971716 563.6611518 537.531932 571.7572757 595.5684842 603.5856368 616.4368188 621.2322699 613.4731803 613.7067626 606.2530979 626.2487857 615.7556912 613.9646903 643.2542665 655.1219412 658.5902723 630.7859627 615.108351 599.4627913 578.6333667 561.8394389 565.92014 545.3734856 553.6033274 570.5723289 526.5755556 486.1249788 488.7152251 469.1486981 483.0394343 456.4422738 437.2039821 434.2152778 380.42952 360.3198554 319.004883 322.0045589 330.0861876 306.2204264 330.0143002 361.5317314 376.7063571 379.4927501 401.3159004 408.4890224 404.360478 374.0286536 367.4600463 382.2852209 385.9475069 378.7074468 412.8030349 427.2056523 428.5609106 430.4121586 424.4292177 424.6906021 432.4190508 426.4436359 434.0134462 417.0314698 413.4526 426.2819124 420.4503282 404.955313 400.6399227 391.1798158 388.0940438 387.6055867 389.2342918 378.4761806 371.3772731 360.5931276 360.912674 357.9950625 342.168796 335.208455 331.9668514 343.7945053 357.8631967 354.9296923 350.5334126 373.0309106 370.2261669 355.2619285 332.9730993 336.3977768 345.9323849 336.8521356 339.8222908 342.6843329 330.5163786 333.3157718 332.9095663 344.8427724 344.9563995 329.2847806 323.750307 333.0401591 337.7731761 346.278488 309.7329251 301.3182346 311.9863606 328.3615647 343.2610423 351.3137635 356.8489702 363.8214835 376.0858047 366.5588239 362.2476667 346.1380614 356.6433763 357.4331044 347.5222751 346.0229106 333.9673242 332.7181625 300.7752114 303.9367045 310.8032134 312.0800447 294.753878 286.805555 277.8312931 290.3933793 287.9126054 267.9835289 265.8801497 266.0634831 296.2592605 320.2083432 333.9187541 338.4434898 349.6235552 355.3174791 367.6616149 378.9902059 391.9856038 396.2811819 396.1176476 384.0533094 393.4413585 393.4457851 386.8144941 384.5612991 386.9477684 364.0004951 363.5218967 362.2186072 358.8760097 349.8401437 343.9433708 372.7852593 374.8465705 370.8532118 374.2286961 370.1781149 385.4233592 404.3951236 399.5342538 400.3254949 408.3291622 415.9995827 423.1410714 413.1424046 402.8084201 405.9040092 429.3523165 449.4199515 450.1356186 475.6523751 505.9336002 519.3024125 518.9597934 530.8314402 519.7949936 529.2156335 512.4077105 510.00967 526.0747364 533.1041394 563.6299955 596.4317482 618.2917707 608.2718607 605.7015641 629.2461903 645.7028638 682.292785 656.685507 575.8535282 503.0758666 494.862383 513.0356914 527.233775 540.4292386 531.3871341 516.4697864 543.600011 538.1068937 525.093179 530.0919199 546.8587903 533.7979135 543.7274979 558.4483782 572.9107401 567.1128316 581.9066263 600.8193061 618.0791966 632.2081359 659.1491926 658.3668856 655.4104825 640.2974726 655.0666725 632.3308574 611.7429809 623.1635054 621.6818822 642.3753077 657.4107314 654.2358035 595.5485505 563.2195794 545.1299482 558.3767049 582.2142844 573.0147467 636.8009447 653.4451594 665.448174 660.5319499 659.1119126 661.5192406 675.4892723 668.7356035 667.2103197 663.6227669 667.5920311 713.9312145 705.3376987 692.9477261 692.0391842 703.6003063 690.0374531 699.998811 702.8550381 701.7877022 689.3200811 705.6038279 727.4758193 723.2234612 731.4101349 742.8235616 729.1096786 731.6643187 735.2621159 733.9985534 743.1643002 749.9727854 754.4631441 752.3041942 757.2774078 766.615851 761.7254616 746.6301209 718.9631857 724.3716142 728.2166349 720.7769043 738.2942695 740.631691 735.1435036 729.7292491 720.516815 733.50083 756.7613074 771.8383808 792.3228814 815.5157279 838.0579452 866.057953 866.4888587 895.2007861 898.6866642 918.7252166 948.7159129 942.9556268 993.6368551 984.7723836 981.1436726 1000.53895 1010.894011 972.0903384 998.2707573 1013.427693 1050.014278 1099.140148 1110.465175 1141.186204 1185.374035 1173.184009 1129.963102 1233.030439 1295.35123 1366.079708 1366.404622 1377.390336 1394.714867 1377.619469 1413.777017 1412.604098 1498.359522 1573.147719 1621.820306 1613.329821 1611.306663 1679.301717 1558.389722 1478.299717 1491.786943 1653.554807 1720.518962 1801.018201 1795.673862 1840.611345 1903.02885 1899.193593 1885.62049 1963.035449 1882.469796 1860.346903 1831.445122 1958.466839 2011.518622 2001.222635 1938.193441 1996.171959 2021.496814 1959.892725 2009.423316 2019.91092 2036.9972 2002.692343 1893.13899 1875.582885 1812.504838 1807.478864 1760.006907 1594.766346 1593.800433 1694.010157 1649.008331 1607.917 1573.274262 1388.3166 1435.608834 1508.950638 1535.378992 1525.595829 1466.89349 1529.087945 1465.416134 1422.347056 1335.637383 1188.860538 1196.66262 1136.107126 1117.000939 1189.278008 1177.826388 1168.284813 1083.242992 1089.123769 1147.446239 1208.632946 1274.444703 1278.908569 1270.195229 1304.34926 1330.467146 1348.418721 1389.405175 1449.032433 1455.04534 1421.222929 1428.509852 1381.88073 1414.95876 1383.532789 1361.657696 1394.626624 1386.762516 1450.213892 1493.24016 1467.990206 1482.080945 1464.781734 1417.893979 1436.234828 1464.699012 1482.19431 1477.096716 1461.231274 1417.899848 1483.835819 1519.607953 1528.02109 1522.464556 1534.351034 1531.319608 1509.528294 1463.528389 1467.44575 1495.840004 1538.937174 1600.917549 1633.006182 1663.198547 1667.197897 1682.358946 1623.502401 1678.017238 1721.952129 1722.090252 1729.945515 1657.802395 1701.549514 1746.162911 1649.863834 1668.830543 1547.799843 1516.576553 1461.451357 1511.687299 1534.886849 1452.465593 1354.474639 1386.012113 1318.051471 1059.99307 985.0265993 989.1438821 971.4126029 899.2120172 843.4469988 942.4909766 999.8979275 1017.429722 1029.718791 1108.55848 1146.069683 1170.298625 1191.827204 1218.410525 1228.695737 1190.758852 1254.364571 1301.394667 1221.906391 1177.766624 1173.648707 1180.149426 1217.213752 1269.329962 1298.372397 1342.244044 1380.093599 1414.543801 1383.249634 1402.867323 1403.429747 1351.374483 1389.929698 1239.797269 1225.980241 1263.405974 1284.583198 1305.504732 1359.645892 1407.715254 1435.067139 1427.850865 1382.964549 1366.625547 1406.401062 1443.534821 1478.051052 1472.889539 1435.323863 1467.869984 1523.337257 1543.531203 1578.718863 1600.610247 1668.096961 1642.72184 1692.703403 1692.098224 1707.417568 1745.166215 1813.307882 1838.110187 1846.066978 1833.89619 1868.772396 1863.371403 1882.295122 1935.783721 1962.408407 1954.165562 1984.253259 1933.402526 2051.565577 2073.053187 2056.401839 2102.044247 2087.389623 2098.047459 2113.010064 2079.28 ; Proc Print data = shiller; run; title 'Real Price of S&P 500 Jan 1887 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller; plot real_price * date; run; title 'Log of Real Price of S&P 500 Jan 1871 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller; plot log_real_price * date; run; data shiller; set shiller; d_real_price = log(real_price) - lag(log(real_price)); run; title 'Growth Rate in Real Price of S&P 500 Jan 1871 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller; plot d_real_price * date; run; data shiller; set shiller; D = (_n_ > 912); run; title 'Seeing if there is a break in growth rate in Jan 1947'; proc autoreg data=shiller; model d_real_price = D / nlag = 12 DW=4 DWPROB method=ml backstep slstay=0.05; run; /* It appears the break is not significant but looking at the data, I am content to analyze the data before Jan 1947 and on and after Jan 1947 as separate data sets */ data shiller2; set shiller; if _n_ > 912; run; title 'Real Price of S&P 500 Jan 1947 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller2; plot real_price * date; run; title 'Log of Real Price of S&P 500 Jan 1947 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller2; plot log_real_price * date; run; title 'Growth Rate in Real Price of S&P 500 Jan 1947 - June 2015'; symbol1 i=join v=star; proc gplot data=shiller2; plot d_real_price * date; run; title 'Dickey-Fuller Tests'; proc arima data = shiller2; identify var = log_real_price stationarity = (adf=4); run; title 'Trying Several ARMA models for Monthly Growth in Real SP500'; proc arima data=shiller2; identify var = log_real_price(1); estimate q=(1,5); estimate q=(1,4,5); estimate p=(1,5); estimate p=(1,5,6); estimate p=(1,6); run; /* q=(1,5) Model is best. Now will forecast 6 periods ahead using it. */ proc arima data=shiller2; identify var = log_real_price(1) noprint; estimate q=(1,5); forecast out=result lead=6 id=date interval=month noprint; run; data result; set result; if _n_ > 822; run; title '6 steps ahead forecasts of log(Real SP500)'; proc print data=result; run; data convert; set result; SP500F = exp( forecast + std*std/2 ); lower95 = exp( l95 ); upper95 = exp( u95 ); keep SP500F lower95 upper95 date; run; title 'Forecasting Real SP500 6 steps ahead with ARIMA(0,1,(1,5))log model'; proc print data=convert; run;