R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(20465 + ,162687 + ,95 + ,39 + ,33629 + ,201906 + ,63 + ,46 + ,1423 + ,7215 + ,18 + ,0 + ,25629 + ,146367 + ,97 + ,54 + ,54002 + ,257045 + ,139 + ,93 + ,151036 + ,524450 + ,266 + ,198 + ,33287 + ,188294 + ,59 + ,42 + ,31172 + ,195674 + ,60 + ,59 + ,28113 + ,177020 + ,45 + ,49 + ,57803 + ,330194 + ,99 + ,83 + ,49830 + ,121844 + ,75 + ,49 + ,52143 + ,203938 + ,72 + ,83 + ,21055 + ,113213 + ,106 + ,39 + ,47007 + ,220751 + ,120 + ,93 + ,28735 + ,173259 + ,65 + ,31 + ,59147 + ,156326 + ,88 + ,29 + ,78950 + ,145178 + ,58 + ,104 + ,13497 + ,89171 + ,61 + ,2 + ,46154 + ,172624 + ,88 + ,46 + ,53249 + ,39790 + ,27 + ,27 + ,10726 + ,87927 + ,62 + ,16 + ,83700 + ,241285 + ,103 + ,108 + ,40400 + ,198587 + ,74 + ,36 + ,33797 + ,146946 + ,57 + ,33 + ,36205 + ,159763 + ,89 + ,46 + ,30165 + ,207078 + ,34 + ,65 + ,58534 + ,212394 + ,166 + ,80 + ,44663 + ,201536 + ,95 + ,81 + ,92556 + ,394662 + ,121 + ,69 + ,40078 + ,217892 + ,46 + ,69 + ,34711 + ,182286 + ,45 + ,37 + ,31076 + ,188748 + ,48 + ,45 + ,74608 + ,137978 + ,107 + ,62 + ,58092 + ,255929 + ,131 + ,33 + ,42009 + ,236489 + ,55 + ,77 + ,0 + ,0 + ,1 + ,0 + ,36022 + ,230761 + ,65 + ,34 + ,23333 + ,132807 + ,54 + ,44 + ,53349 + ,158599 + ,51 + ,43 + ,92596 + ,253254 + ,68 + ,117 + ,49598 + ,269329 + ,72 + ,125 + ,44093 + ,161273 + ,61 + ,49 + ,84205 + ,107181 + ,33 + ,76 + ,63369 + ,213097 + ,81 + ,81 + ,60132 + ,139667 + ,51 + ,111 + ,37403 + ,171101 + ,99 + ,61 + ,24460 + ,81407 + ,33 + ,56 + ,46456 + ,247596 + ,106 + ,54 + ,66616 + ,239807 + ,90 + ,47 + ,41554 + ,172743 + ,60 + ,55 + ,22346 + ,48188 + ,28 + ,14 + ,30874 + ,169355 + ,71 + ,44 + ,68701 + ,325322 + ,77 + ,115 + ,35728 + ,241518 + ,80 + ,57 + ,29010 + ,195583 + ,60 + ,48 + ,23110 + ,159913 + ,57 + ,40 + ,38844 + ,223936 + ,71 + ,51 + ,27084 + ,101694 + ,26 + ,32 + ,35139 + ,157258 + ,68 + ,36 + ,57476 + ,202536 + ,100 + ,47 + ,33277 + ,173505 + ,65 + ,51 + ,31141 + ,150518 + ,84 + ,37 + ,61281 + ,141491 + ,64 + ,52 + ,25820 + ,125612 + ,39 + ,42 + ,23284 + ,166049 + ,36 + ,11 + ,35378 + ,124197 + ,43 + ,47 + ,74990 + ,195043 + ,71 + ,59 + ,29653 + ,138708 + ,66 + ,82 + ,64622 + ,116552 + ,40 + ,49 + ,4157 + ,31970 + ,15 + ,6 + ,29245 + ,258158 + ,115 + ,83 + ,50008 + ,151194 + ,79 + ,56 + ,52338 + ,135926 + ,68 + ,114 + ,13310 + ,119629 + ,73 + ,46 + ,92901 + ,171518 + ,71 + ,46 + ,10956 + ,108949 + ,45 + ,2 + ,34241 + ,183471 + ,60 + ,51 + ,75043 + ,159966 + ,98 + ,96 + ,21152 + ,93786 + ,34 + ,20 + ,42249 + ,84971 + ,72 + ,57 + ,42005 + ,88882 + ,76 + ,49 + ,41152 + ,304603 + ,65 + ,51 + ,14399 + ,75101 + ,30 + ,40 + ,28263 + ,145043 + ,41 + ,40 + ,17215 + ,95827 + ,48 + ,36 + ,48140 + ,173924 + ,59 + ,64 + ,62897 + ,241957 + ,238 + ,117 + ,22883 + ,115367 + ,115 + ,40 + ,41622 + ,118689 + ,65 + ,46 + ,40715 + ,164078 + ,53 + ,61 + ,65897 + ,158931 + ,42 + ,59 + ,76542 + ,184139 + ,83 + ,94 + ,37477 + ,152856 + ,58 + ,36 + ,53216 + ,146159 + ,61 + ,51 + ,40911 + ,62535 + ,43 + ,39 + ,57021 + ,245196 + ,117 + ,62 + ,73116 + ,199841 + ,71 + ,79 + ,3895 + ,19349 + ,12 + ,14 + ,46609 + ,247280 + ,109 + ,45 + ,29351 + ,160833 + ,85 + ,43 + ,2325 + ,72128 + ,30 + ,8 + ,31747 + ,104253 + ,26 + ,41 + ,32665 + ,151090 + ,57 + ,25 + ,19249 + ,146461 + ,67 + ,22 + ,15292 + ,87448 + ,42 + ,18 + ,5842 + ,27676 + ,22 + ,3 + ,33994 + ,170326 + ,52 + ,54 + ,13018 + ,132148 + ,38 + ,6 + ,0 + ,0 + ,0 + ,0 + ,98177 + ,95778 + ,34 + ,50 + ,37941 + ,109001 + ,68 + ,33 + ,31032 + ,158833 + ,46 + ,54 + ,32683 + ,150013 + ,66 + ,63 + ,34545 + ,89887 + ,63 + ,56 + ,0 + ,3616 + ,5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,27525 + ,199005 + ,45 + ,49 + ,66856 + ,160930 + ,93 + ,90 + ,28549 + ,177948 + ,102 + ,51 + ,38610 + ,136061 + ,40 + ,29 + ,2781 + ,43410 + ,19 + ,1 + ,41211 + ,184277 + ,75 + ,68 + ,22698 + ,109873 + ,45 + ,29 + ,41194 + ,151030 + ,59 + ,27 + ,32689 + ,60493 + ,40 + ,4 + ,5752 + ,19764 + ,12 + ,10 + ,26757 + ,177559 + ,56 + ,47 + ,22527 + ,140281 + ,35 + ,44 + ,44810 + ,164249 + ,54 + ,53 + ,0 + ,11796 + ,9 + ,0 + ,0 + ,10674 + ,9 + ,0 + ,100674 + ,151322 + ,59 + ,40 + ,0 + ,6836 + ,3 + ,0 + ,57786 + ,174712 + ,68 + ,57 + ,0 + ,5118 + ,3 + ,0 + ,5444 + ,40248 + ,16 + ,6 + ,0 + ,0 + ,0 + ,0 + ,28470 + ,127628 + ,51 + ,24 + ,61849 + ,88837 + ,38 + ,34 + ,0 + ,7131 + ,4 + ,0 + ,2179 + ,9056 + ,15 + ,10 + ,8019 + ,88589 + ,29 + ,16 + ,39644 + ,144470 + ,53 + ,93 + ,23494 + ,111408 + ,20 + ,28) + ,dim=c(4 + ,144) + ,dimnames=list(c('A' + ,'B' + ,'C' + ,'D') + ,1:144)) > y <- array(NA,dim=c(4,144),dimnames=list(c('A','B','C','D'),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 = '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 A B C D t 1 20465 162687 95 39 1 2 33629 201906 63 46 2 3 1423 7215 18 0 3 4 25629 146367 97 54 4 5 54002 257045 139 93 5 6 151036 524450 266 198 6 7 33287 188294 59 42 7 8 31172 195674 60 59 8 9 28113 177020 45 49 9 10 57803 330194 99 83 10 11 49830 121844 75 49 11 12 52143 203938 72 83 12 13 21055 113213 106 39 13 14 47007 220751 120 93 14 15 28735 173259 65 31 15 16 59147 156326 88 29 16 17 78950 145178 58 104 17 18 13497 89171 61 2 18 19 46154 172624 88 46 19 20 53249 39790 27 27 20 21 10726 87927 62 16 21 22 83700 241285 103 108 22 23 40400 198587 74 36 23 24 33797 146946 57 33 24 25 36205 159763 89 46 25 26 30165 207078 34 65 26 27 58534 212394 166 80 27 28 44663 201536 95 81 28 29 92556 394662 121 69 29 30 40078 217892 46 69 30 31 34711 182286 45 37 31 32 31076 188748 48 45 32 33 74608 137978 107 62 33 34 58092 255929 131 33 34 35 42009 236489 55 77 35 36 0 0 1 0 36 37 36022 230761 65 34 37 38 23333 132807 54 44 38 39 53349 158599 51 43 39 40 92596 253254 68 117 40 41 49598 269329 72 125 41 42 44093 161273 61 49 42 43 84205 107181 33 76 43 44 63369 213097 81 81 44 45 60132 139667 51 111 45 46 37403 171101 99 61 46 47 24460 81407 33 56 47 48 46456 247596 106 54 48 49 66616 239807 90 47 49 50 41554 172743 60 55 50 51 22346 48188 28 14 51 52 30874 169355 71 44 52 53 68701 325322 77 115 53 54 35728 241518 80 57 54 55 29010 195583 60 48 55 56 23110 159913 57 40 56 57 38844 223936 71 51 57 58 27084 101694 26 32 58 59 35139 157258 68 36 59 60 57476 202536 100 47 60 61 33277 173505 65 51 61 62 31141 150518 84 37 62 63 61281 141491 64 52 63 64 25820 125612 39 42 64 65 23284 166049 36 11 65 66 35378 124197 43 47 66 67 74990 195043 71 59 67 68 29653 138708 66 82 68 69 64622 116552 40 49 69 70 4157 31970 15 6 70 71 29245 258158 115 83 71 72 50008 151194 79 56 72 73 52338 135926 68 114 73 74 13310 119629 73 46 74 75 92901 171518 71 46 75 76 10956 108949 45 2 76 77 34241 183471 60 51 77 78 75043 159966 98 96 78 79 21152 93786 34 20 79 80 42249 84971 72 57 80 81 42005 88882 76 49 81 82 41152 304603 65 51 82 83 14399 75101 30 40 83 84 28263 145043 41 40 84 85 17215 95827 48 36 85 86 48140 173924 59 64 86 87 62897 241957 238 117 87 88 22883 115367 115 40 88 89 41622 118689 65 46 89 90 40715 164078 53 61 90 91 65897 158931 42 59 91 92 76542 184139 83 94 92 93 37477 152856 58 36 93 94 53216 146159 61 51 94 95 40911 62535 43 39 95 96 57021 245196 117 62 96 97 73116 199841 71 79 97 98 3895 19349 12 14 98 99 46609 247280 109 45 99 100 29351 160833 85 43 100 101 2325 72128 30 8 101 102 31747 104253 26 41 102 103 32665 151090 57 25 103 104 19249 146461 67 22 104 105 15292 87448 42 18 105 106 5842 27676 22 3 106 107 33994 170326 52 54 107 108 13018 132148 38 6 108 109 0 0 0 0 109 110 98177 95778 34 50 110 111 37941 109001 68 33 111 112 31032 158833 46 54 112 113 32683 150013 66 63 113 114 34545 89887 63 56 114 115 0 3616 5 0 115 116 0 0 0 0 116 117 27525 199005 45 49 117 118 66856 160930 93 90 118 119 28549 177948 102 51 119 120 38610 136061 40 29 120 121 2781 43410 19 1 121 122 41211 184277 75 68 122 123 22698 109873 45 29 123 124 41194 151030 59 27 124 125 32689 60493 40 4 125 126 5752 19764 12 10 126 127 26757 177559 56 47 127 128 22527 140281 35 44 128 129 44810 164249 54 53 129 130 0 11796 9 0 130 131 0 10674 9 0 131 132 100674 151322 59 40 132 133 0 6836 3 0 133 134 57786 174712 68 57 134 135 0 5118 3 0 135 136 5444 40248 16 6 136 137 0 0 0 0 137 138 28470 127628 51 24 138 139 61849 88837 38 34 139 140 0 7131 4 0 140 141 2179 9056 15 10 141 142 8019 88589 29 16 142 143 39644 144470 53 93 143 144 23494 111408 20 28 144 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) B C D t 2.210e+03 6.785e-02 5.783e+01 4.326e+02 2.418e+01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -34750 -9809 -4103 6303 64291 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.210e+03 4.792e+03 0.461 0.6454 B 6.785e-02 2.931e-02 2.315 0.0221 * C 5.783e+01 5.571e+01 1.038 0.3011 D 4.326e+02 6.580e+01 6.574 9.16e-10 *** t 2.418e+01 3.603e+01 0.671 0.5032 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15960 on 139 degrees of freedom Multiple R-squared: 0.6072, Adjusted R-squared: 0.5959 F-statistic: 53.72 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.29848390 0.59696780 0.7015161 [2,] 0.16074957 0.32149913 0.8392504 [3,] 0.07881346 0.15762693 0.9211865 [4,] 0.14248459 0.28496919 0.8575154 [5,] 0.08826945 0.17653890 0.9117305 [6,] 0.07351016 0.14702031 0.9264898 [7,] 0.09262713 0.18525425 0.9073729 [8,] 0.06513343 0.13026686 0.9348666 [9,] 0.21635859 0.43271719 0.7836414 [10,] 0.24899031 0.49798063 0.7510097 [11,] 0.18765095 0.37530190 0.8123491 [12,] 0.13433141 0.26866282 0.8656686 [13,] 0.22590430 0.45180860 0.7740957 [14,] 0.25557574 0.51115147 0.7444243 [15,] 0.20233402 0.40466805 0.7976660 [16,] 0.15417474 0.30834948 0.8458253 [17,] 0.11934007 0.23868015 0.8806599 [18,] 0.10678180 0.21356359 0.8932182 [19,] 0.16244962 0.32489924 0.8375504 [20,] 0.14889733 0.29779466 0.8511027 [21,] 0.16816890 0.33633780 0.8318311 [22,] 0.24765575 0.49531151 0.7523442 [23,] 0.24673005 0.49346010 0.7532699 [24,] 0.20091274 0.40182547 0.7990873 [25,] 0.17775449 0.35550897 0.8222455 [26,] 0.22153232 0.44306464 0.7784677 [27,] 0.19127331 0.38254663 0.8087267 [28,] 0.20177951 0.40355902 0.7982205 [29,] 0.17198672 0.34397345 0.8280133 [30,] 0.14048598 0.28097197 0.8595140 [31,] 0.13982731 0.27965462 0.8601727 [32,] 0.13566062 0.27132125 0.8643394 [33,] 0.13001757 0.26003514 0.8699824 [34,] 0.25939014 0.51878027 0.7406099 [35,] 0.21665643 0.43331285 0.7833436 [36,] 0.40468590 0.80937180 0.5953141 [37,] 0.35607957 0.71215913 0.6439204 [38,] 0.32412409 0.64824817 0.6758759 [39,] 0.33781302 0.67562604 0.6621870 [40,] 0.33105958 0.66211916 0.6689404 [41,] 0.29778605 0.59557210 0.7022140 [42,] 0.30678311 0.61356621 0.6932169 [43,] 0.26757662 0.53515325 0.7324234 [44,] 0.23036695 0.46073391 0.7696330 [45,] 0.21468651 0.42937302 0.7853135 [46,] 0.20110105 0.40220210 0.7988990 [47,] 0.20295030 0.40590060 0.7970497 [48,] 0.19542349 0.39084697 0.8045765 [49,] 0.18731607 0.37463213 0.8126839 [50,] 0.16189596 0.32379191 0.8381040 [51,] 0.13271017 0.26542033 0.8672898 [52,] 0.10745807 0.21491614 0.8925419 [53,] 0.09707642 0.19415284 0.9029236 [54,] 0.08479903 0.16959806 0.9152010 [55,] 0.06977167 0.13954335 0.9302283 [56,] 0.07917702 0.15835404 0.9208230 [57,] 0.06720831 0.13441663 0.9327917 [58,] 0.05249570 0.10499141 0.9475043 [59,] 0.04055600 0.08111200 0.9594440 [60,] 0.06290180 0.12580359 0.9370982 [61,] 0.09265408 0.18530816 0.9073459 [62,] 0.13778351 0.27556702 0.8622165 [63,] 0.11844880 0.23689760 0.8815512 [64,] 0.25477338 0.50954677 0.7452266 [65,] 0.22143544 0.44287088 0.7785646 [66,] 0.22752004 0.45504008 0.7724800 [67,] 0.27591460 0.55182920 0.7240854 [68,] 0.71634391 0.56731219 0.2836561 [69,] 0.67943788 0.64112423 0.3205621 [70,] 0.64859953 0.70280094 0.3514005 [71,] 0.62043601 0.75912798 0.3795640 [72,] 0.57361725 0.85276549 0.4263827 [73,] 0.52681647 0.94636707 0.4731835 [74,] 0.48708049 0.97416099 0.5129195 [75,] 0.46555370 0.93110741 0.5344463 [76,] 0.46039772 0.92079544 0.5396023 [77,] 0.42288878 0.84577755 0.5771112 [78,] 0.40642660 0.81285320 0.5935734 [79,] 0.36204359 0.72408718 0.6379564 [80,] 0.38667815 0.77335631 0.6133218 [81,] 0.37396781 0.74793563 0.6260322 [82,] 0.33027028 0.66054055 0.6697297 [83,] 0.29546927 0.59093854 0.7045307 [84,] 0.32323345 0.64646690 0.6767666 [85,] 0.29823459 0.59646917 0.7017654 [86,] 0.25679399 0.51358799 0.7432060 [87,] 0.23752365 0.47504731 0.7624763 [88,] 0.21923895 0.43847789 0.7807611 [89,] 0.18294819 0.36589638 0.8170518 [90,] 0.18193290 0.36386581 0.8180671 [91,] 0.15656935 0.31313871 0.8434306 [92,] 0.12734799 0.25469598 0.8726520 [93,] 0.11277633 0.22555266 0.8872237 [94,] 0.10076851 0.20153701 0.8992315 [95,] 0.07983550 0.15967101 0.9201645 [96,] 0.06239752 0.12479504 0.9376025 [97,] 0.05269256 0.10538512 0.9473074 [98,] 0.04126142 0.08252284 0.9587386 [99,] 0.03097262 0.06194525 0.9690274 [100,] 0.02453650 0.04907299 0.9754635 [101,] 0.01866250 0.03732499 0.9813375 [102,] 0.01347016 0.02694032 0.9865298 [103,] 0.52748225 0.94503549 0.4725177 [104,] 0.47261227 0.94522453 0.5273877 [105,] 0.42028609 0.84057219 0.5797139 [106,] 0.38090825 0.76181651 0.6190917 [107,] 0.32467420 0.64934840 0.6753258 [108,] 0.27595111 0.55190222 0.7240489 [109,] 0.23872212 0.47744424 0.7612779 [110,] 0.20757708 0.41515416 0.7924229 [111,] 0.19461716 0.38923433 0.8053828 [112,] 0.38440696 0.76881392 0.6155930 [113,] 0.37261121 0.74522242 0.6273888 [114,] 0.30990380 0.61980760 0.6900962 [115,] 0.31795449 0.63590897 0.6820455 [116,] 0.28320734 0.56641468 0.7167927 [117,] 0.24442706 0.48885413 0.7555729 [118,] 0.20171231 0.40342462 0.7982877 [119,] 0.15164873 0.30329745 0.8483513 [120,] 0.19926977 0.39853953 0.8007302 [121,] 0.16968963 0.33937926 0.8303104 [122,] 0.17086456 0.34172912 0.8291354 [123,] 0.14146315 0.28292630 0.8585369 [124,] 0.12476882 0.24953763 0.8752312 [125,] 0.59004327 0.81991346 0.4099567 [126,] 0.47721682 0.95443365 0.5227832 [127,] 0.35425136 0.70850271 0.6457486 [128,] 0.24170800 0.48341600 0.7582920 [129,] 0.17342666 0.34685332 0.8265733 > postscript(file="/var/wessaorg/rcomp/tmp/1n4dh1324566506.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/2g37e1324566506.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/38fdm1324566506.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/4q2am1324566506.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/5mmz21324566506.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 -15170.56482 -5869.09125 -2390.02015 -15575.99010 -14035.02751 12069.00771 7 8 9 10 11 12 -3446.91042 -13498.22898 -10122.75084 -8679.08094 13554.55066 -4260.12341 13 14 15 16 17 18 -12150.22586 -17686.53976 -2761.04751 28310.71465 18138.32436 409.14923 19 20 21 22 23 24 6785.80701 34615.09742 -8463.73295 11914.43817 4308.81882 3466.03855 25 26 27 28 29 30 -2493.54246 -16806.10608 -2943.62102 -12428.96422 26024.26485 -10147.70880 31 32 33 34 35 36 776.74670 -6954.85867 29232.10172 15845.92648 -13580.31871 -3138.45407 37 38 39 40 41 42 -1205.03777 -10961.96553 17886.01024 17693.97771 -30110.66020 5202.38187 43 44 45 46 47 48 38900.04239 5915.33450 -3606.03605 -9639.35104 -10541.71866 -3201.44425 49 50 51 52 53 54 21416.01738 -845.83256 7958.20044 -7222.21800 -11060.24176 -13456.35538 55 56 57 58 59 60 -12032.39459 -11902.50193 -6104.19534 1226.23339 1328.24456 13960.43856 61 62 63 64 65 66 -7999.40944 -3642.81808 21753.51645 -6883.00674 1396.31088 328.49800 67 68 69 70 71 72 28299.74456 -22899.18122 29326.98765 -5377.65514 -34750.05065 7006.89925 73 74 75 76 77 78 -14104.07668 -22925.28718 53236.71461 -3951.03404 -7809.34069 12900.34511 79 80 81 82 83 84 51.10109 3519.64625 6215.32888 -9526.73043 -13950.91175 -5492.49047 85 86 87 88 89 90 -11900.08513 954.23129 -22205.73924 -13235.02665 5550.37559 -4254.82521 91 92 93 94 95 96 22753.42603 14153.28892 3720.98705 13228.21478 12804.27091 2269.03148 97 98 99 100 101 102 16723.45891 -8747.50290 -540.68399 -9704.78473 -12416.40203 758.52196 103 104 105 106 107 108 3603.02523 -8803.67370 -5605.10949 -3378.97123 -8725.04028 -5562.29147 109 110 111 112 113 114 -4845.91337 63214.36009 7444.52836 -10681.23105 -13505.63812 -4387.06419 115 116 117 118 119 120 -5525.47312 -5015.18742 -14814.00588 6565.18688 -16571.01215 9409.39359 121 122 123 124 125 126 -6831.58167 -10203.22729 -5087.53251 10647.48955 19308.60822 -5865.49536 127 128 129 130 131 132 -14139.76577 -13352.71204 2288.16743 -6674.49372 -6622.55231 64290.87776 133 134 135 136 137 138 -6063.55958 11893.54235 -5995.36385 -6306.12546 -5523.00956 932.99020 139 140 141 142 143 144 33345.73309 -6310.67544 -9248.21008 -12233.37292 -19119.22276 -3025.25401 > postscript(file="/var/wessaorg/rcomp/tmp/616321324566506.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 -15170.56482 NA 1 -5869.09125 -15170.56482 2 -2390.02015 -5869.09125 3 -15575.99010 -2390.02015 4 -14035.02751 -15575.99010 5 12069.00771 -14035.02751 6 -3446.91042 12069.00771 7 -13498.22898 -3446.91042 8 -10122.75084 -13498.22898 9 -8679.08094 -10122.75084 10 13554.55066 -8679.08094 11 -4260.12341 13554.55066 12 -12150.22586 -4260.12341 13 -17686.53976 -12150.22586 14 -2761.04751 -17686.53976 15 28310.71465 -2761.04751 16 18138.32436 28310.71465 17 409.14923 18138.32436 18 6785.80701 409.14923 19 34615.09742 6785.80701 20 -8463.73295 34615.09742 21 11914.43817 -8463.73295 22 4308.81882 11914.43817 23 3466.03855 4308.81882 24 -2493.54246 3466.03855 25 -16806.10608 -2493.54246 26 -2943.62102 -16806.10608 27 -12428.96422 -2943.62102 28 26024.26485 -12428.96422 29 -10147.70880 26024.26485 30 776.74670 -10147.70880 31 -6954.85867 776.74670 32 29232.10172 -6954.85867 33 15845.92648 29232.10172 34 -13580.31871 15845.92648 35 -3138.45407 -13580.31871 36 -1205.03777 -3138.45407 37 -10961.96553 -1205.03777 38 17886.01024 -10961.96553 39 17693.97771 17886.01024 40 -30110.66020 17693.97771 41 5202.38187 -30110.66020 42 38900.04239 5202.38187 43 5915.33450 38900.04239 44 -3606.03605 5915.33450 45 -9639.35104 -3606.03605 46 -10541.71866 -9639.35104 47 -3201.44425 -10541.71866 48 21416.01738 -3201.44425 49 -845.83256 21416.01738 50 7958.20044 -845.83256 51 -7222.21800 7958.20044 52 -11060.24176 -7222.21800 53 -13456.35538 -11060.24176 54 -12032.39459 -13456.35538 55 -11902.50193 -12032.39459 56 -6104.19534 -11902.50193 57 1226.23339 -6104.19534 58 1328.24456 1226.23339 59 13960.43856 1328.24456 60 -7999.40944 13960.43856 61 -3642.81808 -7999.40944 62 21753.51645 -3642.81808 63 -6883.00674 21753.51645 64 1396.31088 -6883.00674 65 328.49800 1396.31088 66 28299.74456 328.49800 67 -22899.18122 28299.74456 68 29326.98765 -22899.18122 69 -5377.65514 29326.98765 70 -34750.05065 -5377.65514 71 7006.89925 -34750.05065 72 -14104.07668 7006.89925 73 -22925.28718 -14104.07668 74 53236.71461 -22925.28718 75 -3951.03404 53236.71461 76 -7809.34069 -3951.03404 77 12900.34511 -7809.34069 78 51.10109 12900.34511 79 3519.64625 51.10109 80 6215.32888 3519.64625 81 -9526.73043 6215.32888 82 -13950.91175 -9526.73043 83 -5492.49047 -13950.91175 84 -11900.08513 -5492.49047 85 954.23129 -11900.08513 86 -22205.73924 954.23129 87 -13235.02665 -22205.73924 88 5550.37559 -13235.02665 89 -4254.82521 5550.37559 90 22753.42603 -4254.82521 91 14153.28892 22753.42603 92 3720.98705 14153.28892 93 13228.21478 3720.98705 94 12804.27091 13228.21478 95 2269.03148 12804.27091 96 16723.45891 2269.03148 97 -8747.50290 16723.45891 98 -540.68399 -8747.50290 99 -9704.78473 -540.68399 100 -12416.40203 -9704.78473 101 758.52196 -12416.40203 102 3603.02523 758.52196 103 -8803.67370 3603.02523 104 -5605.10949 -8803.67370 105 -3378.97123 -5605.10949 106 -8725.04028 -3378.97123 107 -5562.29147 -8725.04028 108 -4845.91337 -5562.29147 109 63214.36009 -4845.91337 110 7444.52836 63214.36009 111 -10681.23105 7444.52836 112 -13505.63812 -10681.23105 113 -4387.06419 -13505.63812 114 -5525.47312 -4387.06419 115 -5015.18742 -5525.47312 116 -14814.00588 -5015.18742 117 6565.18688 -14814.00588 118 -16571.01215 6565.18688 119 9409.39359 -16571.01215 120 -6831.58167 9409.39359 121 -10203.22729 -6831.58167 122 -5087.53251 -10203.22729 123 10647.48955 -5087.53251 124 19308.60822 10647.48955 125 -5865.49536 19308.60822 126 -14139.76577 -5865.49536 127 -13352.71204 -14139.76577 128 2288.16743 -13352.71204 129 -6674.49372 2288.16743 130 -6622.55231 -6674.49372 131 64290.87776 -6622.55231 132 -6063.55958 64290.87776 133 11893.54235 -6063.55958 134 -5995.36385 11893.54235 135 -6306.12546 -5995.36385 136 -5523.00956 -6306.12546 137 932.99020 -5523.00956 138 33345.73309 932.99020 139 -6310.67544 33345.73309 140 -9248.21008 -6310.67544 141 -12233.37292 -9248.21008 142 -19119.22276 -12233.37292 143 -3025.25401 -19119.22276 144 NA -3025.25401 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5869.09125 -15170.56482 [2,] -2390.02015 -5869.09125 [3,] -15575.99010 -2390.02015 [4,] -14035.02751 -15575.99010 [5,] 12069.00771 -14035.02751 [6,] -3446.91042 12069.00771 [7,] -13498.22898 -3446.91042 [8,] -10122.75084 -13498.22898 [9,] -8679.08094 -10122.75084 [10,] 13554.55066 -8679.08094 [11,] -4260.12341 13554.55066 [12,] -12150.22586 -4260.12341 [13,] -17686.53976 -12150.22586 [14,] -2761.04751 -17686.53976 [15,] 28310.71465 -2761.04751 [16,] 18138.32436 28310.71465 [17,] 409.14923 18138.32436 [18,] 6785.80701 409.14923 [19,] 34615.09742 6785.80701 [20,] -8463.73295 34615.09742 [21,] 11914.43817 -8463.73295 [22,] 4308.81882 11914.43817 [23,] 3466.03855 4308.81882 [24,] -2493.54246 3466.03855 [25,] -16806.10608 -2493.54246 [26,] -2943.62102 -16806.10608 [27,] -12428.96422 -2943.62102 [28,] 26024.26485 -12428.96422 [29,] -10147.70880 26024.26485 [30,] 776.74670 -10147.70880 [31,] -6954.85867 776.74670 [32,] 29232.10172 -6954.85867 [33,] 15845.92648 29232.10172 [34,] -13580.31871 15845.92648 [35,] -3138.45407 -13580.31871 [36,] -1205.03777 -3138.45407 [37,] -10961.96553 -1205.03777 [38,] 17886.01024 -10961.96553 [39,] 17693.97771 17886.01024 [40,] -30110.66020 17693.97771 [41,] 5202.38187 -30110.66020 [42,] 38900.04239 5202.38187 [43,] 5915.33450 38900.04239 [44,] -3606.03605 5915.33450 [45,] -9639.35104 -3606.03605 [46,] -10541.71866 -9639.35104 [47,] -3201.44425 -10541.71866 [48,] 21416.01738 -3201.44425 [49,] -845.83256 21416.01738 [50,] 7958.20044 -845.83256 [51,] -7222.21800 7958.20044 [52,] -11060.24176 -7222.21800 [53,] -13456.35538 -11060.24176 [54,] -12032.39459 -13456.35538 [55,] -11902.50193 -12032.39459 [56,] -6104.19534 -11902.50193 [57,] 1226.23339 -6104.19534 [58,] 1328.24456 1226.23339 [59,] 13960.43856 1328.24456 [60,] -7999.40944 13960.43856 [61,] -3642.81808 -7999.40944 [62,] 21753.51645 -3642.81808 [63,] -6883.00674 21753.51645 [64,] 1396.31088 -6883.00674 [65,] 328.49800 1396.31088 [66,] 28299.74456 328.49800 [67,] -22899.18122 28299.74456 [68,] 29326.98765 -22899.18122 [69,] -5377.65514 29326.98765 [70,] -34750.05065 -5377.65514 [71,] 7006.89925 -34750.05065 [72,] -14104.07668 7006.89925 [73,] -22925.28718 -14104.07668 [74,] 53236.71461 -22925.28718 [75,] -3951.03404 53236.71461 [76,] -7809.34069 -3951.03404 [77,] 12900.34511 -7809.34069 [78,] 51.10109 12900.34511 [79,] 3519.64625 51.10109 [80,] 6215.32888 3519.64625 [81,] -9526.73043 6215.32888 [82,] -13950.91175 -9526.73043 [83,] -5492.49047 -13950.91175 [84,] -11900.08513 -5492.49047 [85,] 954.23129 -11900.08513 [86,] -22205.73924 954.23129 [87,] -13235.02665 -22205.73924 [88,] 5550.37559 -13235.02665 [89,] -4254.82521 5550.37559 [90,] 22753.42603 -4254.82521 [91,] 14153.28892 22753.42603 [92,] 3720.98705 14153.28892 [93,] 13228.21478 3720.98705 [94,] 12804.27091 13228.21478 [95,] 2269.03148 12804.27091 [96,] 16723.45891 2269.03148 [97,] -8747.50290 16723.45891 [98,] -540.68399 -8747.50290 [99,] -9704.78473 -540.68399 [100,] -12416.40203 -9704.78473 [101,] 758.52196 -12416.40203 [102,] 3603.02523 758.52196 [103,] -8803.67370 3603.02523 [104,] -5605.10949 -8803.67370 [105,] -3378.97123 -5605.10949 [106,] -8725.04028 -3378.97123 [107,] -5562.29147 -8725.04028 [108,] -4845.91337 -5562.29147 [109,] 63214.36009 -4845.91337 [110,] 7444.52836 63214.36009 [111,] -10681.23105 7444.52836 [112,] -13505.63812 -10681.23105 [113,] -4387.06419 -13505.63812 [114,] -5525.47312 -4387.06419 [115,] -5015.18742 -5525.47312 [116,] -14814.00588 -5015.18742 [117,] 6565.18688 -14814.00588 [118,] -16571.01215 6565.18688 [119,] 9409.39359 -16571.01215 [120,] -6831.58167 9409.39359 [121,] -10203.22729 -6831.58167 [122,] -5087.53251 -10203.22729 [123,] 10647.48955 -5087.53251 [124,] 19308.60822 10647.48955 [125,] -5865.49536 19308.60822 [126,] -14139.76577 -5865.49536 [127,] -13352.71204 -14139.76577 [128,] 2288.16743 -13352.71204 [129,] -6674.49372 2288.16743 [130,] -6622.55231 -6674.49372 [131,] 64290.87776 -6622.55231 [132,] -6063.55958 64290.87776 [133,] 11893.54235 -6063.55958 [134,] -5995.36385 11893.54235 [135,] -6306.12546 -5995.36385 [136,] -5523.00956 -6306.12546 [137,] 932.99020 -5523.00956 [138,] 33345.73309 932.99020 [139,] -6310.67544 33345.73309 [140,] -9248.21008 -6310.67544 [141,] -12233.37292 -9248.21008 [142,] -19119.22276 -12233.37292 [143,] -3025.25401 -19119.22276 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5869.09125 -15170.56482 2 -2390.02015 -5869.09125 3 -15575.99010 -2390.02015 4 -14035.02751 -15575.99010 5 12069.00771 -14035.02751 6 -3446.91042 12069.00771 7 -13498.22898 -3446.91042 8 -10122.75084 -13498.22898 9 -8679.08094 -10122.75084 10 13554.55066 -8679.08094 11 -4260.12341 13554.55066 12 -12150.22586 -4260.12341 13 -17686.53976 -12150.22586 14 -2761.04751 -17686.53976 15 28310.71465 -2761.04751 16 18138.32436 28310.71465 17 409.14923 18138.32436 18 6785.80701 409.14923 19 34615.09742 6785.80701 20 -8463.73295 34615.09742 21 11914.43817 -8463.73295 22 4308.81882 11914.43817 23 3466.03855 4308.81882 24 -2493.54246 3466.03855 25 -16806.10608 -2493.54246 26 -2943.62102 -16806.10608 27 -12428.96422 -2943.62102 28 26024.26485 -12428.96422 29 -10147.70880 26024.26485 30 776.74670 -10147.70880 31 -6954.85867 776.74670 32 29232.10172 -6954.85867 33 15845.92648 29232.10172 34 -13580.31871 15845.92648 35 -3138.45407 -13580.31871 36 -1205.03777 -3138.45407 37 -10961.96553 -1205.03777 38 17886.01024 -10961.96553 39 17693.97771 17886.01024 40 -30110.66020 17693.97771 41 5202.38187 -30110.66020 42 38900.04239 5202.38187 43 5915.33450 38900.04239 44 -3606.03605 5915.33450 45 -9639.35104 -3606.03605 46 -10541.71866 -9639.35104 47 -3201.44425 -10541.71866 48 21416.01738 -3201.44425 49 -845.83256 21416.01738 50 7958.20044 -845.83256 51 -7222.21800 7958.20044 52 -11060.24176 -7222.21800 53 -13456.35538 -11060.24176 54 -12032.39459 -13456.35538 55 -11902.50193 -12032.39459 56 -6104.19534 -11902.50193 57 1226.23339 -6104.19534 58 1328.24456 1226.23339 59 13960.43856 1328.24456 60 -7999.40944 13960.43856 61 -3642.81808 -7999.40944 62 21753.51645 -3642.81808 63 -6883.00674 21753.51645 64 1396.31088 -6883.00674 65 328.49800 1396.31088 66 28299.74456 328.49800 67 -22899.18122 28299.74456 68 29326.98765 -22899.18122 69 -5377.65514 29326.98765 70 -34750.05065 -5377.65514 71 7006.89925 -34750.05065 72 -14104.07668 7006.89925 73 -22925.28718 -14104.07668 74 53236.71461 -22925.28718 75 -3951.03404 53236.71461 76 -7809.34069 -3951.03404 77 12900.34511 -7809.34069 78 51.10109 12900.34511 79 3519.64625 51.10109 80 6215.32888 3519.64625 81 -9526.73043 6215.32888 82 -13950.91175 -9526.73043 83 -5492.49047 -13950.91175 84 -11900.08513 -5492.49047 85 954.23129 -11900.08513 86 -22205.73924 954.23129 87 -13235.02665 -22205.73924 88 5550.37559 -13235.02665 89 -4254.82521 5550.37559 90 22753.42603 -4254.82521 91 14153.28892 22753.42603 92 3720.98705 14153.28892 93 13228.21478 3720.98705 94 12804.27091 13228.21478 95 2269.03148 12804.27091 96 16723.45891 2269.03148 97 -8747.50290 16723.45891 98 -540.68399 -8747.50290 99 -9704.78473 -540.68399 100 -12416.40203 -9704.78473 101 758.52196 -12416.40203 102 3603.02523 758.52196 103 -8803.67370 3603.02523 104 -5605.10949 -8803.67370 105 -3378.97123 -5605.10949 106 -8725.04028 -3378.97123 107 -5562.29147 -8725.04028 108 -4845.91337 -5562.29147 109 63214.36009 -4845.91337 110 7444.52836 63214.36009 111 -10681.23105 7444.52836 112 -13505.63812 -10681.23105 113 -4387.06419 -13505.63812 114 -5525.47312 -4387.06419 115 -5015.18742 -5525.47312 116 -14814.00588 -5015.18742 117 6565.18688 -14814.00588 118 -16571.01215 6565.18688 119 9409.39359 -16571.01215 120 -6831.58167 9409.39359 121 -10203.22729 -6831.58167 122 -5087.53251 -10203.22729 123 10647.48955 -5087.53251 124 19308.60822 10647.48955 125 -5865.49536 19308.60822 126 -14139.76577 -5865.49536 127 -13352.71204 -14139.76577 128 2288.16743 -13352.71204 129 -6674.49372 2288.16743 130 -6622.55231 -6674.49372 131 64290.87776 -6622.55231 132 -6063.55958 64290.87776 133 11893.54235 -6063.55958 134 -5995.36385 11893.54235 135 -6306.12546 -5995.36385 136 -5523.00956 -6306.12546 137 932.99020 -5523.00956 138 33345.73309 932.99020 139 -6310.67544 33345.73309 140 -9248.21008 -6310.67544 141 -12233.37292 -9248.21008 142 -19119.22276 -12233.37292 143 -3025.25401 -19119.22276 > 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/7ow1t1324566506.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/8h3p51324566506.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/983np1324566506.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/106v3f1324566506.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/11ah111324566506.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/12jbn61324566506.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/13ym8z1324566506.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/14sc1g1324566506.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/1583aq1324566506.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/167zwf1324566506.tab") + } > > try(system("convert tmp/1n4dh1324566506.ps tmp/1n4dh1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/2g37e1324566506.ps tmp/2g37e1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/38fdm1324566506.ps tmp/38fdm1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/4q2am1324566506.ps tmp/4q2am1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/5mmz21324566506.ps tmp/5mmz21324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/616321324566506.ps tmp/616321324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/7ow1t1324566506.ps tmp/7ow1t1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/8h3p51324566506.ps tmp/8h3p51324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/983np1324566506.ps tmp/983np1324566506.png",intern=TRUE)) character(0) > try(system("convert tmp/106v3f1324566506.ps tmp/106v3f1324566506.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.463 0.643 5.132