R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(10345 + ,3010 + ,13 + ,13 + ,17607 + ,4344 + ,27 + ,24 + ,1423 + ,603 + ,0 + ,0 + ,20050 + ,6792 + ,37 + ,37 + ,21212 + ,7843 + ,39 + ,38 + ,93979 + ,13738 + ,99 + ,96 + ,15524 + ,4120 + ,21 + ,21 + ,16182 + ,4174 + ,33 + ,33 + ,19238 + ,6202 + ,36 + ,35 + ,28909 + ,8535 + ,44 + ,40 + ,22357 + ,5818 + ,33 + ,33 + ,25560 + ,9834 + ,47 + ,47 + ,9954 + ,4145 + ,19 + ,19 + ,18490 + ,4719 + ,41 + ,40 + ,17777 + ,3981 + ,22 + ,22 + ,25268 + ,3264 + ,17 + ,17 + ,37525 + ,11276 + ,46 + ,46 + ,6023 + ,1 + ,0 + ,0 + ,25042 + ,9480 + ,31 + ,31 + ,35713 + ,1953 + ,20 + ,20 + ,7039 + ,1801 + ,10 + ,10 + ,40841 + ,7352 + ,55 + ,55 + ,9214 + ,761 + ,6 + ,6 + ,17446 + ,1147 + ,17 + ,17 + ,10295 + ,3536 + ,33 + ,33 + ,13206 + ,3146 + ,33 + ,33 + ,26093 + ,6764 + ,32 + ,32 + ,20744 + ,7038 + ,37 + ,36 + ,68013 + ,8298 + ,44 + ,39 + ,12840 + ,5718 + ,22 + ,22 + ,12672 + ,2493 + ,15 + ,15 + ,10872 + ,4226 + ,18 + ,18 + ,21325 + ,3553 + ,25 + ,24 + ,24542 + ,58 + ,7 + ,7 + ,16401 + ,4425 + ,35 + ,34 + ,0 + ,0 + ,0 + ,0 + ,12821 + ,3705 + ,14 + ,7 + ,14662 + ,4968 + ,31 + ,31 + ,22190 + ,2320 + ,9 + ,9 + ,37929 + ,9820 + ,59 + ,52 + ,18009 + ,3606 + ,62 + ,60 + ,11076 + ,3987 + ,12 + ,11 + ,24981 + ,2138 + ,23 + ,20 + ,30691 + ,2299 + ,31 + ,31 + ,29164 + ,3308 + ,57 + ,56 + ,13985 + ,4721 + ,23 + ,23 + ,7588 + ,1369 + ,14 + ,14 + ,20023 + ,4118 + ,31 + ,30 + ,25524 + ,5396 + ,17 + ,17 + ,14717 + ,3704 + ,24 + ,24 + ,6832 + ,1801 + ,11 + ,11 + ,9624 + ,3814 + ,16 + ,16 + ,24300 + ,5010 + ,32 + ,30 + ,21790 + ,5369 + ,36 + ,35 + ,16493 + ,3952 + ,37 + ,37 + ,9269 + ,3264 + ,25 + ,25 + ,20105 + ,4177 + ,30 + ,30 + ,11216 + ,2352 + ,10 + ,9 + ,15569 + ,5624 + ,16 + ,16 + ,21799 + ,176 + ,3 + ,3 + ,3772 + ,2356 + ,0 + ,0 + ,6057 + ,1700 + ,17 + ,19 + ,20828 + ,1262 + ,9 + ,9 + ,9976 + ,2766 + ,22 + ,18 + ,14055 + ,2536 + ,5 + ,5 + ,17455 + ,4931 + ,23 + ,22 + ,39553 + ,9606 + ,16 + ,16 + ,14818 + ,4097 + ,53 + ,53 + ,17065 + ,4537 + ,23 + ,23 + ,1536 + ,516 + ,0 + ,0 + ,11938 + ,2643 + ,51 + ,50 + ,24589 + ,1277 + ,25 + ,25 + ,21332 + ,3230 + ,51 + ,48 + ,13229 + ,3356 + ,46 + ,46 + ,11331 + ,2204 + ,16 + ,16 + ,853 + ,342 + ,0 + ,0 + ,19821 + ,6783 + ,25 + ,25 + ,34666 + ,4213 + ,34 + ,33 + ,15051 + ,2822 + ,14 + ,14 + ,27969 + ,5199 + ,32 + ,30 + ,17897 + ,4780 + ,24 + ,23 + ,6031 + ,2341 + ,16 + ,16 + ,7153 + ,1825 + ,19 + ,19 + ,13365 + ,4653 + ,27 + ,27 + ,11197 + ,1524 + ,24 + ,24 + ,25291 + ,2685 + ,12 + ,12 + ,28994 + ,9230 + ,43 + ,43 + ,10461 + ,2490 + ,13 + ,13 + ,16415 + ,4718 + ,19 + ,19 + ,8495 + ,2937 + ,24 + ,24 + ,18318 + ,3599 + ,27 + ,27 + ,25143 + ,4487 + ,26 + ,26 + ,20471 + ,2149 + ,14 + ,14 + ,14561 + ,1921 + ,26 + ,26 + ,16902 + ,2896 + ,15 + ,15 + ,12994 + ,5815 + ,30 + ,29 + ,29697 + ,4679 + ,33 + ,33 + ,3895 + ,786 + ,14 + ,14 + ,9807 + ,4006 + ,11 + ,11 + ,10711 + ,2686 + ,12 + ,11 + ,2325 + ,593 + ,8 + ,8 + ,19000 + ,2454 + ,22 + ,22 + ,22418 + ,4061 + ,12 + ,11 + ,7872 + ,2856 + ,6 + ,6 + ,5650 + ,1678 + ,10 + ,10 + ,3979 + ,460 + ,1 + ,0 + ,14956 + ,5054 + ,31 + ,30 + ,3738 + ,999 + ,5 + ,5 + ,0 + ,0 + ,0 + ,0 + ,10586 + ,3685 + ,35 + ,34 + ,18122 + ,503 + ,15 + ,15 + ,17899 + ,3595 + ,36 + ,34 + ,10913 + ,3367 + ,27 + ,28 + ,18060 + ,1330 + ,36 + ,36 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,15452 + ,6878 + ,29 + ,29 + ,33996 + ,3080 + ,19 + ,19 + ,8877 + ,1349 + ,16 + ,15 + ,18708 + ,3339 + ,15 + ,15 + ,2781 + ,4 + ,1 + ,1 + ,20854 + ,3446 + ,36 + ,36 + ,8179 + ,1467 + ,22 + ,22 + ,7139 + ,255 + ,16 + ,16 + ,13798 + ,424 + ,1 + ,1 + ,5619 + ,2374 + ,10 + ,10 + ,13050 + ,3519 + ,31 + ,31 + ,11297 + ,2650 + ,22 + ,22 + ,16170 + ,2757 + ,22 + ,21 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,20539 + ,459 + ,10 + ,10 + ,0 + ,0 + ,0 + ,0 + ,10056 + ,549 + ,9 + ,9 + ,0 + ,0 + ,0 + ,0 + ,2418 + ,206 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,11806 + ,2885 + ,7 + ,7 + ,15924 + ,1034 + ,2 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,7084 + ,2558 + ,16 + ,16 + ,14831 + ,5086 + ,25 + ,25 + ,6585 + ,1392 + ,6 + ,6) + ,dim=c(4 + ,144) + ,dimnames=list(c('Y_t' + ,'X_1t' + ,'X_2t' + ,'X_3t') + ,1:144)) > y <- array(NA,dim=c(4,144),dimnames=list(c('Y_t','X_1t','X_2t','X_3t'),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' > #'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 > 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 1 10345 3010 13 13 2 17607 4344 27 24 3 1423 603 0 0 4 20050 6792 37 37 5 21212 7843 39 38 6 93979 13738 99 96 7 15524 4120 21 21 8 16182 4174 33 33 9 19238 6202 36 35 10 28909 8535 44 40 11 22357 5818 33 33 12 25560 9834 47 47 13 9954 4145 19 19 14 18490 4719 41 40 15 17777 3981 22 22 16 25268 3264 17 17 17 37525 11276 46 46 18 6023 1 0 0 19 25042 9480 31 31 20 35713 1953 20 20 21 7039 1801 10 10 22 40841 7352 55 55 23 9214 761 6 6 24 17446 1147 17 17 25 10295 3536 33 33 26 13206 3146 33 33 27 26093 6764 32 32 28 20744 7038 37 36 29 68013 8298 44 39 30 12840 5718 22 22 31 12672 2493 15 15 32 10872 4226 18 18 33 21325 3553 25 24 34 24542 58 7 7 35 16401 4425 35 34 36 0 0 0 0 37 12821 3705 14 7 38 14662 4968 31 31 39 22190 2320 9 9 40 37929 9820 59 52 41 18009 3606 62 60 42 11076 3987 12 11 43 24981 2138 23 20 44 30691 2299 31 31 45 29164 3308 57 56 46 13985 4721 23 23 47 7588 1369 14 14 48 20023 4118 31 30 49 25524 5396 17 17 50 14717 3704 24 24 51 6832 1801 11 11 52 9624 3814 16 16 53 24300 5010 32 30 54 21790 5369 36 35 55 16493 3952 37 37 56 9269 3264 25 25 57 20105 4177 30 30 58 11216 2352 10 9 59 15569 5624 16 16 60 21799 176 3 3 61 3772 2356 0 0 62 6057 1700 17 19 63 20828 1262 9 9 64 9976 2766 22 18 65 14055 2536 5 5 66 17455 4931 23 22 67 39553 9606 16 16 68 14818 4097 53 53 69 17065 4537 23 23 70 1536 516 0 0 71 11938 2643 51 50 72 24589 1277 25 25 73 21332 3230 51 48 74 13229 3356 46 46 75 11331 2204 16 16 76 853 342 0 0 77 19821 6783 25 25 78 34666 4213 34 33 79 15051 2822 14 14 80 27969 5199 32 30 81 17897 4780 24 23 82 6031 2341 16 16 83 7153 1825 19 19 84 13365 4653 27 27 85 11197 1524 24 24 86 25291 2685 12 12 87 28994 9230 43 43 88 10461 2490 13 13 89 16415 4718 19 19 90 8495 2937 24 24 91 18318 3599 27 27 92 25143 4487 26 26 93 20471 2149 14 14 94 14561 1921 26 26 95 16902 2896 15 15 96 12994 5815 30 29 97 29697 4679 33 33 98 3895 786 14 14 99 9807 4006 11 11 100 10711 2686 12 11 101 2325 593 8 8 102 19000 2454 22 22 103 22418 4061 12 11 104 7872 2856 6 6 105 5650 1678 10 10 106 3979 460 1 0 107 14956 5054 31 30 108 3738 999 5 5 109 0 0 0 0 110 10586 3685 35 34 111 18122 503 15 15 112 17899 3595 36 34 113 10913 3367 27 28 114 18060 1330 36 36 115 0 0 0 0 116 0 0 0 0 117 15452 6878 29 29 118 33996 3080 19 19 119 8877 1349 16 15 120 18708 3339 15 15 121 2781 4 1 1 122 20854 3446 36 36 123 8179 1467 22 22 124 7139 255 16 16 125 13798 424 1 1 126 5619 2374 10 10 127 13050 3519 31 31 128 11297 2650 22 22 129 16170 2757 22 21 130 0 0 0 0 131 0 0 0 0 132 20539 459 10 10 133 0 0 0 0 134 10056 549 9 9 135 0 0 0 0 136 2418 206 0 0 137 0 0 0 0 138 11806 2885 7 7 139 15924 1034 2 2 140 0 0 0 0 141 0 0 0 0 142 7084 2558 16 16 143 14831 5086 25 25 144 6585 1392 6 6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X_1t X_2t X_3t 3171.068 1.963 1411.542 -1151.728 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10824 -4720 -2495 2869 34659 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3171.0682 1151.1018 2.755 0.00665 ** X_1t 1.9633 0.3882 5.057 1.31e-06 *** X_2t 1411.5421 596.7693 2.365 0.01939 * X_3t -1151.7280 606.9874 -1.897 0.05983 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7943 on 140 degrees of freedom Multiple R-squared: 0.5811, Adjusted R-squared: 0.5721 F-statistic: 64.73 on 3 and 140 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.2046111 4.092222e-01 7.953889e-01 [2,] 0.7551847 4.896307e-01 2.448153e-01 [3,] 0.7083673 5.832654e-01 2.916327e-01 [4,] 0.6027115 7.945770e-01 3.972885e-01 [5,] 0.4865326 9.730651e-01 5.134674e-01 [6,] 0.3828477 7.656955e-01 6.171523e-01 [7,] 0.2953285 5.906570e-01 7.046715e-01 [8,] 0.5905535 8.188931e-01 4.094465e-01 [9,] 0.5563229 8.873542e-01 4.436771e-01 [10,] 0.8010323 3.979353e-01 1.989677e-01 [11,] 0.7843709 4.312583e-01 2.156291e-01 [12,] 0.7966489 4.067023e-01 2.033511e-01 [13,] 0.7616077 4.767846e-01 2.383923e-01 [14,] 0.9535345 9.293095e-02 4.646547e-02 [15,] 0.9341848 1.316304e-01 6.581518e-02 [16,] 0.9232382 1.535237e-01 7.676185e-02 [17,] 0.9020859 1.958282e-01 9.791408e-02 [18,] 0.8779082 2.441836e-01 1.220918e-01 [19,] 0.9402220 1.195560e-01 5.977801e-02 [20,] 0.9509448 9.811044e-02 4.905522e-02 [21,] 0.9355491 1.289018e-01 6.445091e-02 [22,] 0.9268510 1.462980e-01 7.314900e-02 [23,] 0.9990142 1.971688e-03 9.858439e-04 [24,] 0.9986270 2.746061e-03 1.373031e-03 [25,] 0.9978751 4.249713e-03 2.124857e-03 [26,] 0.9969640 6.071997e-03 3.035998e-03 [27,] 0.9956106 8.778781e-03 4.389391e-03 [28,] 0.9993885 1.223031e-03 6.115156e-04 [29,] 0.9994909 1.018285e-03 5.091423e-04 [30,] 0.9992411 1.517798e-03 7.588990e-04 [31,] 0.9996412 7.176171e-04 3.588086e-04 [32,] 0.9995830 8.340177e-04 4.170088e-04 [33,] 0.9998345 3.309158e-04 1.654579e-04 [34,] 0.9998824 2.351533e-04 1.175766e-04 [35,] 0.9999778 4.445262e-05 2.222631e-05 [36,] 0.9999651 6.984218e-05 3.492109e-05 [37,] 0.9999673 6.541479e-05 3.270740e-05 [38,] 0.9999895 2.108648e-05 1.054324e-05 [39,] 0.9999879 2.420364e-05 1.210182e-05 [40,] 0.9999818 3.633054e-05 1.816527e-05 [41,] 0.9999700 5.994141e-05 2.997070e-05 [42,] 0.9999506 9.886092e-05 4.943046e-05 [43,] 0.9999511 9.780002e-05 4.890001e-05 [44,] 0.9999212 1.575910e-04 7.879551e-05 [45,] 0.9998788 2.424339e-04 1.212169e-04 [46,] 0.9998385 3.230407e-04 1.615203e-04 [47,] 0.9997538 4.924133e-04 2.462067e-04 [48,] 0.9996282 7.435021e-04 3.717510e-04 [49,] 0.9994985 1.003025e-03 5.015127e-04 [50,] 0.9994348 1.130498e-03 5.652489e-04 [51,] 0.9991456 1.708858e-03 8.544288e-04 [52,] 0.9987120 2.576085e-03 1.288043e-03 [53,] 0.9981921 3.615807e-03 1.807903e-03 [54,] 0.9996482 7.036038e-04 3.518019e-04 [55,] 0.9995355 9.289304e-04 4.644652e-04 [56,] 0.9993585 1.283082e-03 6.415408e-04 [57,] 0.9996916 6.167751e-04 3.083876e-04 [58,] 0.9996803 6.393476e-04 3.196738e-04 [59,] 0.9995701 8.597934e-04 4.298967e-04 [60,] 0.9993595 1.281040e-03 6.405200e-04 [61,] 0.9997505 4.990992e-04 2.495496e-04 [62,] 0.9998063 3.874226e-04 1.937113e-04 [63,] 0.9996945 6.109468e-04 3.054734e-04 [64,] 0.9995541 8.918512e-04 4.459256e-04 [65,] 0.9996832 6.335049e-04 3.167525e-04 [66,] 0.9998526 2.948532e-04 1.474266e-04 [67,] 0.9997905 4.190623e-04 2.095311e-04 [68,] 0.9998130 3.739671e-04 1.869836e-04 [69,] 0.9997020 5.960252e-04 2.980126e-04 [70,] 0.9995642 8.715661e-04 4.357830e-04 [71,] 0.9993512 1.297591e-03 6.487953e-04 [72,] 0.9997895 4.209805e-04 2.104902e-04 [73,] 0.9996868 6.264975e-04 3.132488e-04 [74,] 0.9996661 6.678488e-04 3.339244e-04 [75,] 0.9994814 1.037123e-03 5.185613e-04 [76,] 0.9993841 1.231867e-03 6.159333e-04 [77,] 0.9991950 1.609918e-03 8.049590e-04 [78,] 0.9990234 1.953274e-03 9.766372e-04 [79,] 0.9985333 2.933475e-03 1.466737e-03 [80,] 0.9995312 9.376901e-04 4.688451e-04 [81,] 0.9992867 1.426550e-03 7.132752e-04 [82,] 0.9988937 2.212599e-03 1.106300e-03 [83,] 0.9983031 3.393795e-03 1.696897e-03 [84,] 0.9981906 3.618831e-03 1.809416e-03 [85,] 0.9972794 5.441218e-03 2.720609e-03 [86,] 0.9971543 5.691482e-03 2.845741e-03 [87,] 0.9979075 4.184909e-03 2.092455e-03 [88,] 0.9968290 6.342021e-03 3.171010e-03 [89,] 0.9960080 7.983915e-03 3.991958e-03 [90,] 0.9963748 7.250401e-03 3.625200e-03 [91,] 0.9974445 5.111051e-03 2.555525e-03 [92,] 0.9967165 6.567075e-03 3.283537e-03 [93,] 0.9953169 9.366157e-03 4.683078e-03 [94,] 0.9930432 1.391359e-02 6.956793e-03 [95,] 0.9910514 1.789716e-02 8.948582e-03 [96,] 0.9896996 2.060077e-02 1.030038e-02 [97,] 0.9930361 1.392783e-02 6.963917e-03 [98,] 0.9897217 2.055652e-02 1.027826e-02 [99,] 0.9858469 2.830626e-02 1.415313e-02 [100,] 0.9796011 4.079788e-02 2.039894e-02 [101,] 0.9739569 5.208615e-02 2.604308e-02 [102,] 0.9648344 7.033111e-02 3.516555e-02 [103,] 0.9550491 8.990190e-02 4.495095e-02 [104,] 0.9601182 7.976368e-02 3.988184e-02 [105,] 0.9675490 6.490201e-02 3.245100e-02 [106,] 0.9578925 8.421498e-02 4.210749e-02 [107,] 0.9476207 1.047585e-01 5.237927e-02 [108,] 0.9286017 1.427966e-01 7.139830e-02 [109,] 0.9091878 1.816243e-01 9.081217e-02 [110,] 0.8865887 2.268226e-01 1.134113e-01 [111,] 0.8949203 2.101594e-01 1.050797e-01 [112,] 0.9935234 1.295327e-02 6.476634e-03 [113,] 0.9899212 2.015770e-02 1.007885e-02 [114,] 0.9898150 2.037010e-02 1.018505e-02 [115,] 0.9833566 3.328685e-02 1.664343e-02 [116,] 0.9772775 4.544505e-02 2.272252e-02 [117,] 0.9660349 6.793022e-02 3.396511e-02 [118,] 0.9479272 1.041457e-01 5.207285e-02 [119,] 0.9671976 6.560474e-02 3.280237e-02 [120,] 0.9516572 9.668566e-02 4.834283e-02 [121,] 0.9377350 1.245300e-01 6.226502e-02 [122,] 0.9182368 1.635265e-01 8.176323e-02 [123,] 0.8746852 2.506296e-01 1.253148e-01 [124,] 0.8264251 3.471497e-01 1.735749e-01 [125,] 0.7677853 4.644293e-01 2.322147e-01 [126,] 0.9434102 1.131796e-01 5.658980e-02 [127,] 0.9071116 1.857769e-01 9.288843e-02 [128,] 0.9517341 9.653183e-02 4.826591e-02 [129,] 0.9047828 1.904343e-01 9.521716e-02 [130,] 0.8151856 3.696288e-01 1.848144e-01 [131,] 0.6866495 6.267011e-01 3.133505e-01 > postscript(file="/var/www/rcomp/tmp/1eyt81322152731.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/www/rcomp/tmp/2mfqb1322152731.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/www/rcomp/tmp/3m6pw1322152731.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/www/rcomp/tmp/4orjh1322152731.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/www/rcomp/tmp/5af691322152731.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 -2113.1886 -4562.8138 -2931.9389 -6068.9326 -8641.7186 34659.3185 7 8 9 10 11 12 -1191.9658 -3757.7531 -6614.4987 -7057.5776 -810.4207 -9129.4364 13 14 15 16 17 18 -6291.4202 -5749.9930 1074.1190 11271.8765 264.2970 2849.9685 19 20 21 22 23 24 -4795.4024 23511.3225 -2266.1149 8945.9651 2989.9750 7606.1857 25 26 27 28 29 30 -8392.1668 -4715.4792 1328.1102 -7009.6328 31359.9969 -7273.1356 31 32 33 34 35 36 709.2101 -5272.6335 3531.2418 19438.3618 -5702.8979 -3171.0682 37 38 39 40 41 42 -9323.5931 -6316.9863 12125.7458 -7912.8151 -10653.6622 -4192.2480 43 44 45 46 47 48 8181.4855 14952.0653 3537.2000 -4430.5382 -1908.2250 -438.9080 49 50 51 52 53 54 7342.1178 -1961.6747 -2732.9290 -5192.1252 675.2850 -2427.0686 55 56 57 58 59 60 -4050.1565 -6805.6361 938.7992 -322.6220 -2800.7008 17502.9485 61 62 63 64 65 66 -4024.6064 -2565.0640 12840.9187 -8948.3817 4605.9290 -2524.5595 67 68 69 70 71 72 13365.4328 -10166.8605 -989.2907 -2648.1317 -10824.3201 12415.4438 73 74 75 76 77 78 -4886.2340 -8482.3556 -324.2099 -2989.5172 -3162.4939 13238.1361 79 80 81 82 83 84 2702.0980 3973.2210 -2045.9150 -5893.1822 -4537.5609 -5956.2900 85 86 87 88 89 90 -1201.6775 13730.6985 -3470.3460 -976.2718 -955.3919 -6677.8225 91 92 93 94 95 96 1066.0297 6407.4321 9443.3999 863.2636 4147.9996 -10539.8165 97 98 99 100 101 102 8765.7797 -4456.6202 -4087.0087 -2002.9928 -4088.8186 5295.0803 103 104 105 106 107 108 7004.4677 -2465.1416 -3413.6288 -1506.7289 -7343.5582 -2693.4767 109 110 111 112 113 114 -3171.0682 -10065.0548 10066.1800 -3986.8998 -4731.7564 2924.4340 115 116 117 118 119 120 -3171.0682 -3171.0682 -8757.2639 19841.4958 -2251.3151 5084.2571 121 122 123 124 125 126 -657.7354 1564.0881 -3588.1412 -689.7353 9534.6780 -4811.0866 127 128 129 130 131 132 -5084.1625 -2792.7268 718.4720 -3171.0682 -3171.0682 13868.6357 133 134 135 136 137 138 -3171.0682 3468.7526 -3171.0682 -1157.5082 -3171.0682 1152.1086 139 140 141 142 143 144 10203.2500 -3171.0682 -3171.0682 -5266.2186 -4820.7714 -877.8683 > postscript(file="/var/www/rcomp/tmp/6iayh1322152731.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 -2113.1886 NA 1 -4562.8138 -2113.1886 2 -2931.9389 -4562.8138 3 -6068.9326 -2931.9389 4 -8641.7186 -6068.9326 5 34659.3185 -8641.7186 6 -1191.9658 34659.3185 7 -3757.7531 -1191.9658 8 -6614.4987 -3757.7531 9 -7057.5776 -6614.4987 10 -810.4207 -7057.5776 11 -9129.4364 -810.4207 12 -6291.4202 -9129.4364 13 -5749.9930 -6291.4202 14 1074.1190 -5749.9930 15 11271.8765 1074.1190 16 264.2970 11271.8765 17 2849.9685 264.2970 18 -4795.4024 2849.9685 19 23511.3225 -4795.4024 20 -2266.1149 23511.3225 21 8945.9651 -2266.1149 22 2989.9750 8945.9651 23 7606.1857 2989.9750 24 -8392.1668 7606.1857 25 -4715.4792 -8392.1668 26 1328.1102 -4715.4792 27 -7009.6328 1328.1102 28 31359.9969 -7009.6328 29 -7273.1356 31359.9969 30 709.2101 -7273.1356 31 -5272.6335 709.2101 32 3531.2418 -5272.6335 33 19438.3618 3531.2418 34 -5702.8979 19438.3618 35 -3171.0682 -5702.8979 36 -9323.5931 -3171.0682 37 -6316.9863 -9323.5931 38 12125.7458 -6316.9863 39 -7912.8151 12125.7458 40 -10653.6622 -7912.8151 41 -4192.2480 -10653.6622 42 8181.4855 -4192.2480 43 14952.0653 8181.4855 44 3537.2000 14952.0653 45 -4430.5382 3537.2000 46 -1908.2250 -4430.5382 47 -438.9080 -1908.2250 48 7342.1178 -438.9080 49 -1961.6747 7342.1178 50 -2732.9290 -1961.6747 51 -5192.1252 -2732.9290 52 675.2850 -5192.1252 53 -2427.0686 675.2850 54 -4050.1565 -2427.0686 55 -6805.6361 -4050.1565 56 938.7992 -6805.6361 57 -322.6220 938.7992 58 -2800.7008 -322.6220 59 17502.9485 -2800.7008 60 -4024.6064 17502.9485 61 -2565.0640 -4024.6064 62 12840.9187 -2565.0640 63 -8948.3817 12840.9187 64 4605.9290 -8948.3817 65 -2524.5595 4605.9290 66 13365.4328 -2524.5595 67 -10166.8605 13365.4328 68 -989.2907 -10166.8605 69 -2648.1317 -989.2907 70 -10824.3201 -2648.1317 71 12415.4438 -10824.3201 72 -4886.2340 12415.4438 73 -8482.3556 -4886.2340 74 -324.2099 -8482.3556 75 -2989.5172 -324.2099 76 -3162.4939 -2989.5172 77 13238.1361 -3162.4939 78 2702.0980 13238.1361 79 3973.2210 2702.0980 80 -2045.9150 3973.2210 81 -5893.1822 -2045.9150 82 -4537.5609 -5893.1822 83 -5956.2900 -4537.5609 84 -1201.6775 -5956.2900 85 13730.6985 -1201.6775 86 -3470.3460 13730.6985 87 -976.2718 -3470.3460 88 -955.3919 -976.2718 89 -6677.8225 -955.3919 90 1066.0297 -6677.8225 91 6407.4321 1066.0297 92 9443.3999 6407.4321 93 863.2636 9443.3999 94 4147.9996 863.2636 95 -10539.8165 4147.9996 96 8765.7797 -10539.8165 97 -4456.6202 8765.7797 98 -4087.0087 -4456.6202 99 -2002.9928 -4087.0087 100 -4088.8186 -2002.9928 101 5295.0803 -4088.8186 102 7004.4677 5295.0803 103 -2465.1416 7004.4677 104 -3413.6288 -2465.1416 105 -1506.7289 -3413.6288 106 -7343.5582 -1506.7289 107 -2693.4767 -7343.5582 108 -3171.0682 -2693.4767 109 -10065.0548 -3171.0682 110 10066.1800 -10065.0548 111 -3986.8998 10066.1800 112 -4731.7564 -3986.8998 113 2924.4340 -4731.7564 114 -3171.0682 2924.4340 115 -3171.0682 -3171.0682 116 -8757.2639 -3171.0682 117 19841.4958 -8757.2639 118 -2251.3151 19841.4958 119 5084.2571 -2251.3151 120 -657.7354 5084.2571 121 1564.0881 -657.7354 122 -3588.1412 1564.0881 123 -689.7353 -3588.1412 124 9534.6780 -689.7353 125 -4811.0866 9534.6780 126 -5084.1625 -4811.0866 127 -2792.7268 -5084.1625 128 718.4720 -2792.7268 129 -3171.0682 718.4720 130 -3171.0682 -3171.0682 131 13868.6357 -3171.0682 132 -3171.0682 13868.6357 133 3468.7526 -3171.0682 134 -3171.0682 3468.7526 135 -1157.5082 -3171.0682 136 -3171.0682 -1157.5082 137 1152.1086 -3171.0682 138 10203.2500 1152.1086 139 -3171.0682 10203.2500 140 -3171.0682 -3171.0682 141 -5266.2186 -3171.0682 142 -4820.7714 -5266.2186 143 -877.8683 -4820.7714 144 NA -877.8683 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -4562.8138 -2113.1886 [2,] -2931.9389 -4562.8138 [3,] -6068.9326 -2931.9389 [4,] -8641.7186 -6068.9326 [5,] 34659.3185 -8641.7186 [6,] -1191.9658 34659.3185 [7,] -3757.7531 -1191.9658 [8,] -6614.4987 -3757.7531 [9,] -7057.5776 -6614.4987 [10,] -810.4207 -7057.5776 [11,] -9129.4364 -810.4207 [12,] -6291.4202 -9129.4364 [13,] -5749.9930 -6291.4202 [14,] 1074.1190 -5749.9930 [15,] 11271.8765 1074.1190 [16,] 264.2970 11271.8765 [17,] 2849.9685 264.2970 [18,] -4795.4024 2849.9685 [19,] 23511.3225 -4795.4024 [20,] -2266.1149 23511.3225 [21,] 8945.9651 -2266.1149 [22,] 2989.9750 8945.9651 [23,] 7606.1857 2989.9750 [24,] -8392.1668 7606.1857 [25,] -4715.4792 -8392.1668 [26,] 1328.1102 -4715.4792 [27,] -7009.6328 1328.1102 [28,] 31359.9969 -7009.6328 [29,] -7273.1356 31359.9969 [30,] 709.2101 -7273.1356 [31,] -5272.6335 709.2101 [32,] 3531.2418 -5272.6335 [33,] 19438.3618 3531.2418 [34,] -5702.8979 19438.3618 [35,] -3171.0682 -5702.8979 [36,] -9323.5931 -3171.0682 [37,] -6316.9863 -9323.5931 [38,] 12125.7458 -6316.9863 [39,] -7912.8151 12125.7458 [40,] -10653.6622 -7912.8151 [41,] -4192.2480 -10653.6622 [42,] 8181.4855 -4192.2480 [43,] 14952.0653 8181.4855 [44,] 3537.2000 14952.0653 [45,] -4430.5382 3537.2000 [46,] -1908.2250 -4430.5382 [47,] -438.9080 -1908.2250 [48,] 7342.1178 -438.9080 [49,] -1961.6747 7342.1178 [50,] -2732.9290 -1961.6747 [51,] -5192.1252 -2732.9290 [52,] 675.2850 -5192.1252 [53,] -2427.0686 675.2850 [54,] -4050.1565 -2427.0686 [55,] -6805.6361 -4050.1565 [56,] 938.7992 -6805.6361 [57,] -322.6220 938.7992 [58,] -2800.7008 -322.6220 [59,] 17502.9485 -2800.7008 [60,] -4024.6064 17502.9485 [61,] -2565.0640 -4024.6064 [62,] 12840.9187 -2565.0640 [63,] -8948.3817 12840.9187 [64,] 4605.9290 -8948.3817 [65,] -2524.5595 4605.9290 [66,] 13365.4328 -2524.5595 [67,] -10166.8605 13365.4328 [68,] -989.2907 -10166.8605 [69,] -2648.1317 -989.2907 [70,] -10824.3201 -2648.1317 [71,] 12415.4438 -10824.3201 [72,] -4886.2340 12415.4438 [73,] -8482.3556 -4886.2340 [74,] -324.2099 -8482.3556 [75,] -2989.5172 -324.2099 [76,] -3162.4939 -2989.5172 [77,] 13238.1361 -3162.4939 [78,] 2702.0980 13238.1361 [79,] 3973.2210 2702.0980 [80,] -2045.9150 3973.2210 [81,] -5893.1822 -2045.9150 [82,] -4537.5609 -5893.1822 [83,] -5956.2900 -4537.5609 [84,] -1201.6775 -5956.2900 [85,] 13730.6985 -1201.6775 [86,] -3470.3460 13730.6985 [87,] -976.2718 -3470.3460 [88,] -955.3919 -976.2718 [89,] -6677.8225 -955.3919 [90,] 1066.0297 -6677.8225 [91,] 6407.4321 1066.0297 [92,] 9443.3999 6407.4321 [93,] 863.2636 9443.3999 [94,] 4147.9996 863.2636 [95,] -10539.8165 4147.9996 [96,] 8765.7797 -10539.8165 [97,] -4456.6202 8765.7797 [98,] -4087.0087 -4456.6202 [99,] -2002.9928 -4087.0087 [100,] -4088.8186 -2002.9928 [101,] 5295.0803 -4088.8186 [102,] 7004.4677 5295.0803 [103,] -2465.1416 7004.4677 [104,] -3413.6288 -2465.1416 [105,] -1506.7289 -3413.6288 [106,] -7343.5582 -1506.7289 [107,] -2693.4767 -7343.5582 [108,] -3171.0682 -2693.4767 [109,] -10065.0548 -3171.0682 [110,] 10066.1800 -10065.0548 [111,] -3986.8998 10066.1800 [112,] -4731.7564 -3986.8998 [113,] 2924.4340 -4731.7564 [114,] -3171.0682 2924.4340 [115,] -3171.0682 -3171.0682 [116,] -8757.2639 -3171.0682 [117,] 19841.4958 -8757.2639 [118,] -2251.3151 19841.4958 [119,] 5084.2571 -2251.3151 [120,] -657.7354 5084.2571 [121,] 1564.0881 -657.7354 [122,] -3588.1412 1564.0881 [123,] -689.7353 -3588.1412 [124,] 9534.6780 -689.7353 [125,] -4811.0866 9534.6780 [126,] -5084.1625 -4811.0866 [127,] -2792.7268 -5084.1625 [128,] 718.4720 -2792.7268 [129,] -3171.0682 718.4720 [130,] -3171.0682 -3171.0682 [131,] 13868.6357 -3171.0682 [132,] -3171.0682 13868.6357 [133,] 3468.7526 -3171.0682 [134,] -3171.0682 3468.7526 [135,] -1157.5082 -3171.0682 [136,] -3171.0682 -1157.5082 [137,] 1152.1086 -3171.0682 [138,] 10203.2500 1152.1086 [139,] -3171.0682 10203.2500 [140,] -3171.0682 -3171.0682 [141,] -5266.2186 -3171.0682 [142,] -4820.7714 -5266.2186 [143,] -877.8683 -4820.7714 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -4562.8138 -2113.1886 2 -2931.9389 -4562.8138 3 -6068.9326 -2931.9389 4 -8641.7186 -6068.9326 5 34659.3185 -8641.7186 6 -1191.9658 34659.3185 7 -3757.7531 -1191.9658 8 -6614.4987 -3757.7531 9 -7057.5776 -6614.4987 10 -810.4207 -7057.5776 11 -9129.4364 -810.4207 12 -6291.4202 -9129.4364 13 -5749.9930 -6291.4202 14 1074.1190 -5749.9930 15 11271.8765 1074.1190 16 264.2970 11271.8765 17 2849.9685 264.2970 18 -4795.4024 2849.9685 19 23511.3225 -4795.4024 20 -2266.1149 23511.3225 21 8945.9651 -2266.1149 22 2989.9750 8945.9651 23 7606.1857 2989.9750 24 -8392.1668 7606.1857 25 -4715.4792 -8392.1668 26 1328.1102 -4715.4792 27 -7009.6328 1328.1102 28 31359.9969 -7009.6328 29 -7273.1356 31359.9969 30 709.2101 -7273.1356 31 -5272.6335 709.2101 32 3531.2418 -5272.6335 33 19438.3618 3531.2418 34 -5702.8979 19438.3618 35 -3171.0682 -5702.8979 36 -9323.5931 -3171.0682 37 -6316.9863 -9323.5931 38 12125.7458 -6316.9863 39 -7912.8151 12125.7458 40 -10653.6622 -7912.8151 41 -4192.2480 -10653.6622 42 8181.4855 -4192.2480 43 14952.0653 8181.4855 44 3537.2000 14952.0653 45 -4430.5382 3537.2000 46 -1908.2250 -4430.5382 47 -438.9080 -1908.2250 48 7342.1178 -438.9080 49 -1961.6747 7342.1178 50 -2732.9290 -1961.6747 51 -5192.1252 -2732.9290 52 675.2850 -5192.1252 53 -2427.0686 675.2850 54 -4050.1565 -2427.0686 55 -6805.6361 -4050.1565 56 938.7992 -6805.6361 57 -322.6220 938.7992 58 -2800.7008 -322.6220 59 17502.9485 -2800.7008 60 -4024.6064 17502.9485 61 -2565.0640 -4024.6064 62 12840.9187 -2565.0640 63 -8948.3817 12840.9187 64 4605.9290 -8948.3817 65 -2524.5595 4605.9290 66 13365.4328 -2524.5595 67 -10166.8605 13365.4328 68 -989.2907 -10166.8605 69 -2648.1317 -989.2907 70 -10824.3201 -2648.1317 71 12415.4438 -10824.3201 72 -4886.2340 12415.4438 73 -8482.3556 -4886.2340 74 -324.2099 -8482.3556 75 -2989.5172 -324.2099 76 -3162.4939 -2989.5172 77 13238.1361 -3162.4939 78 2702.0980 13238.1361 79 3973.2210 2702.0980 80 -2045.9150 3973.2210 81 -5893.1822 -2045.9150 82 -4537.5609 -5893.1822 83 -5956.2900 -4537.5609 84 -1201.6775 -5956.2900 85 13730.6985 -1201.6775 86 -3470.3460 13730.6985 87 -976.2718 -3470.3460 88 -955.3919 -976.2718 89 -6677.8225 -955.3919 90 1066.0297 -6677.8225 91 6407.4321 1066.0297 92 9443.3999 6407.4321 93 863.2636 9443.3999 94 4147.9996 863.2636 95 -10539.8165 4147.9996 96 8765.7797 -10539.8165 97 -4456.6202 8765.7797 98 -4087.0087 -4456.6202 99 -2002.9928 -4087.0087 100 -4088.8186 -2002.9928 101 5295.0803 -4088.8186 102 7004.4677 5295.0803 103 -2465.1416 7004.4677 104 -3413.6288 -2465.1416 105 -1506.7289 -3413.6288 106 -7343.5582 -1506.7289 107 -2693.4767 -7343.5582 108 -3171.0682 -2693.4767 109 -10065.0548 -3171.0682 110 10066.1800 -10065.0548 111 -3986.8998 10066.1800 112 -4731.7564 -3986.8998 113 2924.4340 -4731.7564 114 -3171.0682 2924.4340 115 -3171.0682 -3171.0682 116 -8757.2639 -3171.0682 117 19841.4958 -8757.2639 118 -2251.3151 19841.4958 119 5084.2571 -2251.3151 120 -657.7354 5084.2571 121 1564.0881 -657.7354 122 -3588.1412 1564.0881 123 -689.7353 -3588.1412 124 9534.6780 -689.7353 125 -4811.0866 9534.6780 126 -5084.1625 -4811.0866 127 -2792.7268 -5084.1625 128 718.4720 -2792.7268 129 -3171.0682 718.4720 130 -3171.0682 -3171.0682 131 13868.6357 -3171.0682 132 -3171.0682 13868.6357 133 3468.7526 -3171.0682 134 -3171.0682 3468.7526 135 -1157.5082 -3171.0682 136 -3171.0682 -1157.5082 137 1152.1086 -3171.0682 138 10203.2500 1152.1086 139 -3171.0682 10203.2500 140 -3171.0682 -3171.0682 141 -5266.2186 -3171.0682 142 -4820.7714 -5266.2186 143 -877.8683 -4820.7714 > 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/www/rcomp/tmp/71i5a1322152731.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/www/rcomp/tmp/8cjsq1322152731.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/www/rcomp/tmp/9hmz41322152731.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/www/rcomp/tmp/101qfo1322152731.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/11x5ll1322152731.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/www/rcomp/tmp/12w4271322152731.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/www/rcomp/tmp/13j9g21322152731.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/www/rcomp/tmp/14jfkk1322152731.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/www/rcomp/tmp/15xpv91322152731.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/www/rcomp/tmp/169n0r1322152731.tab") + } > > try(system("convert tmp/1eyt81322152731.ps tmp/1eyt81322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/2mfqb1322152731.ps tmp/2mfqb1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/3m6pw1322152731.ps tmp/3m6pw1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/4orjh1322152731.ps tmp/4orjh1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/5af691322152731.ps tmp/5af691322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/6iayh1322152731.ps tmp/6iayh1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/71i5a1322152731.ps tmp/71i5a1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/8cjsq1322152731.ps tmp/8cjsq1322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/9hmz41322152731.ps tmp/9hmz41322152731.png",intern=TRUE)) character(0) > try(system("convert tmp/101qfo1322152731.ps tmp/101qfo1322152731.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.876 0.608 13.076