R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(14915 + ,3440 + ,813 + ,5126 + ,2563 + ,11773 + ,3054 + ,647 + ,4127 + ,1505 + ,11608 + ,3203 + ,630 + ,4232 + ,1145 + ,11468 + ,3148 + ,662 + ,4167 + ,1082 + ,11511 + ,3181 + ,653 + ,4058 + ,1135 + ,11200 + ,3211 + ,660 + ,3802 + ,1109 + ,11164 + ,3306 + ,632 + ,3907 + ,932 + ,10960 + ,3252 + ,673 + ,3708 + ,957 + ,10667 + ,3218 + ,627 + ,3724 + ,806 + ,11556 + ,3418 + ,641 + ,4025 + ,1107 + ,11372 + ,3188 + ,660 + ,4051 + ,1081 + ,12333 + ,3186 + ,723 + ,4264 + ,1255 + ,13102 + ,3360 + ,797 + ,4533 + ,1507 + ,11115 + ,2944 + ,680 + ,3827 + ,1205 + ,12572 + ,3522 + ,752 + ,4316 + ,1305 + ,11557 + ,3121 + ,724 + ,4091 + ,1089 + ,12059 + ,3305 + ,799 + ,4175 + ,1164 + ,11420 + ,3283 + ,778 + ,3822 + ,988 + ,11185 + ,3139 + ,789 + ,3610 + ,1000 + ,11113 + ,3315 + ,688 + ,3478 + ,1023 + ,10706 + ,3163 + ,623 + ,3526 + ,878 + ,11523 + ,3318 + ,683 + ,3887 + ,1032 + ,11391 + ,3208 + ,694 + ,3912 + ,994 + ,12634 + ,3335 + ,742 + ,4466 + ,1193 + ,13469 + ,3393 + ,966 + ,4553 + ,1503 + ,11735 + ,3118 + ,779 + ,3992 + ,1251 + ,13281 + ,3379 + ,854 + ,4535 + ,1694 + ,11968 + ,3245 + ,808 + ,4113 + ,1273 + ,11623 + ,3326 + ,783 + ,3982 + ,984 + ,11084 + ,3318 + ,815 + ,3587 + ,943 + ,11509 + ,3380 + ,811 + ,3792 + ,936 + ,11134 + ,3283 + ,912 + ,3546 + ,962 + ,10438 + ,3174 + ,717 + ,3444 + ,717 + ,11530 + ,3348 + ,787 + ,4001 + ,898 + ,11491 + ,3306 + ,775 + ,3928 + ,963 + ,13093 + ,3407 + ,961 + ,4519 + ,1387 + ,13106 + ,3373 + ,952 + ,4502 + ,1442 + ,11305 + ,3055 + ,778 + ,3891 + ,1197 + ,13113 + ,3382 + ,928 + ,4522 + ,1536 + ,12203 + ,3344 + ,811 + ,4113 + ,1308 + ,11309 + ,3315 + ,811 + ,3769 + ,1047 + ,11088 + ,3276 + ,844 + ,3538 + ,975 + ,11234 + ,3386 + ,829 + ,3504 + ,975 + ,11619 + ,3304 + ,972 + ,3599 + ,1092 + ,10942 + ,3301 + ,791 + ,3572 + ,887 + ,11445 + ,3357 + ,782 + ,3816 + ,972 + ,11291 + ,3289 + ,828 + ,3716 + ,1066 + ,13281 + ,3485 + ,912 + ,4400 + ,1745 + ,13726 + ,3489 + ,990 + ,4498 + ,1930 + ,11300 + ,3189 + ,755 + ,3859 + ,1108 + ,11983 + ,3455 + ,840 + ,4006 + ,1167 + ,11092 + ,3295 + ,781 + ,3648 + ,1024 + ,11093 + ,3335 + ,828 + ,3691 + ,918 + ,10692 + ,3329 + ,795 + ,3481 + ,894 + ,10786 + ,3382 + ,838 + ,3326 + ,899 + ,11166 + ,3395 + ,944 + ,3376 + ,1013 + ,10553 + ,3345 + ,739 + ,3436 + ,770 + ,11103 + ,3374 + ,789 + ,3651 + ,902 + ,10969 + ,3270 + ,803 + ,3629 + ,937 + ,12090 + ,3442 + ,859 + ,4037 + ,1193 + ,12544 + ,3448 + ,927 + ,4095 + ,1493 + ,12264 + ,3216 + ,860 + ,3891 + ,1827 + ,13783 + ,3542 + ,1052 + ,4476 + ,2034 + ,11214 + ,3361 + ,744 + ,3568 + ,1273 + ,11453 + ,3425 + ,778 + ,3681 + ,1153 + ,10883 + ,3383 + ,843 + ,3299 + ,1083 + ,10381 + ,3285 + ,779 + ,3156 + ,907 + ,10348 + ,3435 + ,760 + ,3186 + ,694 + ,10024 + ,3254 + ,743 + ,3012 + ,803 + ,10805 + ,3337 + ,838 + ,3436 + ,876 + ,10796 + ,3296 + ,749 + ,3587 + ,975 + ,11907 + ,3391 + ,918 + ,3963 + ,1197 + ,12261 + ,3508 + ,907 + ,3906 + ,1356 + ,11377 + ,3091 + ,873 + ,3700 + ,1366 + ,12689 + ,3451 + ,968 + ,4115 + ,1532 + ,11474 + ,3315 + ,957 + ,3590 + ,1262 + ,10992 + ,3368 + ,866 + ,3341 + ,1073 + ,10764 + ,3412 + ,887 + ,3199 + ,1029 + ,12164 + ,3521 + ,1255 + ,3407 + ,1294 + ,10409 + ,3302 + ,832 + ,3081 + ,824 + ,10398 + ,3278 + ,887 + ,3050 + ,919 + ,10349 + ,3425 + ,776 + ,3155 + ,899 + ,10865 + ,3384 + ,784 + ,3445 + ,987 + ,11630 + ,3508 + ,834 + ,3731 + ,1190 + ,12221 + ,3609 + ,902 + ,3803 + ,1445 + ,10884 + ,3211 + ,759 + ,3471 + ,1277 + ,12019 + ,3418 + ,877 + ,3840 + ,1393 + ,11021 + ,3306 + ,901 + ,3396 + ,1179 + ,10799 + ,3313 + ,851 + ,3270 + ,1117 + ,10423 + ,3362 + ,829 + ,3106 + ,997 + ,10484 + ,3413 + ,825 + ,3050 + ,950 + ,10450 + ,3479 + ,887 + ,3035 + ,817 + ,9906 + ,3213 + ,787 + ,2992 + ,811 + ,11049 + ,3465 + ,832 + ,3430 + ,1003 + ,11281 + ,3476 + ,838 + ,3541 + ,1124 + ,12485 + ,3629 + ,996 + ,3915 + ,1423 + ,12849 + ,3665 + ,1080 + ,3873 + ,1562 + ,11380 + ,3420 + ,931 + ,3490 + ,1246 + ,12079 + ,3611 + ,987 + ,3677 + ,1317 + ,11366 + ,3341 + ,953 + ,3491 + ,1257 + ,11328 + ,3511 + ,989 + ,3308 + ,1139 + ,10444 + ,3407 + ,907 + ,3031 + ,922 + ,10854 + ,3523 + ,898 + ,3044 + ,1044 + ,10434 + ,3472 + ,877 + ,2933 + ,903 + ,10137 + ,3385 + ,893 + ,2941 + ,820 + ,10992 + ,3546 + ,851 + ,3355 + ,1010 + ,10906 + ,3443 + ,912 + ,3259 + ,1069 + ,12367 + ,3550 + ,1062 + ,3727 + ,1500 + ,14371 + ,3795 + ,1252 + ,4201 + ,2293 + ,11695 + ,3268 + ,1013 + ,3406 + ,1616 + ,11546 + ,3560 + ,912 + ,3519 + ,1229 + ,10922 + ,3488 + ,877 + ,3243 + ,1127 + ,10670 + ,3436 + ,926 + ,3095 + ,1031 + ,10254 + ,3440 + ,925 + ,2822 + ,916 + ,10573 + ,3502 + ,950 + ,2997 + ,900 + ,10239 + ,3509 + ,990 + ,2758 + ,826 + ,10253 + ,3494 + ,861 + ,2932 + ,797 + ,11176 + ,3782 + ,937 + ,3181 + ,1054 + ,10719 + ,3430 + ,906 + ,3128 + ,1050 + ,11817 + ,3692 + ,1017 + ,3615 + ,1123 + ,12487 + ,3760 + ,1107 + ,3700 + ,1398 + ,11519 + ,3370 + ,1000 + ,3477 + ,1356 + ,12025 + ,3755 + ,1068 + ,3512 + ,1208 + ,10976 + ,3515 + ,885 + ,3231 + ,983 + ,11276 + ,3560 + ,1042 + ,3143 + ,1062 + ,10657 + ,3607 + ,974 + ,2954 + ,925 + ,11141 + ,3635 + ,1136 + ,2954 + ,1029 + ,10423 + ,3628 + ,968 + ,2834 + ,808 + ,10640 + ,3552 + ,957 + ,2941 + ,936 + ,11426 + ,3742 + ,1019 + ,3281 + ,1097 + ,10948 + ,3551 + ,954 + ,3196 + ,1007 + ,12540 + ,3841 + ,1211 + ,3786 + ,1207 + ,12200 + ,3675 + ,1133 + ,3602 + ,1339 + ,10644 + ,3367 + ,954 + ,3066 + ,1101 + ,12044 + ,3736 + ,1050 + ,3484 + ,1275 + ,11338 + ,3632 + ,1024 + ,3194 + ,1243 + ,11292 + ,3668 + ,1025 + ,3162 + ,1147 + ,10612 + ,3543 + ,985 + ,2865 + ,1032 + ,10995 + ,3773 + ,1076 + ,2960 + ,936 + ,10686 + ,3653 + ,1051 + ,2909 + ,915 + ,10635 + ,3662 + ,1041 + ,2864 + ,864 + ,11285 + ,3745 + ,1041 + ,3204 + ,995 + ,11475 + ,3761 + ,1084 + ,3188 + ,1109 + ,12535 + ,3823 + ,1204 + ,3634 + ,1361) + ,dim=c(5 + ,144) + ,dimnames=list(c('Y_t' + ,'X_1t' + ,'X_2t' + ,'X_3t' + ,'X_4t') + ,1:144)) > y <- array(NA,dim=c(5,144),dimnames=list(c('Y_t','X_1t','X_2t','X_3t','X_4t'),1:144)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- 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'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > 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[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y_t X_1t X_2t X_3t X_4t 1 14915 3440 813 5126 2563 2 11773 3054 647 4127 1505 3 11608 3203 630 4232 1145 4 11468 3148 662 4167 1082 5 11511 3181 653 4058 1135 6 11200 3211 660 3802 1109 7 11164 3306 632 3907 932 8 10960 3252 673 3708 957 9 10667 3218 627 3724 806 10 11556 3418 641 4025 1107 11 11372 3188 660 4051 1081 12 12333 3186 723 4264 1255 13 13102 3360 797 4533 1507 14 11115 2944 680 3827 1205 15 12572 3522 752 4316 1305 16 11557 3121 724 4091 1089 17 12059 3305 799 4175 1164 18 11420 3283 778 3822 988 19 11185 3139 789 3610 1000 20 11113 3315 688 3478 1023 21 10706 3163 623 3526 878 22 11523 3318 683 3887 1032 23 11391 3208 694 3912 994 24 12634 3335 742 4466 1193 25 13469 3393 966 4553 1503 26 11735 3118 779 3992 1251 27 13281 3379 854 4535 1694 28 11968 3245 808 4113 1273 29 11623 3326 783 3982 984 30 11084 3318 815 3587 943 31 11509 3380 811 3792 936 32 11134 3283 912 3546 962 33 10438 3174 717 3444 717 34 11530 3348 787 4001 898 35 11491 3306 775 3928 963 36 13093 3407 961 4519 1387 37 13106 3373 952 4502 1442 38 11305 3055 778 3891 1197 39 13113 3382 928 4522 1536 40 12203 3344 811 4113 1308 41 11309 3315 811 3769 1047 42 11088 3276 844 3538 975 43 11234 3386 829 3504 975 44 11619 3304 972 3599 1092 45 10942 3301 791 3572 887 46 11445 3357 782 3816 972 47 11291 3289 828 3716 1066 48 13281 3485 912 4400 1745 49 13726 3489 990 4498 1930 50 11300 3189 755 3859 1108 51 11983 3455 840 4006 1167 52 11092 3295 781 3648 1024 53 11093 3335 828 3691 918 54 10692 3329 795 3481 894 55 10786 3382 838 3326 899 56 11166 3395 944 3376 1013 57 10553 3345 739 3436 770 58 11103 3374 789 3651 902 59 10969 3270 803 3629 937 60 12090 3442 859 4037 1193 61 12544 3448 927 4095 1493 62 12264 3216 860 3891 1827 63 13783 3542 1052 4476 2034 64 11214 3361 744 3568 1273 65 11453 3425 778 3681 1153 66 10883 3383 843 3299 1083 67 10381 3285 779 3156 907 68 10348 3435 760 3186 694 69 10024 3254 743 3012 803 70 10805 3337 838 3436 876 71 10796 3296 749 3587 975 72 11907 3391 918 3963 1197 73 12261 3508 907 3906 1356 74 11377 3091 873 3700 1366 75 12689 3451 968 4115 1532 76 11474 3315 957 3590 1262 77 10992 3368 866 3341 1073 78 10764 3412 887 3199 1029 79 12164 3521 1255 3407 1294 80 10409 3302 832 3081 824 81 10398 3278 887 3050 919 82 10349 3425 776 3155 899 83 10865 3384 784 3445 987 84 11630 3508 834 3731 1190 85 12221 3609 902 3803 1445 86 10884 3211 759 3471 1277 87 12019 3418 877 3840 1393 88 11021 3306 901 3396 1179 89 10799 3313 851 3270 1117 90 10423 3362 829 3106 997 91 10484 3413 825 3050 950 92 10450 3479 887 3035 817 93 9906 3213 787 2992 811 94 11049 3465 832 3430 1003 95 11281 3476 838 3541 1124 96 12485 3629 996 3915 1423 97 12849 3665 1080 3873 1562 98 11380 3420 931 3490 1246 99 12079 3611 987 3677 1317 100 11366 3341 953 3491 1257 101 11328 3511 989 3308 1139 102 10444 3407 907 3031 922 103 10854 3523 898 3044 1044 104 10434 3472 877 2933 903 105 10137 3385 893 2941 820 106 10992 3546 851 3355 1010 107 10906 3443 912 3259 1069 108 12367 3550 1062 3727 1500 109 14371 3795 1252 4201 2293 110 11695 3268 1013 3406 1616 111 11546 3560 912 3519 1229 112 10922 3488 877 3243 1127 113 10670 3436 926 3095 1031 114 10254 3440 925 2822 916 115 10573 3502 950 2997 900 116 10239 3509 990 2758 826 117 10253 3494 861 2932 797 118 11176 3782 937 3181 1054 119 10719 3430 906 3128 1050 120 11817 3692 1017 3615 1123 121 12487 3760 1107 3700 1398 122 11519 3370 1000 3477 1356 123 12025 3755 1068 3512 1208 124 10976 3515 885 3231 983 125 11276 3560 1042 3143 1062 126 10657 3607 974 2954 925 127 11141 3635 1136 2954 1029 128 10423 3628 968 2834 808 129 10640 3552 957 2941 936 130 11426 3742 1019 3281 1097 131 10948 3551 954 3196 1007 132 12540 3841 1211 3786 1207 133 12200 3675 1133 3602 1339 134 10644 3367 954 3066 1101 135 12044 3736 1050 3484 1275 136 11338 3632 1024 3194 1243 137 11292 3668 1025 3162 1147 138 10612 3543 985 2865 1032 139 10995 3773 1076 2960 936 140 10686 3653 1051 2909 915 141 10635 3662 1041 2864 864 142 11285 3745 1041 3204 995 143 11475 3761 1084 3188 1109 144 12535 3823 1204 3634 1361 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X_1t X_2t X_3t X_4t 775.6939 0.9163 1.5623 1.4271 0.9080 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -174.40 -63.05 -8.10 46.35 332.46 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 775.69389 220.74837 3.514 0.000596 *** X_1t 0.91632 0.07337 12.488 < 2e-16 *** X_2t 1.56229 0.11365 13.747 < 2e-16 *** X_3t 1.42712 0.02948 48.412 < 2e-16 *** X_4t 0.90800 0.04934 18.403 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 93.68 on 139 degrees of freedom Multiple R-squared: 0.9892, Adjusted R-squared: 0.9889 F-statistic: 3189 on 4 and 139 DF, p-value: < 2.2e-16 > 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 + } [,1] [,2] [,3] [1,] 0.11457449 2.291490e-01 8.854255e-01 [2,] 0.05151190 1.030238e-01 9.484881e-01 [3,] 0.04175199 8.350398e-02 9.582480e-01 [4,] 0.02179023 4.358046e-02 9.782098e-01 [5,] 0.61745971 7.650806e-01 3.825403e-01 [6,] 0.59601295 8.079741e-01 4.039870e-01 [7,] 0.52580177 9.483965e-01 4.741982e-01 [8,] 0.46073132 9.214626e-01 5.392687e-01 [9,] 0.56171227 8.765755e-01 4.382877e-01 [10,] 0.71912728 5.617454e-01 2.808727e-01 [11,] 0.66271146 6.745771e-01 3.372885e-01 [12,] 0.67992721 6.401456e-01 3.200728e-01 [13,] 0.91934033 1.613193e-01 8.065967e-02 [14,] 0.97700072 4.599856e-02 2.299928e-02 [15,] 0.98299134 3.401732e-02 1.700866e-02 [16,] 0.98260284 3.479431e-02 1.739716e-02 [17,] 0.99799508 4.009845e-03 2.004923e-03 [18,] 0.99895933 2.081337e-03 1.040669e-03 [19,] 0.99886236 2.275282e-03 1.137641e-03 [20,] 0.99898618 2.027648e-03 1.013824e-03 [21,] 0.99966945 6.610911e-04 3.305456e-04 [22,] 0.99964704 7.059176e-04 3.529588e-04 [23,] 0.99985004 2.999213e-04 1.499606e-04 [24,] 0.99984702 3.059629e-04 1.529814e-04 [25,] 0.99995110 9.780904e-05 4.890452e-05 [26,] 0.99993576 1.284785e-04 6.423924e-05 [27,] 0.99992679 1.464158e-04 7.320791e-05 [28,] 0.99989107 2.178559e-04 1.089280e-04 [29,] 0.99986229 2.754151e-04 1.377075e-04 [30,] 0.99981832 3.633699e-04 1.816850e-04 [31,] 0.99989170 2.165987e-04 1.082993e-04 [32,] 0.99988094 2.381299e-04 1.190650e-04 [33,] 0.99985225 2.954984e-04 1.477492e-04 [34,] 0.99991667 1.666640e-04 8.333199e-05 [35,] 0.99989379 2.124247e-04 1.062123e-04 [36,] 0.99995831 8.337232e-05 4.168616e-05 [37,] 0.99998569 2.862751e-05 1.431376e-05 [38,] 0.99998226 3.547269e-05 1.773635e-05 [39,] 0.99998270 3.460305e-05 1.730153e-05 [40,] 0.99998428 3.143914e-05 1.571957e-05 [41,] 0.99998445 3.109883e-05 1.554942e-05 [42,] 0.99998584 2.831233e-05 1.415617e-05 [43,] 0.99998413 3.174629e-05 1.587315e-05 [44,] 0.99998203 3.593816e-05 1.796908e-05 [45,] 0.99997978 4.044114e-05 2.022057e-05 [46,] 0.99998743 2.513456e-05 1.256728e-05 [47,] 0.99999595 8.103767e-06 4.051884e-06 [48,] 0.99999439 1.121732e-05 5.608662e-06 [49,] 0.99999360 1.280354e-05 6.401769e-06 [50,] 0.99999037 1.926136e-05 9.630682e-06 [51,] 0.99998592 2.815074e-05 1.407537e-05 [52,] 0.99998218 3.564305e-05 1.782152e-05 [53,] 0.99997706 4.588951e-05 2.294475e-05 [54,] 0.99997063 5.873560e-05 2.936780e-05 [55,] 0.99995982 8.035708e-05 4.017854e-05 [56,] 0.99996905 6.190280e-05 3.095140e-05 [57,] 0.99995584 8.831271e-05 4.415636e-05 [58,] 0.99994553 1.089431e-04 5.447154e-05 [59,] 0.99991303 1.739314e-04 8.696570e-05 [60,] 0.99989426 2.114895e-04 1.057447e-04 [61,] 0.99990667 1.866554e-04 9.332769e-05 [62,] 0.99992013 1.597343e-04 7.986714e-05 [63,] 0.99988944 2.211280e-04 1.105640e-04 [64,] 0.99993455 1.309077e-04 6.545386e-05 [65,] 0.99994486 1.102769e-04 5.513845e-05 [66,] 0.99995317 9.365382e-05 4.682691e-05 [67,] 0.99994947 1.010560e-04 5.052800e-05 [68,] 0.99992778 1.444340e-04 7.221700e-05 [69,] 0.99992069 1.586207e-04 7.931034e-05 [70,] 0.99989764 2.047105e-04 1.023552e-04 [71,] 0.99983645 3.271056e-04 1.635528e-04 [72,] 0.99995932 8.136872e-05 4.068436e-05 [73,] 0.99999771 4.582506e-06 2.291253e-06 [74,] 0.99999797 4.064618e-06 2.032309e-06 [75,] 0.99999815 3.705089e-06 1.852545e-06 [76,] 0.99999691 6.182610e-06 3.091305e-06 [77,] 0.99999494 1.011925e-05 5.059626e-06 [78,] 0.99999085 1.829249e-05 9.146247e-06 [79,] 0.99999432 1.135551e-05 5.677754e-06 [80,] 0.99999218 1.563820e-05 7.819100e-06 [81,] 0.99999087 1.826896e-05 9.134481e-06 [82,] 0.99998353 3.294010e-05 1.647005e-05 [83,] 0.99997896 4.208456e-05 2.104228e-05 [84,] 0.99997721 4.557156e-05 2.278578e-05 [85,] 0.99996904 6.192632e-05 3.096316e-05 [86,] 0.99994672 1.065549e-04 5.327744e-05 [87,] 0.99992651 1.469768e-04 7.348840e-05 [88,] 0.99987968 2.406337e-04 1.203169e-04 [89,] 0.99980596 3.880787e-04 1.940393e-04 [90,] 0.99988757 2.248637e-04 1.124318e-04 [91,] 0.99985229 2.954291e-04 1.477146e-04 [92,] 0.99980693 3.861357e-04 1.930678e-04 [93,] 0.99969846 6.030810e-04 3.015405e-04 [94,] 0.99963111 7.377897e-04 3.688948e-04 [95,] 0.99938216 1.235685e-03 6.178427e-04 [96,] 0.99980197 3.960570e-04 1.980285e-04 [97,] 0.99987758 2.448378e-04 1.224189e-04 [98,] 0.99982055 3.588924e-04 1.794462e-04 [99,] 0.99969805 6.038948e-04 3.019474e-04 [100,] 0.99953053 9.389378e-04 4.694689e-04 [101,] 0.99928430 1.431402e-03 7.157011e-04 [102,] 0.99918196 1.636085e-03 8.180424e-04 [103,] 0.99876292 2.474152e-03 1.237076e-03 [104,] 0.99794942 4.101154e-03 2.050577e-03 [105,] 0.99727744 5.445127e-03 2.722564e-03 [106,] 0.99617410 7.651804e-03 3.825902e-03 [107,] 0.99370412 1.259177e-02 6.295883e-03 [108,] 0.98986573 2.026854e-02 1.013427e-02 [109,] 0.98415391 3.169218e-02 1.584609e-02 [110,] 0.97580922 4.838155e-02 2.419078e-02 [111,] 0.96831927 6.336146e-02 3.168073e-02 [112,] 0.95441993 9.116015e-02 4.558007e-02 [113,] 0.94803726 1.039255e-01 5.196274e-02 [114,] 0.92739460 1.452108e-01 7.260540e-02 [115,] 0.91702797 1.659441e-01 8.297203e-02 [116,] 0.90025046 1.994991e-01 9.974954e-02 [117,] 0.92818070 1.436386e-01 7.181930e-02 [118,] 0.99285309 1.429383e-02 7.146913e-03 [119,] 0.98642726 2.714548e-02 1.357274e-02 [120,] 0.99751856 4.962876e-03 2.481438e-03 [121,] 0.99504653 9.906942e-03 4.953471e-03 [122,] 0.99745863 5.082731e-03 2.541366e-03 [123,] 0.99763675 4.726505e-03 2.363252e-03 [124,] 0.99405036 1.189928e-02 5.949640e-03 [125,] 0.99099952 1.800096e-02 9.000479e-03 [126,] 0.97712153 4.575694e-02 2.287847e-02 [127,] 0.94753475 1.049305e-01 5.246525e-02 [128,] 0.96610200 6.779600e-02 3.389800e-02 [129,] 0.96595130 6.809739e-02 3.404870e-02 > postscript(file="/var/wessaorg/rcomp/tmp/1i2tx1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/24mhz1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3831e1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/49q8h1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5vrde1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 144 Frequency = 1 1 2 3 4 5 6 74.4286601 -68.1809308 -166.1217475 -155.7509980 -21.4969605 18.0274807 7 8 9 10 11 12 -50.4104886 -7.6866780 -83.3928552 -102.3981511 -118.8255284 283.6153569 13 14 15 16 17 18 164.8566564 23.5930328 49.8160317 -36.7673441 -8.5192432 69.0278383 19 20 21 22 23 24 240.4454540 332.4601343 229.4472651 155.6595864 106.0953973 186.4185360 25 26 27 28 29 30 212.6810212 52.2447980 64.7464146 -69.0911658 0.1078936 19.3845131 31 32 33 34 35 36 107.6188207 -8.8264669 67.7238503 -68.3277234 -4.9351400 -14.4863027 37 38 39 40 41 42 18.0502615 -125.2941289 -59.5957818 38.7265401 -100.7844903 57.4363586 43 44 45 46 47 48 174.5976597 169.5166464 2.7114669 43.0617864 -63.1338403 23.3569256 49 50 51 52 53 54 34.9961139 -90.6686291 -47.5619663 -59.0243079 -133.2229369 -155.6828910 55 56 57 58 59 60 39.2370524 66.8547492 -45.0438631 -26.4174416 -87.3756925 -26.1818845 61 62 63 64 65 66 -39.0874453 -13.9673981 -116.4657937 -51.6185905 23.3146286 -1.0300532 67 68 69 70 71 72 50.6409581 60.4665988 78.2258642 -36.6276060 -174.4013529 -152.6499665 73 74 75 76 77 78 48.3000716 -115.5711179 -24.8444794 -103.6440236 34.9231241 -23.6003747 79 80 81 82 83 84 164.1389829 162.6598464 45.7065084 -96.2656537 -48.9627537 -68.1797354 85 86 87 88 89 90 -10.2553060 -132.8067527 -3.7687642 -108.6844204 -22.8715779 -66.3938746 91 92 93 94 95 96 76.7174989 27.5490077 -49.6674079 -7.2955897 -63.0265487 -51.2980173 97 98 99 100 101 102 82.2095811 -95.9982430 9.1579985 -83.3945276 34.8951519 -33.3530943 103 104 105 106 107 108 155.0863627 101.0643332 -77.2657422 -67.5230306 -71.0104042 -1.6376174 109 110 111 112 113 114 84.5339345 14.0933307 -54.5497865 -71.3945994 -53.9170445 22.0027474 115 116 117 118 119 120 9.9161880 15.2833059 22.5767851 -25.7644253 -32.5201906 -109.2996717 121 122 123 124 125 126 -13.2195591 -100.3074186 31.1088790 93.2435278 160.5844430 -1.1260499 127 128 129 130 131 132 109.6945603 32.4947888 67.3949234 -48.9749900 -47.3846697 -146.2239661 133 134 135 136 137 138 -69.5226385 -82.6085644 74.7635886 -52.3998043 -0.1140466 25.1908913 139 140 141 142 143 144 6.8609880 -61.2726539 5.6315201 -24.5905135 2.8921632 -46.7039504 > postscript(file="/var/wessaorg/rcomp/tmp/62ivm1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 144 Frequency = 1 lag(myerror, k = 1) myerror 0 74.4286601 NA 1 -68.1809308 74.4286601 2 -166.1217475 -68.1809308 3 -155.7509980 -166.1217475 4 -21.4969605 -155.7509980 5 18.0274807 -21.4969605 6 -50.4104886 18.0274807 7 -7.6866780 -50.4104886 8 -83.3928552 -7.6866780 9 -102.3981511 -83.3928552 10 -118.8255284 -102.3981511 11 283.6153569 -118.8255284 12 164.8566564 283.6153569 13 23.5930328 164.8566564 14 49.8160317 23.5930328 15 -36.7673441 49.8160317 16 -8.5192432 -36.7673441 17 69.0278383 -8.5192432 18 240.4454540 69.0278383 19 332.4601343 240.4454540 20 229.4472651 332.4601343 21 155.6595864 229.4472651 22 106.0953973 155.6595864 23 186.4185360 106.0953973 24 212.6810212 186.4185360 25 52.2447980 212.6810212 26 64.7464146 52.2447980 27 -69.0911658 64.7464146 28 0.1078936 -69.0911658 29 19.3845131 0.1078936 30 107.6188207 19.3845131 31 -8.8264669 107.6188207 32 67.7238503 -8.8264669 33 -68.3277234 67.7238503 34 -4.9351400 -68.3277234 35 -14.4863027 -4.9351400 36 18.0502615 -14.4863027 37 -125.2941289 18.0502615 38 -59.5957818 -125.2941289 39 38.7265401 -59.5957818 40 -100.7844903 38.7265401 41 57.4363586 -100.7844903 42 174.5976597 57.4363586 43 169.5166464 174.5976597 44 2.7114669 169.5166464 45 43.0617864 2.7114669 46 -63.1338403 43.0617864 47 23.3569256 -63.1338403 48 34.9961139 23.3569256 49 -90.6686291 34.9961139 50 -47.5619663 -90.6686291 51 -59.0243079 -47.5619663 52 -133.2229369 -59.0243079 53 -155.6828910 -133.2229369 54 39.2370524 -155.6828910 55 66.8547492 39.2370524 56 -45.0438631 66.8547492 57 -26.4174416 -45.0438631 58 -87.3756925 -26.4174416 59 -26.1818845 -87.3756925 60 -39.0874453 -26.1818845 61 -13.9673981 -39.0874453 62 -116.4657937 -13.9673981 63 -51.6185905 -116.4657937 64 23.3146286 -51.6185905 65 -1.0300532 23.3146286 66 50.6409581 -1.0300532 67 60.4665988 50.6409581 68 78.2258642 60.4665988 69 -36.6276060 78.2258642 70 -174.4013529 -36.6276060 71 -152.6499665 -174.4013529 72 48.3000716 -152.6499665 73 -115.5711179 48.3000716 74 -24.8444794 -115.5711179 75 -103.6440236 -24.8444794 76 34.9231241 -103.6440236 77 -23.6003747 34.9231241 78 164.1389829 -23.6003747 79 162.6598464 164.1389829 80 45.7065084 162.6598464 81 -96.2656537 45.7065084 82 -48.9627537 -96.2656537 83 -68.1797354 -48.9627537 84 -10.2553060 -68.1797354 85 -132.8067527 -10.2553060 86 -3.7687642 -132.8067527 87 -108.6844204 -3.7687642 88 -22.8715779 -108.6844204 89 -66.3938746 -22.8715779 90 76.7174989 -66.3938746 91 27.5490077 76.7174989 92 -49.6674079 27.5490077 93 -7.2955897 -49.6674079 94 -63.0265487 -7.2955897 95 -51.2980173 -63.0265487 96 82.2095811 -51.2980173 97 -95.9982430 82.2095811 98 9.1579985 -95.9982430 99 -83.3945276 9.1579985 100 34.8951519 -83.3945276 101 -33.3530943 34.8951519 102 155.0863627 -33.3530943 103 101.0643332 155.0863627 104 -77.2657422 101.0643332 105 -67.5230306 -77.2657422 106 -71.0104042 -67.5230306 107 -1.6376174 -71.0104042 108 84.5339345 -1.6376174 109 14.0933307 84.5339345 110 -54.5497865 14.0933307 111 -71.3945994 -54.5497865 112 -53.9170445 -71.3945994 113 22.0027474 -53.9170445 114 9.9161880 22.0027474 115 15.2833059 9.9161880 116 22.5767851 15.2833059 117 -25.7644253 22.5767851 118 -32.5201906 -25.7644253 119 -109.2996717 -32.5201906 120 -13.2195591 -109.2996717 121 -100.3074186 -13.2195591 122 31.1088790 -100.3074186 123 93.2435278 31.1088790 124 160.5844430 93.2435278 125 -1.1260499 160.5844430 126 109.6945603 -1.1260499 127 32.4947888 109.6945603 128 67.3949234 32.4947888 129 -48.9749900 67.3949234 130 -47.3846697 -48.9749900 131 -146.2239661 -47.3846697 132 -69.5226385 -146.2239661 133 -82.6085644 -69.5226385 134 74.7635886 -82.6085644 135 -52.3998043 74.7635886 136 -0.1140466 -52.3998043 137 25.1908913 -0.1140466 138 6.8609880 25.1908913 139 -61.2726539 6.8609880 140 5.6315201 -61.2726539 141 -24.5905135 5.6315201 142 2.8921632 -24.5905135 143 -46.7039504 2.8921632 144 NA -46.7039504 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -68.1809308 74.4286601 [2,] -166.1217475 -68.1809308 [3,] -155.7509980 -166.1217475 [4,] -21.4969605 -155.7509980 [5,] 18.0274807 -21.4969605 [6,] -50.4104886 18.0274807 [7,] -7.6866780 -50.4104886 [8,] -83.3928552 -7.6866780 [9,] -102.3981511 -83.3928552 [10,] -118.8255284 -102.3981511 [11,] 283.6153569 -118.8255284 [12,] 164.8566564 283.6153569 [13,] 23.5930328 164.8566564 [14,] 49.8160317 23.5930328 [15,] -36.7673441 49.8160317 [16,] -8.5192432 -36.7673441 [17,] 69.0278383 -8.5192432 [18,] 240.4454540 69.0278383 [19,] 332.4601343 240.4454540 [20,] 229.4472651 332.4601343 [21,] 155.6595864 229.4472651 [22,] 106.0953973 155.6595864 [23,] 186.4185360 106.0953973 [24,] 212.6810212 186.4185360 [25,] 52.2447980 212.6810212 [26,] 64.7464146 52.2447980 [27,] -69.0911658 64.7464146 [28,] 0.1078936 -69.0911658 [29,] 19.3845131 0.1078936 [30,] 107.6188207 19.3845131 [31,] -8.8264669 107.6188207 [32,] 67.7238503 -8.8264669 [33,] -68.3277234 67.7238503 [34,] -4.9351400 -68.3277234 [35,] -14.4863027 -4.9351400 [36,] 18.0502615 -14.4863027 [37,] -125.2941289 18.0502615 [38,] -59.5957818 -125.2941289 [39,] 38.7265401 -59.5957818 [40,] -100.7844903 38.7265401 [41,] 57.4363586 -100.7844903 [42,] 174.5976597 57.4363586 [43,] 169.5166464 174.5976597 [44,] 2.7114669 169.5166464 [45,] 43.0617864 2.7114669 [46,] -63.1338403 43.0617864 [47,] 23.3569256 -63.1338403 [48,] 34.9961139 23.3569256 [49,] -90.6686291 34.9961139 [50,] -47.5619663 -90.6686291 [51,] -59.0243079 -47.5619663 [52,] -133.2229369 -59.0243079 [53,] -155.6828910 -133.2229369 [54,] 39.2370524 -155.6828910 [55,] 66.8547492 39.2370524 [56,] -45.0438631 66.8547492 [57,] -26.4174416 -45.0438631 [58,] -87.3756925 -26.4174416 [59,] -26.1818845 -87.3756925 [60,] -39.0874453 -26.1818845 [61,] -13.9673981 -39.0874453 [62,] -116.4657937 -13.9673981 [63,] -51.6185905 -116.4657937 [64,] 23.3146286 -51.6185905 [65,] -1.0300532 23.3146286 [66,] 50.6409581 -1.0300532 [67,] 60.4665988 50.6409581 [68,] 78.2258642 60.4665988 [69,] -36.6276060 78.2258642 [70,] -174.4013529 -36.6276060 [71,] -152.6499665 -174.4013529 [72,] 48.3000716 -152.6499665 [73,] -115.5711179 48.3000716 [74,] -24.8444794 -115.5711179 [75,] -103.6440236 -24.8444794 [76,] 34.9231241 -103.6440236 [77,] -23.6003747 34.9231241 [78,] 164.1389829 -23.6003747 [79,] 162.6598464 164.1389829 [80,] 45.7065084 162.6598464 [81,] -96.2656537 45.7065084 [82,] -48.9627537 -96.2656537 [83,] -68.1797354 -48.9627537 [84,] -10.2553060 -68.1797354 [85,] -132.8067527 -10.2553060 [86,] -3.7687642 -132.8067527 [87,] -108.6844204 -3.7687642 [88,] -22.8715779 -108.6844204 [89,] -66.3938746 -22.8715779 [90,] 76.7174989 -66.3938746 [91,] 27.5490077 76.7174989 [92,] -49.6674079 27.5490077 [93,] -7.2955897 -49.6674079 [94,] -63.0265487 -7.2955897 [95,] -51.2980173 -63.0265487 [96,] 82.2095811 -51.2980173 [97,] -95.9982430 82.2095811 [98,] 9.1579985 -95.9982430 [99,] -83.3945276 9.1579985 [100,] 34.8951519 -83.3945276 [101,] -33.3530943 34.8951519 [102,] 155.0863627 -33.3530943 [103,] 101.0643332 155.0863627 [104,] -77.2657422 101.0643332 [105,] -67.5230306 -77.2657422 [106,] -71.0104042 -67.5230306 [107,] -1.6376174 -71.0104042 [108,] 84.5339345 -1.6376174 [109,] 14.0933307 84.5339345 [110,] -54.5497865 14.0933307 [111,] -71.3945994 -54.5497865 [112,] -53.9170445 -71.3945994 [113,] 22.0027474 -53.9170445 [114,] 9.9161880 22.0027474 [115,] 15.2833059 9.9161880 [116,] 22.5767851 15.2833059 [117,] -25.7644253 22.5767851 [118,] -32.5201906 -25.7644253 [119,] -109.2996717 -32.5201906 [120,] -13.2195591 -109.2996717 [121,] -100.3074186 -13.2195591 [122,] 31.1088790 -100.3074186 [123,] 93.2435278 31.1088790 [124,] 160.5844430 93.2435278 [125,] -1.1260499 160.5844430 [126,] 109.6945603 -1.1260499 [127,] 32.4947888 109.6945603 [128,] 67.3949234 32.4947888 [129,] -48.9749900 67.3949234 [130,] -47.3846697 -48.9749900 [131,] -146.2239661 -47.3846697 [132,] -69.5226385 -146.2239661 [133,] -82.6085644 -69.5226385 [134,] 74.7635886 -82.6085644 [135,] -52.3998043 74.7635886 [136,] -0.1140466 -52.3998043 [137,] 25.1908913 -0.1140466 [138,] 6.8609880 25.1908913 [139,] -61.2726539 6.8609880 [140,] 5.6315201 -61.2726539 [141,] -24.5905135 5.6315201 [142,] 2.8921632 -24.5905135 [143,] -46.7039504 2.8921632 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -68.1809308 74.4286601 2 -166.1217475 -68.1809308 3 -155.7509980 -166.1217475 4 -21.4969605 -155.7509980 5 18.0274807 -21.4969605 6 -50.4104886 18.0274807 7 -7.6866780 -50.4104886 8 -83.3928552 -7.6866780 9 -102.3981511 -83.3928552 10 -118.8255284 -102.3981511 11 283.6153569 -118.8255284 12 164.8566564 283.6153569 13 23.5930328 164.8566564 14 49.8160317 23.5930328 15 -36.7673441 49.8160317 16 -8.5192432 -36.7673441 17 69.0278383 -8.5192432 18 240.4454540 69.0278383 19 332.4601343 240.4454540 20 229.4472651 332.4601343 21 155.6595864 229.4472651 22 106.0953973 155.6595864 23 186.4185360 106.0953973 24 212.6810212 186.4185360 25 52.2447980 212.6810212 26 64.7464146 52.2447980 27 -69.0911658 64.7464146 28 0.1078936 -69.0911658 29 19.3845131 0.1078936 30 107.6188207 19.3845131 31 -8.8264669 107.6188207 32 67.7238503 -8.8264669 33 -68.3277234 67.7238503 34 -4.9351400 -68.3277234 35 -14.4863027 -4.9351400 36 18.0502615 -14.4863027 37 -125.2941289 18.0502615 38 -59.5957818 -125.2941289 39 38.7265401 -59.5957818 40 -100.7844903 38.7265401 41 57.4363586 -100.7844903 42 174.5976597 57.4363586 43 169.5166464 174.5976597 44 2.7114669 169.5166464 45 43.0617864 2.7114669 46 -63.1338403 43.0617864 47 23.3569256 -63.1338403 48 34.9961139 23.3569256 49 -90.6686291 34.9961139 50 -47.5619663 -90.6686291 51 -59.0243079 -47.5619663 52 -133.2229369 -59.0243079 53 -155.6828910 -133.2229369 54 39.2370524 -155.6828910 55 66.8547492 39.2370524 56 -45.0438631 66.8547492 57 -26.4174416 -45.0438631 58 -87.3756925 -26.4174416 59 -26.1818845 -87.3756925 60 -39.0874453 -26.1818845 61 -13.9673981 -39.0874453 62 -116.4657937 -13.9673981 63 -51.6185905 -116.4657937 64 23.3146286 -51.6185905 65 -1.0300532 23.3146286 66 50.6409581 -1.0300532 67 60.4665988 50.6409581 68 78.2258642 60.4665988 69 -36.6276060 78.2258642 70 -174.4013529 -36.6276060 71 -152.6499665 -174.4013529 72 48.3000716 -152.6499665 73 -115.5711179 48.3000716 74 -24.8444794 -115.5711179 75 -103.6440236 -24.8444794 76 34.9231241 -103.6440236 77 -23.6003747 34.9231241 78 164.1389829 -23.6003747 79 162.6598464 164.1389829 80 45.7065084 162.6598464 81 -96.2656537 45.7065084 82 -48.9627537 -96.2656537 83 -68.1797354 -48.9627537 84 -10.2553060 -68.1797354 85 -132.8067527 -10.2553060 86 -3.7687642 -132.8067527 87 -108.6844204 -3.7687642 88 -22.8715779 -108.6844204 89 -66.3938746 -22.8715779 90 76.7174989 -66.3938746 91 27.5490077 76.7174989 92 -49.6674079 27.5490077 93 -7.2955897 -49.6674079 94 -63.0265487 -7.2955897 95 -51.2980173 -63.0265487 96 82.2095811 -51.2980173 97 -95.9982430 82.2095811 98 9.1579985 -95.9982430 99 -83.3945276 9.1579985 100 34.8951519 -83.3945276 101 -33.3530943 34.8951519 102 155.0863627 -33.3530943 103 101.0643332 155.0863627 104 -77.2657422 101.0643332 105 -67.5230306 -77.2657422 106 -71.0104042 -67.5230306 107 -1.6376174 -71.0104042 108 84.5339345 -1.6376174 109 14.0933307 84.5339345 110 -54.5497865 14.0933307 111 -71.3945994 -54.5497865 112 -53.9170445 -71.3945994 113 22.0027474 -53.9170445 114 9.9161880 22.0027474 115 15.2833059 9.9161880 116 22.5767851 15.2833059 117 -25.7644253 22.5767851 118 -32.5201906 -25.7644253 119 -109.2996717 -32.5201906 120 -13.2195591 -109.2996717 121 -100.3074186 -13.2195591 122 31.1088790 -100.3074186 123 93.2435278 31.1088790 124 160.5844430 93.2435278 125 -1.1260499 160.5844430 126 109.6945603 -1.1260499 127 32.4947888 109.6945603 128 67.3949234 32.4947888 129 -48.9749900 67.3949234 130 -47.3846697 -48.9749900 131 -146.2239661 -47.3846697 132 -69.5226385 -146.2239661 133 -82.6085644 -69.5226385 134 74.7635886 -82.6085644 135 -52.3998043 74.7635886 136 -0.1140466 -52.3998043 137 25.1908913 -0.1140466 138 6.8609880 25.1908913 139 -61.2726539 6.8609880 140 5.6315201 -61.2726539 141 -24.5905135 5.6315201 142 2.8921632 -24.5905135 143 -46.7039504 2.8921632 > 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() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7fp491353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/8qgyc1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/98ypj1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/108gkz1353865580.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/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, mysum$coefficients[i,1], 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.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11p6lf1353865580.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
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,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12day71353865580.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, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > 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, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13kkhb1353865580.tab") > 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
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
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,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/14pbok1353865580.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,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/154gt01353865580.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,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + 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,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + 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,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + 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="/var/wessaorg/rcomp/tmp/16pfp51353865580.tab") + } > > try(system("convert tmp/1i2tx1353865580.ps tmp/1i2tx1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/24mhz1353865580.ps tmp/24mhz1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/3831e1353865580.ps tmp/3831e1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/49q8h1353865580.ps tmp/49q8h1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/5vrde1353865580.ps tmp/5vrde1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/62ivm1353865580.ps tmp/62ivm1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/7fp491353865580.ps tmp/7fp491353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/8qgyc1353865580.ps tmp/8qgyc1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/98ypj1353865580.ps tmp/98ypj1353865580.png",intern=TRUE)) character(0) > try(system("convert tmp/108gkz1353865580.ps tmp/108gkz1353865580.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.019 1.112 8.204