Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
0.36 105.43 2.2 0.769 362 11 -0.37 85.27 -9.23 0.417 498 12 23.72 314.56 20.34 0.857 850 11 5.05 87.46 -6.56 0.583 7 20 1.27 195.26 11.9 0.714 589 12 4.91 212.21 13.26 0.769 589 16 12.79 217.77 14.91 0.538 693 15 0.74 130.73 -3.96 0.538 372 14 -11.82 71.85 -12.95 0.333 661 9 7.16 269.85 14.99 0.615 734 12 -10.66 107.35 -8.35 0.417 436 18 13.08 209.47 14.97 0.846 571 17 6.03 167.70 10.58 0.857 274 16 -1.73 152.65 6.04 0.538 651 9 8.09 117.22 -6.66 0.571 523 14 7.51 155.51 4.38 0.615 546 14 -5.4 90.35 -9.34 0.455 98 11 9.54 192.45 2.55 0.417 647 17 -18.85 143.11 1.98 0.692 127 9 0.59 109.68 -5.84 0.538 596 12 1.19 166.67 2.42 0.692 584 12 18.88 253.33 11.63 0.769 689 11 -3.51 163.66 -3.63 0.167 681 16 -5.09 105.27 5.47 0.769 498 13 -3.45 130.23 -15.72 0.167 85 14 2.94 163.24 6.64 0.692 483 12 -1.27 137.29 2.35 0.615 423 11 -18.16 95.87 -19.82 0.167 441 13 9.65 268.54 8.12 0.583 691 10 -11.49 128.07 -9.68 0.25 53 12 -8.79 115.78 -6.95 0.333 40 16 13.59 280.66 14.48 0.929 512 11 -12.12 126.88 -5.52 0.429 585 12 8.98 271.65 18.84 0.769 777 12 5.27 76.02 1.89 0.75 9 12 -7.61 71.94 -20.41 0.083 1 17 1.43 170.41 15.92 0.786 711 13 -14.63 115.71 -9.08 0.308 537 13 12.32 153.88 0.85 0.615 404 13 -13.24 86.94 -19.67 0.091 310 13 1.18 168.01 -2.53 0.462 591 14 2.26 179.02 -5.32 0.333 463 12 10.8 176.14 1.37 0.538 613 13 -2.14 162.12 -8.64 0.167 511 15 -15.22 158.13 -6.86 0.25 580 8 1.83 162.17 12.73 0.692 504 12 -11.29 100.31 -13.04 0.182 333 16 -4.09 199.50 1.55 0.417 587 14 15.04 277.45 10.75 0.615 761 15 1.83 125.14 5.46 0.643 535 12 -12.46 121.18 -1.57 0.692 512 11 -16.72 90.79 -9.82 0.333 273 14 6.69 192.63 10.52 0.692 487 9 1.84 155.01 12.55 0.929 423 11 -2.08 191.35 1.58 0.538 630 10 -10.76 87.26 -12.61 0.25 5 19 6.55 129.68 7.22 0.769 450 11 5.69 246.73 8.04 0.462 588 11 -12.02 113.94 -13.99 0.167 670 12 16.34 248.33 1.82 0.417 915 17 15.36 210.28 16.07 0.846 670 13 -2.71 115.63 -3.52 0.5 91 13 2.46 163.59 6.74 0.615 667 13 14.42 237.51 16.8 0.692 645 16 13.59 218.64 15.04 0.769 531 9 0.2 202.67 12.02 0.786 656 13 11.14 95.77 2.19 0.615 681 11 6.56 210.17 10.26 0.692 874 12 -6.26 125.72 -0.38 0.538 404 12 -10.42 108.12 -16.18 0.154 222 11 -6.61 114.78 -7.8 0.333 464 14 -15.79 97.08 -18.48 0.167 431 17 12.73 206.74 0.14 0.462 667 17 5.06 187.36 4.17 0.615 568 14 -20.99 109.12 -11.91 0.333 424 12 1.55 113.85 -1.06 0.786 524 14 7.3 176.89 0.8 0.417 494 13 14.33 263.99 8.56 0.615 882 19 -0.46 109.70 -9.79 0.5 538 15 20.73 289.70 20.44 0.933 863 15 17.84 247.85 10.21 0.615 850 13 8.5 204.71 1.1 0.538 555 16 -15.4 95.63 -6.1 0.5 6 13 11.05 238.13 22.22 0.867 629 12 -7.66 177.93 -1.42 0.417 525 11 6.46 214.23 2.46 0.538 849 15 6.32 189.69 2.74 0.462 696 15 -5.92 166.41 -6.33 0.25 596 15 -11.63 119.08 -0.28 0.615 461 10 -3.57 185.25 3.19 0.615 643 10 6.26 148.86 -2.1 0.538 285 14 -4.98 119.51 -9.49 0.25 470 15 -11.31 103.15 -7.63 0.462 14 5 -2.18 236.28 6.7 0.538 584 12 5.88 176.61 -10.9 0.333 90 12 11.53 274.79 14.39 0.692 805 14 -12.22 141.73 -18.17 0.083 475 15 2.13 135.65 -10.91 0.25 555 13 18.81 229.36 12.42 0.615 616 13 -1.51 164.01 -4.84 0.25 709 11 6.45 143.27 -2.23 0.5 437 19 13.94 253.27 8.13 0.538 811 18 1.09 260.72 3.98 0.462 881 13 9.4 265.43 9.96 0.615 709 15 11.39 196.17 18.96 0.923 615 14 -14.24 113.10 -6.43 0.583 17 12 3.04 197.78 -3.56 0.333 544 17 -15.45 80.84 -3.18 0.538 381 12 -14.27 92.73 -8.62 0.333 19 5 10.16 132.36 -1.79 0.692 508 13 -7.26 102.78 -14.67 0.25 86 13 -13.59 126.54 -11.38 0.25 502 15 -4.74 124.34 -15.23 0.167 588 17 8.73 256.97 14.4 0.769 576 18 11.39 181.67 9.84 0.692 644 14 -1.23 115.24 3.63 0.714 514 15 -2.27 191.52 -6.97 0.25 585 18 -0.95 201.67 4.83 0.417 637 10 5.04 219.78 6.71 0.538 712 16 -3.7 159.37 -7.64 0.25 430 16 9.73 217.20 6.52 0.571 695 10 6.55 175.97 -1.54 0.25 510 14 7.59 199.34 8.07 0.538 719 14 9.62 115.28 1.99 0.615 41 16 4.77 128.92 -1.79 0.615 537 16 10.85 185.98 12.7 0.786 663 13 -17.03 98.16 -6.69 0.333 509 10 2.2 83.02 -14.88 0.167 352 15 -9.23 68.33 -9.86 0.417 493 13 20.34 311.91 20.06 0.846 838 12 -0.3 86.84 -15.82 0.167 80 14 11.9 190.38 12.6 0.615 579 12 13.26 190.27 17.5 0.714 579 10 14.91 218.75 -1.32 0.25 686 15 -3.96 103.08 -1.86 0.615 365 12 -12.95 47.56 -12.36 0.25 657 17 14.99 270.74 18.8 0.857 726 14 -8.35 89.26 2.29 0.769 431 12 14.97 203.11 16.87 0.846 560 9 10.58 164.82 3.88 0.615 262 14 6.04 156.13 1.28 0.538 644 10 -6.66 98.96 4.89 0.714 515 13 4.38 150.20 10.23 0.615 538 13 -9.34 72.56 -1.48 0.615 93 10 2.55 204.97 -8.58 0.083 642 14 1.98 143.22 8.42 0.923 118 15 -5.84 89.13 -11.97 0.5 589 19 2.42 167.71 0.41 0.692 575 13 11.63 251.31 14.98 0.846 679 12 -3.63 160.06 -1.99 0.333 679 15 5.47 109.84 -0.23 0.571 488 13 -15.72 127.69 -11.97 0.25 83 14 6.64 156.61 7.86 0.714 474 14 2.35 140.09 4.3 0.769 415 9 -19.82 77.36 -22.84 0.167 439 15 8.12 276.42 4.67 0.333 684 14 -9.68 103.32 -3.53 0.5 50 10 -6.95 99.52 -23.53 0.083 36 18 14.48 283.34 23.36 1 499 13 -5.52 96.32 5.04 0.846 579 13 18.84 270.99 12.82 0.615 767 15 -20.41 48.64 -20.2 0 0 10 15.92 167.69 7.21 0.538 700 11 -9.08 102.86 -11.13 0.083 533 13 0.85 155.24 4.93 0.615 396 17 -19.67 67.11 -19.3 0.083 309 15 -2.53 168.34 -3.86 0.333 585 16 -5.32 174.54 4.41 0.417 459 18 1.37 186.17 7.31 0.615 606 13 -8.64 159.59 -3.57 0.25 509 16 -6.86 164.99 -8.58 0.25 577 16 12.73 159.79 10.01 0.615 495 10 -13.04 73.01 -9.6 0.333 331 14 1.55 197.10 -3.51 0.167 582 16 10.75 275.37 14.59 0.769 753 12 5.46 93.69 -15.66 0.333 526 13 -1.57 107.49 -2.01 0.692 503 17 -9.82 66.96 -6.81 0.5 269 13 10.52 194.42 9.99 0.923 478 13 12.55 155.70 3.07 0.714 410 13 1.58 186.49 0.64 0.538 623 17 -12.61 57.22 -20.4 0.083 2 12 7.22 123.34 -7.41 0.25 440 17 8.04 242.36 6.59 0.692 582 13 -13.99 82.18 -23.48 0 668 15 1.82 252.35 5.53 0.538 910 15 16.07 204.42 14.74 0.929 659 11 -3.52 93.72 -3.71 0.615 85 11 6.74 161.75 5.27 0.615 659 14 16.8 232.98 10.42 0.615 636 15 15.04 207.30 7.72 0.538 521 16 12.02 187.78 19.97 0.857 645 9 2.19 72.99 4.26 0.692 673 15 10.26 218.53 5.22 0.692 865 11 -0.38 97.73 -3.6 0.333 397 18 -16.18 85.04 -3.9 0.538 220 15 -7.8 97.62 -14.1 0.25 460 14 -18.48 74.57 -19.36 0.167 429 11 0.14 211.04 6.22 0.538 661 15 4.17 169.67 -5.66 0.25 560 15 -11.91 83.29 3.05 0.692 420 9 -1.06 89.14 3.56 0.857 513 15 0.8 170.72 1.2 0.417 489 17 8.56 264.70 9.5 0.692 874 11 -9.79 81.07 -5.77 0.538 532 11 20.44 289.77 15.65 0.857 849 12 10.21 249.34 13.19 0.846 842 14 1.1 210.07 16.83 0.769 548 9 22.22 241.14 21.27 0.846 616 15 -1.42 179.88 8.11 0.538 520 14 2.46 202.03 3.4 0.583 842 15 2.74 181.17 3.72 0.538 690 14 -6.33 157.63 -12.43 0.083 593 13 -0.28 94.00 0.15 0.714 453 12 3.19 193.96 -5.68 0.462 634 16 -2.1 137.42 -4.68 0.615 278 11 -9.49 79.51 -3.28 0.5 467 14 -7.63 76.29 -2.44 0.5 8 14 6.7 238.05 16.06 0.846 577 14 -10.9 171.42 -13.56 0.167 86 14 14.39 269.46 13.72 0.714 796 14 -18.17 141.93 -7.44 0.417 474 14 -10.91 117.37 -21.13 0.083 552 15 12.42 229.70 18.96 0.786 608 11 -4.84 161.16 2.81 0.538 706 15 -2.23 131.09 -10.3 0.167 431 13 8.13 245.30 4.29 0.417 804 10 3.98 263.66 7.45 0.615 875 13 9.96 246.79 13.38 0.692 701 15 18.96 201.16 1.94 0.333 603 15 -6.43 84.70 -10.53 0.5 10 11 -3.56 205.61 5.32 0.615 540 12 -3.18 63.51 -18.17 0.167 374 16 -8.62 62.59 -3.01 0.583 15 19 -1.79 131.37 -0.03 0.583 499 16 -14.67 80.17 -5.33 0.5 83 10 -11.38 122.07 -3.22 0.538 499 13 -15.23 124.11 -11.77 0.25 586 16 14.4 232.51 17.1 0.769 566 16 9.84 181.38 6.96 0.417 635 11 3.63 79.77 6.7 0.643 504 7 -6.97 186.64 8.01 0.692 582 10 4.83 212.04 -4.94 0.167 632 15 6.71 214.32 6.41 0.615 705 12 -7.64 151.13 0 0.333 427 10 6.52 218.21 15.12 0.692 687 12 -1.54 164.89 5.09 0.462 507 14 8.07 191.19 -3.74 0.333 712 14 1.99 102.85 -0.52 0.667 33 11 -1.79 115.25 -19.16 0.083 529 12 12.7 184.54 14.2 0.692 652 9 -6.69 75.90 -9.36 0.417 505 16 -14.88 64.56 -7.35 0.462 350 12 -9.86 73.21 -15.31 0.083 488 14 20.06 302.35 24.51 0.929 827 13 -15.82 95.16 -11.66 0.25 78 12 12.6 182.14 9.38 0.615 571 17 17.5 183.88 9 0.615 569 14 -1.32 212.88 2.4 0.333 683 11 -1.86 106.70 4.94 0.769 357 12 -12.36 51.07 -14.23 0.167 654 17 18.8 270.00 -0.92 0.25 714 15 2.29 93.67 -1.6 0.692 421 14 16.87 197.19 11.22 0.615 549 13 3.88 151.05 7.85 0.846 254 13 1.28 157.62 -6.74 0.167 637 14 4.89 106.16 -0.27 0.615 505 19 10.23 161.53 8.77 0.615 530 14 -1.48 72.98 -8.78 0.333 85 16 -8.58 217.44 -0.65 0.25 641 9 8.42 145.14 6.65 0.714 106 11 -11.97 95.55 -7.91 0.538 583 14 0.41 170.14 8.71 0.769 566 14 14.98 243.53 14.75 0.846 668 13 -1.99 165.56 -12.66 0.083 675 17 -0.23 115.01 -12.54 0.333 480 16 -11.97 138.08 -5.35 0.417 80 13 7.86 154.00 -0.28 0.462 464 14 4.3 138.09 -4.23 0.615 405 15 -22.84 81.63 -16.61 0.167 437 13 4.67 290.40 17.35 0.846 680 11 -3.53 89.91 -9.83 0.25 44 12 -23.53 106.75 -9.1 0.25 35 8 23.36 277.99 13.56 0.857 485 10 5.04 102.97 6.33 0.692 568 13 12.82 265.42 17.93 0.857 759 13 7.21 172.40 5.18 0.5 693 16 -11.13 108.80 -13.75 0.25 532 18 4.93 160.76 -5.54 0.417 388 14 -19.3 81.68 -17.38 0.083 308 11 -3.86 171.91 -10.35 0.167 581 12 4.41 167.56 -5.53 0.333 454 19 7.31 192.48 -2.62 0.333 598 14 -3.57 157.46 5.4 0.462 506 9 -8.58 162.69 -6.7 0.083 574 11 10.01 152.84 16.92 0.846 487 8 -9.6 85.36 2.75 0.786 327 11 -3.51 185.47 -5.29 0.167 580 13 14.59 266.47 14.76 0.769 743 13 -15.66 95.75 6.33 0.75 522 6 -2.01 103.02 3.45 0.692 494 13 -6.81 66.77 -0.03 0.615 263 17 9.99 194.64 5.88 0.846 466 15 3.07 151.05 -6.04 0.417 400 15 0.64 187.41 -6.59 0.333 616 12 -20.4 34.67 -20.97 0.083 1 9 -7.41 131.23 -11.09 0.333 437 13 6.59 238.91 4.07 0.583 573 19 -23.48 91.94 -11.7 0.333 668 13 5.53 251.99 10.01 0.615 903 12 14.74 205.17 6.21 0.538 646 15 -3.71 85.67 -2.45 0.667 77 17 5.27 161.06 -3.25 0.462 651 16 10.42 227.24 8.43 0.538 628 18 7.72 208.26 6.15 0.615 514 13 19.97 193.73 5.54 0.417 633 12 4.26 58.43 -1.76 0.615 664 11 5.22 221.86 9.79 0.714 856 13 -3.6 98.29 -3.6 0.538 393 11 -3.9 93.79 -14.57 0.154 213 18 -14.1 105.73 -9.91 0.308 457 11 -19.36 82.84 -19 0.083 427 14 6.22 212.09 4.52 0.667 654 15 -5.66 168.92 1.46 0.538 557 11 3.05 77.61 -8.41 0.333 411 16 3.56 90.76 4.64 0.857 501 12 1.2 165.57 8.97 0.769 484 15 9.5 257.70 16.98 0.923 865 14 -5.77 78.80 -2.75 0.692 525 11 15.65 274.16 13.81 1 837 13 13.19 257.67 14.32 0.769 831 11 16.83 207.19 13.5 0.615 538 14 21.27 243.87 23.43 0.923 605 15 8.11 180.64 12.14 0.692 513 15 3.4 208.73 9.7 0.667 835 13 3.72 186.34 2.05 0.462 683 14 -12.43 161.66 -1.58 0.462 592 13 0.15 95.74 -3.52 0.538 443 17 -5.68 194.09 3.91 0.692 628 10 -4.68 138.05 2.69 0.692 270 16 -3.28 80.57 7.9 0.846 461 13 -2.44 51.83 -15.26 0.154 2 17 16.06 231.51 15.97 0.846 566 12 -13.56 166.49 -6.13 0.25 84 10 13.72 276.71 10.53 0.538 786 15 -7.44 147.73 1.64 0.538 469 9 -21.13 127.29 -18.04 0 551 13 18.96 220.73 15.58 0.857 597 15 2.81 156.99 6.27 0.615 699 13 -10.3 124.55 -7.52 0.364 429 15 4.29 242.29 4.07 0.417 799 13 7.45 281.36 11.18 0.692 867 19 13.38 234.04 20.05 0.846 692 10 1.94 196.76 7.49 0.538 599 15 -10.53 57.30 -8.03 0.333 4 13 5.32 207.36 6.33 0.615 532 13 -18.17 74.34 -9.29 0.25 372 11 -3.01 42.15 -7.49 0.667 8 19 -0.03 133.65 -0.18 0.692 492 13 -5.33 92.60 -3.45 0.417 77 7 -3.22 122.71 -14.23 0.167 492 17 -11.77 128.95 6.24 0.786 583 10 17.1 238.17 8.75 0.643 556 13 6.96 187.85 2.51 0.417 630 13 6.7 82.73 10.71 0.846 495 15 8.01 183.71 9.88 0.692 573 13 -4.94 201.56 -3.84 0.333 630 14 6.41 211.02 3.13 0.538 697 13 0 151.10 -6.2 0.417 423 16 15.12 226.46 4.9 0.538 678 17 5.09 164.06 -6.89 0.25 501 15 -3.74 193.76 4.03 0.538 708 9 -0.52 99.43 -1.5 0.538 25 13 -19.16 107.94 -9.54 0.333 528 10 14.2 179.45 9.77 0.571 643 15 -9.36 86.16 -10.78 0.333 500 14
Names of X columns:
SRS 4yrrec lySRS lyW% AllTmW RetSt
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Do not include Seasonal Dummies
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
No Linear Trend
No Linear Trend
Linear Trend
First Differences
Seasonal Differences (s)
First and Seasonal Differences (s)
Degree of Predetermination (lagged endogenous variables)
Degree of Seasonal Predetermination
Seasonality
12
1
2
3
4
5
6
7
8
9
10
11
12
Chart options
R Code
par5 <- '0' par4 <- '0' par3 <- 'No Linear Trend' par2 <- 'Do not include Seasonal Dummies' par1 <- '1' library(lattice) library(lmtest) n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test mywarning <- '' par1 <- as.numeric(par1) if(is.na(par1)) { par1 <- 1 mywarning = 'Warning: you did not specify the column number of the endogenous series! The first column was selected by default.' } if (par4=='') par4 <- 0 par4 <- as.numeric(par4) if (par5=='') par5 <- 0 par5 <- as.numeric(par5) x <- na.omit(t(y)) k <- length(x[1,]) n <- length(x[,1]) x1 <- cbind(x[,par1], x[,1:k!=par1]) mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) colnames(x1) <- mycolnames #colnames(x)[par1] x <- x1 if (par3 == 'First Differences'){ (n <- n -1) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+1,j] - x[i,j] } } x <- x2 } if (par3 == 'Seasonal Differences (s=12)'){ (n <- n - 12) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B12)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+12,j] - x[i,j] } } x <- x2 } if (par3 == 'First and Seasonal Differences (s=12)'){ (n <- n -1) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+1,j] - x[i,j] } } x <- x2 (n <- n - 12) x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B12)',colnames(x),sep=''))) for (i in 1:n) { for (j in 1:k) { x2[i,j] <- x[i+12,j] - x[i,j] } } x <- x2 } if(par4 > 0) { x2 <- array(0, dim=c(n-par4,par4), dimnames=list(1:(n-par4), paste(colnames(x)[par1],'(t-',1:par4,')',sep=''))) for (i in 1:(n-par4)) { for (j in 1:par4) { x2[i,j] <- x[i+par4-j,par1] } } x <- cbind(x[(par4+1):n,], x2) n <- n - par4 } if(par5 > 0) { x2 <- array(0, dim=c(n-par5*12,par5), dimnames=list(1:(n-par5*12), paste(colnames(x)[par1],'(t-',1:par5,'s)',sep=''))) for (i in 1:(n-par5*12)) { for (j in 1:par5) { x2[i,j] <- x[i+par5*12-j*12,par1] } } x <- cbind(x[(par5*12+1):n,], x2) n <- n - par5*12 } if (par2 == 'Include Monthly Dummies'){ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) for (i in 1:11){ x2[seq(i,n,12),i] <- 1 } x <- cbind(x, x2) } if (par2 == 'Include Quarterly Dummies'){ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) for (i in 1:3){ x2[seq(i,n,4),i] <- 1 } x <- cbind(x, x2) } (k <- length(x[n,])) if (par3 == 'Linear Trend'){ x <- cbind(x, c(1:n)) colnames(x)[k+1] <- 't' } x (k <- length(x[n,])) head(x) df <- as.data.frame(x) (mylm <- lm(df)) (mysum <- summary(mylm)) if (n > n25) { kp3 <- k + 3 nmkm3 <- n - k - 3 gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) numgqtests <- 0 numsignificant1 <- 0 numsignificant5 <- 0 numsignificant10 <- 0 for (mypoint in kp3:nmkm3) { j <- 0 numgqtests <- numgqtests + 1 for (myalt in c('greater', 'two.sided', 'less')) { j <- j + 1 gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value } if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 } gqarr } bitmap(file='test0.png') plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') points(x[,1]-mysum$resid) grid() dev.off() bitmap(file='test1.png') plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') grid() dev.off() bitmap(file='test2.png') hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') grid() dev.off() bitmap(file='test3.png') densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test4.png') qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') qqline(mysum$resid) grid() dev.off() (myerror <- as.ts(mysum$resid)) bitmap(file='test5.png') dum <- cbind(lag(myerror,k=1),myerror) dum dum1 <- dum[2:length(myerror),] dum1 z <- as.data.frame(dum1) z plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') lines(lowess(z)) abline(lm(z)) grid() dev.off() bitmap(file='test6.png') acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') grid() dev.off() bitmap(file='test7.png') pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') grid() dev.off() bitmap(file='test8.png') opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(mylm, las = 1, sub='Residual Diagnostics') par(opar) dev.off() if (n > n25) { bitmap(file='test9.png') plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') grid() dev.off() } load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) a<-table.row.end(a) myeq <- colnames(x)[1] myeq <- paste(myeq, '[t] = ', sep='') for (i in 1:k){ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') myeq <- paste(myeq, signif(mysum$coefficients[i,1],6), sep=' ') if (rownames(mysum$coefficients)[i] != '(Intercept)') { myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') } } myeq <- paste(myeq, ' + e[t]') a<-table.row.start(a) a<-table.element(a, myeq) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, mywarning) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable1.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Variable',header=TRUE) a<-table.element(a,'Parameter',header=TRUE) a<-table.element(a,'S.D.',header=TRUE) a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE) a<-table.element(a,'2-tail p-value',header=TRUE) a<-table.element(a,'1-tail p-value',header=TRUE) a<-table.row.end(a) for (i in 1:k){ a<-table.row.start(a) a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) a<-table.element(a,formatC(signif(mysum$coefficients[i,1],5),format='g',flag='+')) a<-table.element(a,formatC(signif(mysum$coefficients[i,2],5),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$coefficients[i,3],4),format='e',flag='+')) a<-table.element(a,formatC(signif(mysum$coefficients[i,4],4),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$coefficients[i,4]/2,4),format='g',flag=' ')) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable2.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Multiple R',1,TRUE) a<-table.element(a,formatC(signif(sqrt(mysum$r.squared),6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a,formatC(signif(mysum$r.squared,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a,formatC(signif(mysum$adj.r.squared,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a,formatC(signif(mysum$fstatistic[1],6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[2],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[3],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'p-value',1,TRUE) a<-table.element(a,formatC(signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Residual Standard Deviation',1,TRUE) a<-table.element(a,formatC(signif(mysum$sigma,6),format='g',flag=' ')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a,formatC(signif(sum(myerror*myerror),6),format='g',flag=' ')) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable3.tab') if(n < 200) { a<-table.start() a<-table.row.start(a) a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Time or Index', 1, TRUE) a<-table.element(a, 'Actuals', 1, TRUE) a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE) a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE) a<-table.row.end(a) for (i in 1:n) { a<-table.row.start(a) a<-table.element(a,i, 1, TRUE) a<-table.element(a,formatC(signif(x[i],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(x[i]-mysum$resid[i],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(mysum$resid[i],6),format='g',flag=' ')) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable4.tab') if (n > n25) { a<-table.start() a<-table.row.start(a) a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'p-values',header=TRUE) a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'breakpoint index',header=TRUE) a<-table.element(a,'greater',header=TRUE) a<-table.element(a,'2-sided',header=TRUE) a<-table.element(a,'less',header=TRUE) a<-table.row.end(a) for (mypoint in kp3:nmkm3) { a<-table.row.start(a) a<-table.element(a,mypoint,header=TRUE) a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,1],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,2],6),format='g',flag=' ')) a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,3],6),format='g',flag=' ')) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable5.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Description',header=TRUE) a<-table.element(a,'# significant tests',header=TRUE) a<-table.element(a,'% significant tests',header=TRUE) a<-table.element(a,'OK/NOK',header=TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'1% type I error level',header=TRUE) a<-table.element(a,signif(numsignificant1,6)) a<-table.element(a,formatC(signif(numsignificant1/numgqtests,6),format='g',flag=' ')) if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'5% type I error level',header=TRUE) a<-table.element(a,signif(numsignificant5,6)) a<-table.element(a,signif(numsignificant5/numgqtests,6)) if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'10% type I error level',header=TRUE) a<-table.element(a,signif(numsignificant10,6)) a<-table.element(a,signif(numsignificant10/numgqtests,6)) if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' a<-table.element(a,dum) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable6.tab') } }
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation