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(2.7 + ,8.4 + ,4.3 + ,1.5 + ,2.2 + ,2.1 + ,2.5 + ,7.5 + ,3.1 + ,1.7 + ,2.3 + ,2.2 + ,2.2 + ,4.0 + ,5.7 + ,1.6 + ,2.1 + ,2.2 + ,2.9 + ,8.5 + ,6.7 + ,1.7 + ,2.8 + ,2.7 + ,3.1 + ,7.6 + ,9.5 + ,1.8 + ,3.1 + ,3.1 + ,3.0 + ,5.5 + ,9.0 + ,1.7 + ,2.9 + ,3.2 + ,2.8 + ,3.3 + ,6.9 + ,2.2 + ,2.6 + ,3.1 + ,2.5 + ,1.4 + ,7.5 + ,2.7 + ,2.7 + ,3.1 + ,1.9 + ,-4.4 + ,7.0 + ,3.0 + ,2.3 + ,2.8 + ,1.9 + ,-6.5 + ,9.3 + ,2.8 + ,2.3 + ,3.0 + ,1.8 + ,-8.5 + ,7.2 + ,2.7 + ,2.1 + ,2.8 + ,2.0 + ,-6.7 + ,6.6 + ,2.7 + ,2.2 + ,2.7 + ,2.6 + ,-3.3 + ,10.4 + ,2.5 + ,2.9 + ,3.2 + ,2.5 + ,-5.1 + ,8.7 + ,2.0 + ,2.6 + ,3.1 + ,2.5 + ,-3.5 + ,7.9 + ,1.8 + ,2.7 + ,3.0 + ,1.6 + ,-3.6 + ,4.1 + ,1.4 + ,1.8 + ,2.0 + ,1.4 + ,-6.3 + ,2.2 + ,1.5 + ,1.3 + ,1.7 + ,0.8 + ,-8.0 + ,-0.5 + ,1.6 + ,0.9 + ,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.2 + ,2.0 + ,2.8 + ,3.1 + ,2.3 + ,2.3 + ,2.2 + ,2.6 + ,5.6 + ,4.5 + ,2.7 + ,2.9 + ,2.6 + ,2.6 + ,4.8 + ,4.6 + ,3.0 + ,2.8 + ,2.4 + ,2.6 + ,4.5 + ,5.7 + ,3.3 + ,2.8 + ,2.5 + ,2.2 + ,1.5 + ,4.3 + ,3.2 + ,2.3 + ,2.2) + ,dim=c(6 + ,143) + ,dimnames=list(c('HICP' + ,'Energiedragers' + ,'Niet-bewerkte_levensmiddelen' + ,'Bewerkte_levensmiddelen' + ,'Algemene_index' + ,'Gezondheidsindex') + ,1:143)) > y <- array(NA,dim=c(6,143),dimnames=list(c('HICP','Energiedragers','Niet-bewerkte_levensmiddelen','Bewerkte_levensmiddelen','Algemene_index','Gezondheidsindex'),1:143)) > 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' > 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 HICP Energiedragers Niet-bewerkte_levensmiddelen Bewerkte_levensmiddelen 1 2.7 8.4 4.3 1.5 2 2.5 7.5 3.1 1.7 3 2.2 4.0 5.7 1.6 4 2.9 8.5 6.7 1.7 5 3.1 7.6 9.5 1.8 6 3.0 5.5 9.0 1.7 7 2.8 3.3 6.9 2.2 8 2.5 1.4 7.5 2.7 9 1.9 -4.4 7.0 3.0 10 1.9 -6.5 9.3 2.8 11 1.8 -8.5 7.2 2.7 12 2.0 -6.7 6.6 2.7 13 2.6 -3.3 10.4 2.5 14 2.5 -5.1 8.7 2.0 15 2.5 -3.5 7.9 1.8 16 1.6 -3.6 4.1 1.4 17 1.4 -6.3 2.2 1.5 18 0.8 -8.0 -0.5 1.6 19 1.1 -5.3 1.7 1.3 20 1.3 -4.0 0.4 1.1 21 1.2 -4.0 2.6 0.8 22 1.3 0.1 0.7 1.1 23 1.1 -0.9 0.7 1.3 24 1.3 1.1 0.5 1.5 25 1.2 3.1 -2.3 1.8 26 1.6 5.7 0.3 2.7 27 1.7 6.2 -0.2 3.0 28 1.5 -2.2 0.6 3.2 29 0.9 -4.2 -0.6 3.2 30 1.5 -1.6 2.7 3.3 31 1.4 -1.9 2.3 3.2 32 1.6 0.2 4.3 2.9 33 1.7 -1.2 5.4 2.7 34 1.4 -2.4 2.6 2.6 35 1.8 0.8 2.9 2.3 36 1.7 -0.1 2.9 2.2 37 1.4 -1.5 2.9 2.1 38 1.2 -4.4 1.4 2.4 39 1.0 -4.2 1.1 2.5 40 1.7 3.5 1.9 2.4 41 2.4 10.0 2.8 2.3 42 2.0 8.6 1.4 2.1 43 2.1 9.5 0.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.5 2.7 100 0.7 -13.0 1.8 2.3 101 -0.2 -17.6 0.6 1.8 102 -1.0 -21.7 -0.4 1.5 103 -1.7 -23.2 -2.5 1.2 104 -0.7 -16.8 -1.6 1.0 105 -1.0 -19.8 -1.9 0.9 106 -0.9 -17.2 -1.6 0.6 107 0.0 -10.4 -0.7 0.6 108 0.3 -6.8 -1.1 0.7 109 0.8 -2.9 0.3 0.5 110 0.8 -1.9 1.3 0.5 111 1.9 7.0 3.3 0.5 112 2.1 9.8 2.4 0.5 113 2.5 12.5 2.0 0.8 114 2.7 13.7 3.9 0.8 115 2.4 13.7 4.2 1.1 116 2.4 9.7 4.9 1.2 117 2.9 14.0 5.8 1.5 118 3.1 15.3 4.8 1.7 119 3.0 13.4 4.4 1.8 120 3.4 17.1 5.3 1.8 121 3.7 15.7 2.1 2.1 122 3.5 18.3 2.0 2.2 123 3.5 18.1 -0.9 2.5 124 3.3 16.3 0.1 2.7 125 3.1 15.8 -0.5 3.0 126 3.4 17.3 -0.1 3.4 127 4.0 18.0 0.7 3.4 128 3.4 17.6 -0.4 3.5 129 3.4 18.4 -1.5 3.5 130 3.4 17.4 -0.3 3.4 131 3.7 17.9 1.0 3.6 132 3.2 13.5 0.4 3.8 133 3.3 13.7 0.3 3.5 134 3.3 12.6 1.8 3.5 135 3.1 10.4 3.0 3.5 136 2.9 8.8 2.2 3.2 137 2.6 5.4 3.4 2.9 138 2.2 2.1 3.4 2.5 139 2.0 2.8 3.1 2.3 140 2.6 5.6 4.5 2.7 141 2.6 4.8 4.6 3.0 142 2.6 4.5 5.7 3.3 143 2.2 1.5 4.3 3.2 Algemene_index Gezondheidsindex 1 2.2 2.1 2 2.3 2.2 3 2.1 2.2 4 2.8 2.7 5 3.1 3.1 6 2.9 3.2 7 2.6 3.1 8 2.7 3.1 9 2.3 2.8 10 2.3 3.0 11 2.1 2.8 12 2.2 2.7 13 2.9 3.2 14 2.6 3.1 15 2.7 3.0 16 1.8 2.0 17 1.3 1.7 18 0.9 1.2 19 1.3 1.4 20 1.3 1.3 21 1.3 1.3 22 1.3 1.1 23 1.1 0.9 24 1.4 1.2 25 1.2 0.9 26 1.7 1.3 27 1.8 1.4 28 1.5 1.5 29 1.0 1.1 30 1.6 1.6 31 1.5 1.5 32 1.8 1.6 33 1.8 1.7 34 1.6 1.6 35 1.9 1.7 36 1.7 1.6 37 1.6 1.6 38 1.3 1.3 39 1.1 1.1 40 1.9 1.6 41 2.6 1.9 42 2.3 1.6 43 2.4 1.7 44 2.2 1.6 45 2.0 1.4 46 2.9 2.1 47 2.6 1.9 48 2.3 1.7 49 2.3 1.8 50 2.6 2.0 51 3.1 2.5 52 2.8 2.1 53 2.5 2.1 54 2.9 2.3 55 3.1 2.4 56 3.1 2.4 57 3.2 2.3 58 2.5 1.7 59 2.6 2.0 60 2.9 2.3 61 2.6 2.0 62 2.4 2.0 63 1.7 1.3 64 2.0 1.7 65 2.2 1.9 66 1.9 1.7 67 1.6 1.6 68 1.6 1.7 69 1.2 1.8 70 1.2 1.9 71 1.5 1.9 72 1.6 1.9 73 1.7 2.0 74 1.8 2.1 75 1.8 1.9 76 1.8 1.9 77 1.3 1.3 78 1.3 1.3 79 1.4 1.4 80 1.1 1.2 81 1.5 1.3 82 2.2 1.8 83 2.9 2.2 84 3.1 2.6 85 3.5 2.8 86 3.6 3.1 87 4.4 3.9 88 4.2 3.7 89 5.2 4.6 90 5.8 5.1 91 5.9 5.2 92 5.4 4.9 93 5.5 5.1 94 4.7 4.8 95 3.1 3.9 96 2.6 3.5 97 2.3 3.3 98 1.9 2.8 99 0.6 1.6 100 0.6 1.5 101 -0.4 0.7 102 -1.1 -0.1 103 -1.7 -0.7 104 -0.8 -0.2 105 -1.2 -0.6 106 -1.0 -0.6 107 -0.1 -0.3 108 0.3 -0.3 109 0.6 -0.1 110 0.7 0.1 111 1.7 0.9 112 1.8 1.1 113 2.3 1.6 114 2.5 2.0 115 2.6 2.2 116 2.3 2.1 117 2.9 2.6 118 3.0 2.5 119 2.9 2.5 120 3.1 2.6 121 3.2 2.7 122 3.4 2.8 123 3.5 2.9 124 3.4 2.9 125 3.3 2.9 126 3.7 3.3 127 3.8 3.3 128 3.6 3.1 129 3.6 3.0 130 3.6 3.1 131 3.8 3.4 132 3.5 3.2 133 3.6 3.4 134 3.7 3.4 135 3.4 3.1 136 3.2 3.0 137 2.8 2.7 138 2.3 2.2 139 2.3 2.2 140 2.9 2.6 141 2.8 2.4 142 2.8 2.5 143 2.3 2.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Energiedragers 0.55390 0.05922 `Niet-bewerkte_levensmiddelen` Bewerkte_levensmiddelen 0.04375 0.04194 Algemene_index Gezondheidsindex 0.17513 0.34990 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.43502 -0.08843 -0.00549 0.09634 0.53133 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.553905 0.050367 10.997 < 2e-16 *** Energiedragers 0.059215 0.004754 12.456 < 2e-16 *** `Niet-bewerkte_levensmiddelen` 0.043754 0.007371 5.936 2.28e-08 *** Bewerkte_levensmiddelen 0.041936 0.010629 3.945 0.000127 *** Algemene_index 0.175129 0.069894 2.506 0.013394 * Gezondheidsindex 0.349897 0.052636 6.648 6.50e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.1674 on 137 degrees of freedom Multiple R-squared: 0.9821, Adjusted R-squared: 0.9814 F-statistic: 1500 on 5 and 137 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.1420175710 0.2840351421 0.8579824290 [2,] 0.0749237630 0.1498475259 0.9250762370 [3,] 0.1100000969 0.2200001938 0.8899999031 [4,] 0.1331796974 0.2663593948 0.8668203026 [5,] 0.1123683352 0.2247366705 0.8876316648 [6,] 0.0667418174 0.1334836349 0.9332581826 [7,] 0.0642611187 0.1285222374 0.9357388813 [8,] 0.1486014787 0.2972029574 0.8513985213 [9,] 0.1149884979 0.2299769958 0.8850115021 [10,] 0.0872841478 0.1745682956 0.9127158522 [11,] 0.0794945632 0.1589891265 0.9205054368 [12,] 0.0558601247 0.1117202493 0.9441398753 [13,] 0.0384117446 0.0768234892 0.9615882554 [14,] 0.0238503280 0.0477006560 0.9761496720 [15,] 0.0157693080 0.0315386161 0.9842306920 [16,] 0.0122770702 0.0245541403 0.9877229298 [17,] 0.0074241785 0.0148483569 0.9925758215 [18,] 0.0050520976 0.0101041951 0.9949479024 [19,] 0.0032118680 0.0064237360 0.9967881320 [20,] 0.0158399766 0.0316799532 0.9841600234 [21,] 0.0127851874 0.0255703749 0.9872148126 [22,] 0.0126976287 0.0253952574 0.9873023713 [23,] 0.0099531072 0.0199062143 0.9900468928 [24,] 0.0065771103 0.0131542206 0.9934228897 [25,] 0.0055744552 0.0111489103 0.9944255448 [26,] 0.0035101848 0.0070203695 0.9964898152 [27,] 0.0022325340 0.0044650680 0.9977674660 [28,] 0.0016889864 0.0033779727 0.9983110136 [29,] 0.0013803317 0.0027606633 0.9986196683 [30,] 0.0009809701 0.0019619402 0.9990190299 [31,] 0.0005911139 0.0011822278 0.9994088861 [32,] 0.0005704495 0.0011408991 0.9994295505 [33,] 0.0004123970 0.0008247939 0.9995876030 [34,] 0.0005120600 0.0010241201 0.9994879400 [35,] 0.0004524323 0.0009048647 0.9995475677 [36,] 0.0003816113 0.0007632225 0.9996183887 [37,] 0.0003796191 0.0007592382 0.9996203809 [38,] 0.0002556196 0.0005112391 0.9997443804 [39,] 0.0003547984 0.0007095969 0.9996452016 [40,] 0.0033878098 0.0067756196 0.9966121902 [41,] 0.0030232679 0.0060465359 0.9969767321 [42,] 0.0052194485 0.0104388969 0.9947805515 [43,] 0.0048493670 0.0096987339 0.9951506330 [44,] 0.0200222318 0.0400444636 0.9799777682 [45,] 0.0187969016 0.0375938033 0.9812030984 [46,] 0.0166919696 0.0333839393 0.9833080304 [47,] 0.0496226870 0.0992453739 0.9503773130 [48,] 0.0464726977 0.0929453954 0.9535273023 [49,] 0.0524728787 0.1049457574 0.9475271213 [50,] 0.0484091765 0.0968183530 0.9515908235 [51,] 0.0418334552 0.0836669103 0.9581665448 [52,] 0.0448128465 0.0896256931 0.9551871535 [53,] 0.0438340754 0.0876681508 0.9561659246 [54,] 0.0527815746 0.1055631491 0.9472184254 [55,] 0.0549510704 0.1099021408 0.9450489296 [56,] 0.1317054696 0.2634109393 0.8682945304 [57,] 0.1759549375 0.3519098751 0.8240450625 [58,] 0.2491793521 0.4983587041 0.7508206479 [59,] 0.4845821678 0.9691643356 0.5154178322 [60,] 0.5781756903 0.8436486195 0.4218243097 [61,] 0.6333278891 0.7333442219 0.3666721109 [62,] 0.6988133419 0.6023733163 0.3011866581 [63,] 0.6782073271 0.6435853458 0.3217926729 [64,] 0.6771321811 0.6457356379 0.3228678189 [65,] 0.6658868761 0.6682262478 0.3341131239 [66,] 0.6330992977 0.7338014047 0.3669007023 [67,] 0.6445645861 0.7108708279 0.3554354139 [68,] 0.6561176327 0.6877647347 0.3438823673 [69,] 0.6531409821 0.6937180359 0.3468590179 [70,] 0.6231204755 0.7537590490 0.3768795245 [71,] 0.5990539373 0.8018921253 0.4009460627 [72,] 0.5835150591 0.8329698818 0.4164849409 [73,] 0.5836204065 0.8327591871 0.4163795935 [74,] 0.6735527501 0.6528944997 0.3264472499 [75,] 0.7917394500 0.4165210999 0.2082605500 [76,] 0.8265872741 0.3468254518 0.1734127259 [77,] 0.8287195441 0.3425609118 0.1712804559 [78,] 0.7976300134 0.4047399732 0.2023699866 [79,] 0.7599102610 0.4801794780 0.2400897390 [80,] 0.7808375182 0.4383249636 0.2191624818 [81,] 0.7878933459 0.4242133082 0.2121066541 [82,] 0.7588785779 0.4822428443 0.2411214221 [83,] 0.7298602956 0.5402794088 0.2701397044 [84,] 0.7039054862 0.5921890277 0.2960945138 [85,] 0.6629930059 0.6740139882 0.3370069941 [86,] 0.6400420882 0.7199158237 0.3599579118 [87,] 0.6824465647 0.6351068707 0.3175534353 [88,] 0.7407905309 0.5184189382 0.2592094691 [89,] 0.8105042786 0.3789914428 0.1894957214 [90,] 0.7946316666 0.4107366669 0.2053683334 [91,] 0.7728718358 0.4542563283 0.2271281642 [92,] 0.7995420541 0.4009158918 0.2004579459 [93,] 0.8291876703 0.3416246594 0.1708123297 [94,] 0.8116743386 0.3766513228 0.1883256614 [95,] 0.8155482496 0.3689035009 0.1844517504 [96,] 0.7758109481 0.4483781038 0.2241890519 [97,] 0.7751200003 0.4497599994 0.2248799997 [98,] 0.7565376629 0.4869246741 0.2434623371 [99,] 0.7737497334 0.4525005333 0.2262502666 [100,] 0.7568401995 0.4863196010 0.2431598005 [101,] 0.7608979969 0.4782040062 0.2391020031 [102,] 0.7165141507 0.5669716986 0.2834858493 [103,] 0.6823413962 0.6353172076 0.3176586038 [104,] 0.6306518695 0.7386962611 0.3693481305 [105,] 0.5760416934 0.8479166132 0.4239583066 [106,] 0.5112575501 0.9774848999 0.4887424499 [107,] 0.8003565883 0.3992868235 0.1996434117 [108,] 0.7568670373 0.4862659255 0.2431329627 [109,] 0.7882159355 0.4235681291 0.2117840645 [110,] 0.7975221862 0.4049556277 0.2024778138 [111,] 0.7841469640 0.4317060720 0.2158530360 [112,] 0.8505502755 0.2988994491 0.1494497245 [113,] 0.9758834600 0.0482330800 0.0241165400 [114,] 0.9681763822 0.0636472356 0.0318236178 [115,] 0.9638647631 0.0722704738 0.0361352369 [116,] 0.9419024866 0.1161950268 0.0580975134 [117,] 0.9229437906 0.1541124188 0.0770562094 [118,] 0.9218213962 0.1563572077 0.0781786038 [119,] 0.9996363578 0.0007272845 0.0003636422 [120,] 0.9989912879 0.0020174242 0.0010087121 [121,] 0.9970460948 0.0059078103 0.0029539052 [122,] 0.9920866277 0.0158267445 0.0079133723 [123,] 0.9953112312 0.0093775377 0.0046887688 [124,] 0.9851917085 0.0296165830 0.0148082915 [125,] 0.9785469046 0.0429061908 0.0214530954 [126,] 0.9404088216 0.1191823569 0.0595911784 > postscript(file="/var/wessaorg/rcomp/tmp/138qo1354884942.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/2878g1354884942.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/3z8951354884942.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/42yjj1354884942.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/55x4x1354884942.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 = 143 Frequency = 1 1 2 3 4 5 6 0.277573406 0.122482120 -0.044805607 0.043239324 -0.022669368 0.027789345 7 8 9 10 11 12 0.116506869 -0.135717453 -0.207952123 -0.245826631 -0.026313963 0.110827811 13 14 15 16 17 18 0.054078974 0.243544549 0.209667313 0.006141739 0.237495626 0.097103943 19 20 21 22 23 24 0.013513635 0.236790909 0.053112815 0.050861733 0.006695059 -0.068879601 25 26 27 28 29 30 -0.037384564 -0.170370160 -0.143184114 0.128382422 -0.073158878 -0.055726323 31 32 33 34 35 36 -0.063763951 -0.150571701 -0.042402359 -0.074623741 0.047813592 0.075316430 37 38 39 40 41 42 -0.120075761 0.062206529 -0.035698618 -0.137517347 -0.085160906 -0.175108960 43 44 45 46 47 48 -0.158664622 -0.142510545 -0.162285094 -0.132253824 -0.257897608 -0.426719984 49 50 51 52 53 54 -0.196494581 -0.313036352 -0.243967914 -0.435020563 -0.195075360 -0.144431781 55 56 57 58 59 60 -0.371569900 -0.105017679 -0.042594207 -0.042921870 -0.089008831 0.052596351 61 62 63 64 65 66 -0.031596330 0.188916848 0.227641063 0.379071708 0.277080203 0.308761415 67 68 69 70 71 72 0.399361550 0.282581211 0.146381648 -0.087850799 -0.038002484 0.043695692 73 74 75 76 77 78 -0.190467914 -0.156603107 0.001562097 -0.011249945 0.018574368 -0.036941547 79 80 81 82 83 84 -0.087453274 0.055454621 -0.076131193 0.049647120 0.126238271 0.141442322 85 86 87 88 89 90 0.148159257 0.025375048 0.036472188 -0.127894742 -0.099482634 0.080375920 91 92 93 94 95 96 0.076651640 0.083682575 0.138853297 0.181737621 0.040463558 -0.002417207 97 98 99 100 101 102 -0.334072834 -0.047644184 -0.139071358 0.110760519 0.011670103 -0.086704699 103 104 105 106 107 108 -0.278401955 -0.020935685 0.084040246 -0.005490664 0.189881753 0.219963256 109 110 111 112 113 114 0.313637274 0.123175739 0.153605425 0.139689128 0.122215783 -0.006959721 115 116 117 118 119 120 -0.420158966 -0.130590991 -0.217201820 -0.041337987 0.001991881 0.073501430 121 122 123 124 125 126 0.531332187 0.107538897 0.181185203 0.053144368 -0.086063401 -0.119172642 127 128 129 130 131 132 0.386860563 -0.040512254 -0.004765324 -0.028851040 0.036279046 -0.062790573 133 134 135 136 137 138 -0.045169815 -0.063177040 -0.027900492 -0.015556657 0.020871806 0.095569451 139 140 141 142 143 -0.124367845 -0.013236751 0.104671615 0.026736361 0.062364954 > postscript(file="/var/wessaorg/rcomp/tmp/6qdcw1354884942.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 = 143 Frequency = 1 lag(myerror, k = 1) myerror 0 0.277573406 NA 1 0.122482120 0.277573406 2 -0.044805607 0.122482120 3 0.043239324 -0.044805607 4 -0.022669368 0.043239324 5 0.027789345 -0.022669368 6 0.116506869 0.027789345 7 -0.135717453 0.116506869 8 -0.207952123 -0.135717453 9 -0.245826631 -0.207952123 10 -0.026313963 -0.245826631 11 0.110827811 -0.026313963 12 0.054078974 0.110827811 13 0.243544549 0.054078974 14 0.209667313 0.243544549 15 0.006141739 0.209667313 16 0.237495626 0.006141739 17 0.097103943 0.237495626 18 0.013513635 0.097103943 19 0.236790909 0.013513635 20 0.053112815 0.236790909 21 0.050861733 0.053112815 22 0.006695059 0.050861733 23 -0.068879601 0.006695059 24 -0.037384564 -0.068879601 25 -0.170370160 -0.037384564 26 -0.143184114 -0.170370160 27 0.128382422 -0.143184114 28 -0.073158878 0.128382422 29 -0.055726323 -0.073158878 30 -0.063763951 -0.055726323 31 -0.150571701 -0.063763951 32 -0.042402359 -0.150571701 33 -0.074623741 -0.042402359 34 0.047813592 -0.074623741 35 0.075316430 0.047813592 36 -0.120075761 0.075316430 37 0.062206529 -0.120075761 38 -0.035698618 0.062206529 39 -0.137517347 -0.035698618 40 -0.085160906 -0.137517347 41 -0.175108960 -0.085160906 42 -0.158664622 -0.175108960 43 -0.142510545 -0.158664622 44 -0.162285094 -0.142510545 45 -0.132253824 -0.162285094 46 -0.257897608 -0.132253824 47 -0.426719984 -0.257897608 48 -0.196494581 -0.426719984 49 -0.313036352 -0.196494581 50 -0.243967914 -0.313036352 51 -0.435020563 -0.243967914 52 -0.195075360 -0.435020563 53 -0.144431781 -0.195075360 54 -0.371569900 -0.144431781 55 -0.105017679 -0.371569900 56 -0.042594207 -0.105017679 57 -0.042921870 -0.042594207 58 -0.089008831 -0.042921870 59 0.052596351 -0.089008831 60 -0.031596330 0.052596351 61 0.188916848 -0.031596330 62 0.227641063 0.188916848 63 0.379071708 0.227641063 64 0.277080203 0.379071708 65 0.308761415 0.277080203 66 0.399361550 0.308761415 67 0.282581211 0.399361550 68 0.146381648 0.282581211 69 -0.087850799 0.146381648 70 -0.038002484 -0.087850799 71 0.043695692 -0.038002484 72 -0.190467914 0.043695692 73 -0.156603107 -0.190467914 74 0.001562097 -0.156603107 75 -0.011249945 0.001562097 76 0.018574368 -0.011249945 77 -0.036941547 0.018574368 78 -0.087453274 -0.036941547 79 0.055454621 -0.087453274 80 -0.076131193 0.055454621 81 0.049647120 -0.076131193 82 0.126238271 0.049647120 83 0.141442322 0.126238271 84 0.148159257 0.141442322 85 0.025375048 0.148159257 86 0.036472188 0.025375048 87 -0.127894742 0.036472188 88 -0.099482634 -0.127894742 89 0.080375920 -0.099482634 90 0.076651640 0.080375920 91 0.083682575 0.076651640 92 0.138853297 0.083682575 93 0.181737621 0.138853297 94 0.040463558 0.181737621 95 -0.002417207 0.040463558 96 -0.334072834 -0.002417207 97 -0.047644184 -0.334072834 98 -0.139071358 -0.047644184 99 0.110760519 -0.139071358 100 0.011670103 0.110760519 101 -0.086704699 0.011670103 102 -0.278401955 -0.086704699 103 -0.020935685 -0.278401955 104 0.084040246 -0.020935685 105 -0.005490664 0.084040246 106 0.189881753 -0.005490664 107 0.219963256 0.189881753 108 0.313637274 0.219963256 109 0.123175739 0.313637274 110 0.153605425 0.123175739 111 0.139689128 0.153605425 112 0.122215783 0.139689128 113 -0.006959721 0.122215783 114 -0.420158966 -0.006959721 115 -0.130590991 -0.420158966 116 -0.217201820 -0.130590991 117 -0.041337987 -0.217201820 118 0.001991881 -0.041337987 119 0.073501430 0.001991881 120 0.531332187 0.073501430 121 0.107538897 0.531332187 122 0.181185203 0.107538897 123 0.053144368 0.181185203 124 -0.086063401 0.053144368 125 -0.119172642 -0.086063401 126 0.386860563 -0.119172642 127 -0.040512254 0.386860563 128 -0.004765324 -0.040512254 129 -0.028851040 -0.004765324 130 0.036279046 -0.028851040 131 -0.062790573 0.036279046 132 -0.045169815 -0.062790573 133 -0.063177040 -0.045169815 134 -0.027900492 -0.063177040 135 -0.015556657 -0.027900492 136 0.020871806 -0.015556657 137 0.095569451 0.020871806 138 -0.124367845 0.095569451 139 -0.013236751 -0.124367845 140 0.104671615 -0.013236751 141 0.026736361 0.104671615 142 0.062364954 0.026736361 143 NA 0.062364954 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.122482120 0.277573406 [2,] -0.044805607 0.122482120 [3,] 0.043239324 -0.044805607 [4,] -0.022669368 0.043239324 [5,] 0.027789345 -0.022669368 [6,] 0.116506869 0.027789345 [7,] -0.135717453 0.116506869 [8,] -0.207952123 -0.135717453 [9,] -0.245826631 -0.207952123 [10,] -0.026313963 -0.245826631 [11,] 0.110827811 -0.026313963 [12,] 0.054078974 0.110827811 [13,] 0.243544549 0.054078974 [14,] 0.209667313 0.243544549 [15,] 0.006141739 0.209667313 [16,] 0.237495626 0.006141739 [17,] 0.097103943 0.237495626 [18,] 0.013513635 0.097103943 [19,] 0.236790909 0.013513635 [20,] 0.053112815 0.236790909 [21,] 0.050861733 0.053112815 [22,] 0.006695059 0.050861733 [23,] -0.068879601 0.006695059 [24,] -0.037384564 -0.068879601 [25,] -0.170370160 -0.037384564 [26,] -0.143184114 -0.170370160 [27,] 0.128382422 -0.143184114 [28,] -0.073158878 0.128382422 [29,] -0.055726323 -0.073158878 [30,] -0.063763951 -0.055726323 [31,] -0.150571701 -0.063763951 [32,] -0.042402359 -0.150571701 [33,] -0.074623741 -0.042402359 [34,] 0.047813592 -0.074623741 [35,] 0.075316430 0.047813592 [36,] -0.120075761 0.075316430 [37,] 0.062206529 -0.120075761 [38,] -0.035698618 0.062206529 [39,] -0.137517347 -0.035698618 [40,] -0.085160906 -0.137517347 [41,] -0.175108960 -0.085160906 [42,] -0.158664622 -0.175108960 [43,] -0.142510545 -0.158664622 [44,] -0.162285094 -0.142510545 [45,] -0.132253824 -0.162285094 [46,] -0.257897608 -0.132253824 [47,] -0.426719984 -0.257897608 [48,] -0.196494581 -0.426719984 [49,] -0.313036352 -0.196494581 [50,] -0.243967914 -0.313036352 [51,] -0.435020563 -0.243967914 [52,] -0.195075360 -0.435020563 [53,] -0.144431781 -0.195075360 [54,] -0.371569900 -0.144431781 [55,] -0.105017679 -0.371569900 [56,] -0.042594207 -0.105017679 [57,] -0.042921870 -0.042594207 [58,] -0.089008831 -0.042921870 [59,] 0.052596351 -0.089008831 [60,] -0.031596330 0.052596351 [61,] 0.188916848 -0.031596330 [62,] 0.227641063 0.188916848 [63,] 0.379071708 0.227641063 [64,] 0.277080203 0.379071708 [65,] 0.308761415 0.277080203 [66,] 0.399361550 0.308761415 [67,] 0.282581211 0.399361550 [68,] 0.146381648 0.282581211 [69,] -0.087850799 0.146381648 [70,] -0.038002484 -0.087850799 [71,] 0.043695692 -0.038002484 [72,] -0.190467914 0.043695692 [73,] -0.156603107 -0.190467914 [74,] 0.001562097 -0.156603107 [75,] -0.011249945 0.001562097 [76,] 0.018574368 -0.011249945 [77,] -0.036941547 0.018574368 [78,] -0.087453274 -0.036941547 [79,] 0.055454621 -0.087453274 [80,] -0.076131193 0.055454621 [81,] 0.049647120 -0.076131193 [82,] 0.126238271 0.049647120 [83,] 0.141442322 0.126238271 [84,] 0.148159257 0.141442322 [85,] 0.025375048 0.148159257 [86,] 0.036472188 0.025375048 [87,] -0.127894742 0.036472188 [88,] -0.099482634 -0.127894742 [89,] 0.080375920 -0.099482634 [90,] 0.076651640 0.080375920 [91,] 0.083682575 0.076651640 [92,] 0.138853297 0.083682575 [93,] 0.181737621 0.138853297 [94,] 0.040463558 0.181737621 [95,] -0.002417207 0.040463558 [96,] -0.334072834 -0.002417207 [97,] -0.047644184 -0.334072834 [98,] -0.139071358 -0.047644184 [99,] 0.110760519 -0.139071358 [100,] 0.011670103 0.110760519 [101,] -0.086704699 0.011670103 [102,] -0.278401955 -0.086704699 [103,] -0.020935685 -0.278401955 [104,] 0.084040246 -0.020935685 [105,] -0.005490664 0.084040246 [106,] 0.189881753 -0.005490664 [107,] 0.219963256 0.189881753 [108,] 0.313637274 0.219963256 [109,] 0.123175739 0.313637274 [110,] 0.153605425 0.123175739 [111,] 0.139689128 0.153605425 [112,] 0.122215783 0.139689128 [113,] -0.006959721 0.122215783 [114,] -0.420158966 -0.006959721 [115,] -0.130590991 -0.420158966 [116,] -0.217201820 -0.130590991 [117,] -0.041337987 -0.217201820 [118,] 0.001991881 -0.041337987 [119,] 0.073501430 0.001991881 [120,] 0.531332187 0.073501430 [121,] 0.107538897 0.531332187 [122,] 0.181185203 0.107538897 [123,] 0.053144368 0.181185203 [124,] -0.086063401 0.053144368 [125,] -0.119172642 -0.086063401 [126,] 0.386860563 -0.119172642 [127,] -0.040512254 0.386860563 [128,] -0.004765324 -0.040512254 [129,] -0.028851040 -0.004765324 [130,] 0.036279046 -0.028851040 [131,] -0.062790573 0.036279046 [132,] -0.045169815 -0.062790573 [133,] -0.063177040 -0.045169815 [134,] -0.027900492 -0.063177040 [135,] -0.015556657 -0.027900492 [136,] 0.020871806 -0.015556657 [137,] 0.095569451 0.020871806 [138,] -0.124367845 0.095569451 [139,] -0.013236751 -0.124367845 [140,] 0.104671615 -0.013236751 [141,] 0.026736361 0.104671615 [142,] 0.062364954 0.026736361 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.122482120 0.277573406 2 -0.044805607 0.122482120 3 0.043239324 -0.044805607 4 -0.022669368 0.043239324 5 0.027789345 -0.022669368 6 0.116506869 0.027789345 7 -0.135717453 0.116506869 8 -0.207952123 -0.135717453 9 -0.245826631 -0.207952123 10 -0.026313963 -0.245826631 11 0.110827811 -0.026313963 12 0.054078974 0.110827811 13 0.243544549 0.054078974 14 0.209667313 0.243544549 15 0.006141739 0.209667313 16 0.237495626 0.006141739 17 0.097103943 0.237495626 18 0.013513635 0.097103943 19 0.236790909 0.013513635 20 0.053112815 0.236790909 21 0.050861733 0.053112815 22 0.006695059 0.050861733 23 -0.068879601 0.006695059 24 -0.037384564 -0.068879601 25 -0.170370160 -0.037384564 26 -0.143184114 -0.170370160 27 0.128382422 -0.143184114 28 -0.073158878 0.128382422 29 -0.055726323 -0.073158878 30 -0.063763951 -0.055726323 31 -0.150571701 -0.063763951 32 -0.042402359 -0.150571701 33 -0.074623741 -0.042402359 34 0.047813592 -0.074623741 35 0.075316430 0.047813592 36 -0.120075761 0.075316430 37 0.062206529 -0.120075761 38 -0.035698618 0.062206529 39 -0.137517347 -0.035698618 40 -0.085160906 -0.137517347 41 -0.175108960 -0.085160906 42 -0.158664622 -0.175108960 43 -0.142510545 -0.158664622 44 -0.162285094 -0.142510545 45 -0.132253824 -0.162285094 46 -0.257897608 -0.132253824 47 -0.426719984 -0.257897608 48 -0.196494581 -0.426719984 49 -0.313036352 -0.196494581 50 -0.243967914 -0.313036352 51 -0.435020563 -0.243967914 52 -0.195075360 -0.435020563 53 -0.144431781 -0.195075360 54 -0.371569900 -0.144431781 55 -0.105017679 -0.371569900 56 -0.042594207 -0.105017679 57 -0.042921870 -0.042594207 58 -0.089008831 -0.042921870 59 0.052596351 -0.089008831 60 -0.031596330 0.052596351 61 0.188916848 -0.031596330 62 0.227641063 0.188916848 63 0.379071708 0.227641063 64 0.277080203 0.379071708 65 0.308761415 0.277080203 66 0.399361550 0.308761415 67 0.282581211 0.399361550 68 0.146381648 0.282581211 69 -0.087850799 0.146381648 70 -0.038002484 -0.087850799 71 0.043695692 -0.038002484 72 -0.190467914 0.043695692 73 -0.156603107 -0.190467914 74 0.001562097 -0.156603107 75 -0.011249945 0.001562097 76 0.018574368 -0.011249945 77 -0.036941547 0.018574368 78 -0.087453274 -0.036941547 79 0.055454621 -0.087453274 80 -0.076131193 0.055454621 81 0.049647120 -0.076131193 82 0.126238271 0.049647120 83 0.141442322 0.126238271 84 0.148159257 0.141442322 85 0.025375048 0.148159257 86 0.036472188 0.025375048 87 -0.127894742 0.036472188 88 -0.099482634 -0.127894742 89 0.080375920 -0.099482634 90 0.076651640 0.080375920 91 0.083682575 0.076651640 92 0.138853297 0.083682575 93 0.181737621 0.138853297 94 0.040463558 0.181737621 95 -0.002417207 0.040463558 96 -0.334072834 -0.002417207 97 -0.047644184 -0.334072834 98 -0.139071358 -0.047644184 99 0.110760519 -0.139071358 100 0.011670103 0.110760519 101 -0.086704699 0.011670103 102 -0.278401955 -0.086704699 103 -0.020935685 -0.278401955 104 0.084040246 -0.020935685 105 -0.005490664 0.084040246 106 0.189881753 -0.005490664 107 0.219963256 0.189881753 108 0.313637274 0.219963256 109 0.123175739 0.313637274 110 0.153605425 0.123175739 111 0.139689128 0.153605425 112 0.122215783 0.139689128 113 -0.006959721 0.122215783 114 -0.420158966 -0.006959721 115 -0.130590991 -0.420158966 116 -0.217201820 -0.130590991 117 -0.041337987 -0.217201820 118 0.001991881 -0.041337987 119 0.073501430 0.001991881 120 0.531332187 0.073501430 121 0.107538897 0.531332187 122 0.181185203 0.107538897 123 0.053144368 0.181185203 124 -0.086063401 0.053144368 125 -0.119172642 -0.086063401 126 0.386860563 -0.119172642 127 -0.040512254 0.386860563 128 -0.004765324 -0.040512254 129 -0.028851040 -0.004765324 130 0.036279046 -0.028851040 131 -0.062790573 0.036279046 132 -0.045169815 -0.062790573 133 -0.063177040 -0.045169815 134 -0.027900492 -0.063177040 135 -0.015556657 -0.027900492 136 0.020871806 -0.015556657 137 0.095569451 0.020871806 138 -0.124367845 0.095569451 139 -0.013236751 -0.124367845 140 0.104671615 -0.013236751 141 0.026736361 0.104671615 142 0.062364954 0.026736361 > 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/7mzkj1354884942.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/82oj61354884942.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/9x2al1354884942.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/10gwhe1354884942.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/11rrqi1354884942.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/12pexf1354884942.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/13h1701354884942.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/144uii1354884942.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/15oqe01354884942.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/16rhex1354884942.tab") + } > > try(system("convert tmp/138qo1354884942.ps tmp/138qo1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/2878g1354884942.ps tmp/2878g1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/3z8951354884942.ps tmp/3z8951354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/42yjj1354884942.ps tmp/42yjj1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/55x4x1354884942.ps tmp/55x4x1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/6qdcw1354884942.ps tmp/6qdcw1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/7mzkj1354884942.ps tmp/7mzkj1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/82oj61354884942.ps tmp/82oj61354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/9x2al1354884942.ps tmp/9x2al1354884942.png",intern=TRUE)) character(0) > try(system("convert tmp/10gwhe1354884942.ps tmp/10gwhe1354884942.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.148 1.041 8.192