R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(23 + ,10 + ,53 + ,7 + ,6 + ,12 + ,2 + ,4 + ,21 + ,6 + ,86 + ,4 + ,6 + ,11 + ,4 + ,3 + ,21 + ,13 + ,66 + ,6 + ,5 + ,14 + ,7 + ,5 + ,21 + ,12 + ,67 + ,5 + ,4 + ,12 + ,3 + ,3 + ,24 + ,8 + ,76 + ,4 + ,4 + ,21 + ,7 + ,6 + ,22 + ,6 + ,78 + ,3 + ,6 + ,12 + ,2 + ,5 + ,21 + ,10 + ,53 + ,5 + ,7 + ,22 + ,7 + ,6 + ,22 + ,10 + ,80 + ,6 + ,5 + ,11 + ,2 + ,6 + ,21 + ,9 + ,74 + ,5 + ,4 + ,10 + ,1 + ,5 + ,20 + ,9 + ,76 + ,6 + ,6 + ,13 + ,2 + ,5 + ,22 + ,7 + ,79 + ,7 + ,1 + ,10 + ,6 + ,3 + ,21 + ,5 + ,54 + ,6 + ,4 + ,8 + ,1 + ,5 + ,21 + ,14 + ,67 + ,7 + ,6 + ,15 + ,1 + ,7 + ,23 + ,6 + ,87 + ,6 + ,6 + ,10 + ,1 + ,5 + ,22 + ,10 + ,58 + ,4 + ,5 + ,14 + ,2 + ,5 + ,23 + ,10 + ,75 + ,6 + ,3 + ,14 + ,2 + ,3 + ,22 + ,7 + ,88 + ,4 + ,7 + ,11 + ,2 + ,5 + ,24 + ,10 + ,64 + ,5 + ,2 + ,10 + ,1 + ,6 + ,23 + ,8 + ,57 + ,3 + ,5 + ,13 + ,7 + ,5 + ,21 + ,6 + ,66 + ,3 + ,5 + ,7 + ,1 +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,82 + ,4 + ,6 + ,14 + ,3 + ,3 + ,21 + ,13 + ,54 + ,6 + ,2 + ,23 + ,2 + ,6 + ,23 + ,10 + ,63 + ,5 + ,4 + ,14 + ,5 + ,5 + ,23 + ,13 + ,54 + ,5 + ,5 + ,16 + ,5 + ,6 + ,22 + ,9 + ,64 + ,6 + ,6 + ,11 + ,7 + ,2 + ,21 + ,11 + ,69 + ,5 + ,6 + ,12 + ,4 + ,5 + ,21 + ,8 + ,84 + ,7 + ,5 + ,14 + ,5 + ,5 + ,21 + ,10 + ,86 + ,5 + ,4 + ,12 + ,1 + ,1 + ,21 + ,9 + ,77 + ,3 + ,5 + ,12 + ,4 + ,4 + ,22 + ,8 + ,89 + ,5 + ,6 + ,11 + ,1 + ,2 + ,20 + ,8 + ,76 + ,1 + ,6 + ,12 + ,4 + ,2 + ,21 + ,13 + ,60 + ,5 + ,5 + ,13 + ,6 + ,7 + ,23 + ,11 + ,79 + ,7 + ,6 + ,17 + ,7 + ,6 + ,32 + ,8 + ,76 + ,7 + ,4 + ,11 + ,1 + ,5 + ,22 + ,12 + ,72 + ,6 + ,5 + ,12 + ,3 + ,5 + ,24 + ,15 + ,69 + ,4 + ,5 + ,19 + ,5 + ,5 + ,21 + ,11 + ,54 + ,2 + ,7 + ,15 + ,2 + ,4 + ,22 + ,10 + ,69 + ,6 + ,5 + ,14 + ,4 + ,3 + ,22 + ,5 + ,81 + ,5 + ,6 + ,11 + ,5 + ,3 + ,23 + ,11 + ,84 + ,1 + ,6 + ,9 + ,1 + ,3) + ,dim=c(8 + ,142) + ,dimnames=list(c('AGE' + ,'PStress' + ,'BelInSprt' + ,'KunnenRekRel' + ,'ExtraCurAct' + ,'Depressie' + ,'Slaapgebrek' + ,'ToekZorgen') + ,1:142)) > y <- array(NA,dim=c(8,142),dimnames=list(c('AGE','PStress','BelInSprt','KunnenRekRel','ExtraCurAct','Depressie','Slaapgebrek','ToekZorgen'),1:142)) > 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 = '2' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.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 PStress AGE BelInSprt KunnenRekRel ExtraCurAct Depressie Slaapgebrek 1 10 23 53 7 6 12 2 2 6 21 86 4 6 11 4 3 13 21 66 6 5 14 7 4 12 21 67 5 4 12 3 5 8 24 76 4 4 21 7 6 6 22 78 3 6 12 2 7 10 21 53 5 7 22 7 8 10 22 80 6 5 11 2 9 9 21 74 5 4 10 1 10 9 20 76 6 6 13 2 11 7 22 79 7 1 10 6 12 5 21 54 6 4 8 1 13 14 21 67 7 6 15 1 14 6 23 87 6 6 10 1 15 10 22 58 4 5 14 2 16 10 23 75 6 3 14 2 17 7 22 88 4 7 11 2 18 10 24 64 5 2 10 1 19 8 23 57 3 5 13 7 20 6 21 66 3 5 7 1 21 10 23 54 4 3 12 2 22 12 23 56 5 5 14 4 23 7 21 86 3 5 11 2 24 15 20 80 7 6 9 1 25 8 32 76 7 4 11 1 26 10 22 69 4 4 15 5 27 13 21 67 4 4 13 2 28 8 21 80 5 2 9 1 29 11 21 54 6 3 15 3 30 7 22 71 5 6 10 1 31 9 21 84 4 6 11 2 32 10 21 74 6 5 13 5 33 8 21 71 5 3 8 2 34 15 22 63 5 3 20 6 35 9 21 71 6 4 12 4 36 7 21 76 2 4 10 1 37 11 21 69 6 5 10 3 38 9 21 74 7 3 9 6 39 8 23 75 5 5 14 7 40 8 21 54 5 4 8 4 41 12 23 69 5 3 11 5 42 13 23 68 6 3 13 3 43 9 21 75 4 4 11 2 44 11 21 75 6 6 11 2 45 8 20 72 5 5 10 2 46 10 21 67 5 3 14 2 47 13 21 63 3 4 18 1 48 12 22 62 4 2 14 2 49 12 21 63 4 3 11 1 50 9 21 76 2 5 12 2 51 8 22 74 3 5 13 2 52 9 20 67 6 5 9 5 53 12 22 73 5 4 10 5 54 12 22 70 6 5 15 2 55 16 21 53 2 3 20 1 56 11 23 77 3 6 12 1 57 13 22 77 6 3 12 2 58 10 24 52 3 2 14 3 59 9 23 54 6 3 13 7 60 14 21 80 6 4 11 4 61 13 22 66 4 3 17 4 62 12 22 73 7 4 12 1 63 9 21 63 6 4 13 2 64 9 21 69 3 7 14 2 65 10 21 67 7 2 13 2 66 8 21 54 2 2 15 5 67 9 20 81 4 5 13 1 68 9 22 69 6 3 10 6 69 11 22 84 4 6 11 2 70 7 22 70 1 6 13 2 71 11 23 69 4 4 17 4 72 9 21 77 7 6 13 6 73 11 23 54 4 6 9 2 74 9 22 79 4 4 11 2 75 8 21 30 4 2 10 2 76 9 21 71 6 6 9 1 77 8 20 73 2 3 12 1 78 9 24 72 3 5 12 2 79 10 24 77 4 3 13 2 80 9 21 75 4 4 13 3 81 17 20 70 4 6 22 3 82 7 21 73 6 2 13 5 83 11 21 54 2 7 15 2 84 9 21 77 4 2 13 5 85 10 21 82 3 3 15 3 86 11 22 80 7 6 10 1 87 8 22 80 4 4 11 2 88 12 21 69 5 4 16 2 89 10 22 78 6 3 11 1 90 7 21 81 5 5 11 2 91 9 23 76 4 4 10 2 92 7 21 76 5 5 10 5 93 12 22 73 4 5 16 5 94 8 22 85 5 7 12 2 95 13 22 66 7 4 11 3 96 9 20 79 7 6 16 5 97 15 21 68 4 3 19 5 98 8 21 76 6 6 11 6 99 14 22 54 4 3 15 2 100 14 25 46 1 2 24 7 101 9 22 82 3 4 14 1 102 13 22 74 6 3 15 1 103 11 21 88 7 3 11 6 104 10 22 38 6 4 15 6 105 6 21 76 6 4 12 2 106 8 24 86 6 5 10 1 107 10 23 54 4 5 14 2 108 10 23 69 1 7 9 1 109 10 22 90 3 7 15 2 110 12 22 54 7 1 15 1 111 10 25 76 2 4 14 3 112 9 23 89 7 6 11 3 113 9 22 76 4 5 8 6 114 11 21 79 5 4 11 4 115 7 21 90 6 5 8 1 116 7 22 74 6 5 10 2 117 5 22 81 5 6 11 5 118 9 21 72 5 5 13 6 119 11 0 71 4 3 11 3 120 15 21 66 2 4 20 5 121 9 22 77 2 4 10 3 122 9 21 74 4 5 12 2 123 8 24 82 4 6 14 3 124 13 21 54 6 2 23 2 125 10 23 63 5 4 14 5 126 13 23 54 5 5 16 5 127 9 22 64 6 6 11 7 128 11 21 69 5 6 12 4 129 8 21 84 7 5 14 5 130 10 21 86 5 4 12 1 131 9 21 77 3 5 12 4 132 8 22 89 5 6 11 1 133 8 20 76 1 6 12 4 134 13 21 60 5 5 13 6 135 11 23 79 7 6 17 7 136 8 32 76 7 4 11 1 137 12 22 72 6 5 12 3 138 15 24 69 4 5 19 5 139 11 21 54 2 7 15 2 140 10 22 69 6 5 14 4 141 5 22 81 5 6 11 5 142 11 23 84 1 6 9 1 ToekZorgen 1 4 2 3 3 5 4 3 5 6 6 5 7 6 8 6 9 5 10 5 11 3 12 5 13 7 14 5 15 5 16 3 17 5 18 6 19 5 20 2 21 5 22 4 23 6 24 3 25 5 26 4 27 5 28 2 29 2 30 5 31 2 32 2 33 2 34 5 35 5 36 1 37 5 38 2 39 6 40 1 41 3 42 2 43 5 44 3 45 4 46 3 47 6 48 4 49 5 50 2 51 5 52 5 53 3 54 5 55 7 56 4 57 2 58 3 59 6 60 7 61 4 62 4 63 4 64 5 65 2 66 3 67 3 68 4 69 3 70 4 71 6 72 2 73 4 74 5 75 2 76 1 77 2 78 5 79 4 80 4 81 6 82 1 83 4 84 5 85 2 86 3 87 3 88 6 89 5 90 4 91 4 92 5 93 5 94 6 95 6 96 5 97 7 98 5 99 5 100 7 101 5 102 6 103 6 104 4 105 5 106 1 107 6 108 5 109 2 110 1 111 5 112 6 113 5 114 5 115 4 116 2 117 3 118 3 119 5 120 3 121 2 122 2 123 3 124 6 125 5 126 6 127 2 128 5 129 5 130 1 131 4 132 2 133 2 134 7 135 6 136 5 137 5 138 5 139 4 140 3 141 3 142 3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) AGE BelInSprt KunnenRekRel ExtraCurAct 8.87667 -0.10427 -0.03216 0.20672 -0.13042 Depressie Slaapgebrek ToekZorgen 0.39429 -0.21057 0.19976 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.6117 -1.2516 -0.1580 1.4149 6.1795 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.87667 2.12472 4.178 5.27e-05 *** AGE -0.10427 0.06666 -1.564 0.1202 BelInSprt -0.03216 0.01663 -1.934 0.0552 . KunnenRekRel 0.20672 0.10821 1.910 0.0582 . ExtraCurAct -0.13042 0.12298 -1.061 0.2908 Depressie 0.39429 0.06198 6.362 2.91e-09 *** Slaapgebrek -0.21057 0.09250 -2.277 0.0244 * ToekZorgen 0.19976 0.11280 1.771 0.0789 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.92 on 134 degrees of freedom Multiple R-squared: 0.3851, Adjusted R-squared: 0.3529 F-statistic: 11.99 on 7 and 134 DF, p-value: 8.176e-12 > 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.9003253 0.19934950 0.09967475 [2,] 0.9884258 0.02314849 0.01157424 [3,] 0.9845834 0.03083318 0.01541659 [4,] 0.9829163 0.03416745 0.01708373 [5,] 0.9780435 0.04391297 0.02195649 [6,] 0.9619956 0.07600881 0.03800440 [7,] 0.9432316 0.11353682 0.05676841 [8,] 0.9453906 0.10921872 0.05460936 [9,] 0.9304647 0.13907069 0.06953535 [10,] 0.9009331 0.19813386 0.09906693 [11,] 0.8687819 0.26243613 0.13121806 [12,] 0.8828290 0.23434207 0.11717103 [13,] 0.8517328 0.29653431 0.14826715 [14,] 0.9833310 0.03333798 0.01666899 [15,] 0.9767675 0.04646506 0.02323253 [16,] 0.9688325 0.06233494 0.03116747 [17,] 0.9831638 0.03367233 0.01683617 [18,] 0.9773044 0.04539114 0.02269557 [19,] 0.9707294 0.05854116 0.02927058 [20,] 0.9699156 0.06016886 0.03008443 [21,] 0.9606443 0.07871148 0.03935574 [22,] 0.9461440 0.10771204 0.05385602 [23,] 0.9279494 0.14410121 0.07205061 [24,] 0.9442580 0.11148399 0.05574200 [25,] 0.9303189 0.13936223 0.06968112 [26,] 0.9106252 0.17874963 0.08937482 [27,] 0.9035669 0.19286619 0.09643310 [28,] 0.8793415 0.24131694 0.12065847 [29,] 0.8603198 0.27936038 0.13968019 [30,] 0.8269131 0.34617371 0.17308685 [31,] 0.8966371 0.20672580 0.10336290 [32,] 0.9160444 0.16791126 0.08395563 [33,] 0.8954743 0.20905130 0.10452565 [34,] 0.8843586 0.23128283 0.11564141 [35,] 0.8666792 0.26664170 0.13332085 [36,] 0.8462514 0.30749710 0.15374855 [37,] 0.8274430 0.34511410 0.17255705 [38,] 0.8040641 0.39187186 0.19593593 [39,] 0.8087283 0.38254334 0.19127167 [40,] 0.7799078 0.44018436 0.22009218 [41,] 0.7662438 0.46751250 0.23375625 [42,] 0.7254270 0.54914597 0.27457299 [43,] 0.8464058 0.30718834 0.15359417 [44,] 0.8156911 0.36861775 0.18430887 [45,] 0.8315019 0.33699616 0.16849808 [46,] 0.8511122 0.29777557 0.14888779 [47,] 0.8950619 0.20987612 0.10493806 [48,] 0.8709519 0.25809626 0.12904813 [49,] 0.8538189 0.29236215 0.14618107 [50,] 0.9426503 0.11469937 0.05734968 [51,] 0.9358374 0.12832521 0.06416261 [52,] 0.9298470 0.14030600 0.07015300 [53,] 0.9352433 0.12951333 0.06475667 [54,] 0.9286807 0.14263866 0.07131933 [55,] 0.9292318 0.14153630 0.07076815 [56,] 0.9379493 0.12410131 0.06205065 [57,] 0.9258577 0.14828461 0.07414230 [58,] 0.9082328 0.18353435 0.09176717 [59,] 0.9271788 0.14564235 0.07282117 [60,] 0.9406152 0.11876962 0.05938481 [61,] 0.9278932 0.14421369 0.07210684 [62,] 0.9123153 0.17536939 0.08768470 [63,] 0.9277964 0.14440711 0.07220355 [64,] 0.9094026 0.18119486 0.09059743 [65,] 0.9120566 0.17588686 0.08794343 [66,] 0.8982420 0.20351607 0.10175804 [67,] 0.8888215 0.22235704 0.11117852 [68,] 0.8707316 0.25853684 0.12926842 [69,] 0.8421082 0.31578361 0.15789180 [70,] 0.8180301 0.36393985 0.18196992 [71,] 0.8705520 0.25889594 0.12944797 [72,] 0.8913957 0.21720867 0.10860434 [73,] 0.8694974 0.26100527 0.13050264 [74,] 0.8545941 0.29081170 0.14540585 [75,] 0.8229488 0.35410236 0.17705118 [76,] 0.8595827 0.28083458 0.14041729 [77,] 0.8381179 0.32376429 0.16188215 [78,] 0.8039039 0.39219230 0.19609615 [79,] 0.7659278 0.46814445 0.23407222 [80,] 0.7786814 0.44263715 0.22131857 [81,] 0.7405095 0.51898101 0.25949050 [82,] 0.7399333 0.52013332 0.26006666 [83,] 0.7152607 0.56947865 0.28473932 [84,] 0.6903062 0.61938756 0.30969378 [85,] 0.7514412 0.49711753 0.24855876 [86,] 0.7460556 0.50788889 0.25394444 [87,] 0.7461890 0.50762198 0.25381099 [88,] 0.7054898 0.58902043 0.29451021 [89,] 0.7177145 0.56457093 0.28228547 [90,] 0.7380392 0.52392167 0.26196084 [91,] 0.7502023 0.49959538 0.24979769 [92,] 0.7268533 0.54629347 0.27314673 [93,] 0.7219267 0.55614662 0.27807331 [94,] 0.7068064 0.58638721 0.29319360 [95,] 0.8628872 0.27422560 0.13711280 [96,] 0.8357452 0.32850955 0.16425477 [97,] 0.8464130 0.30717396 0.15358698 [98,] 0.8295497 0.34090064 0.17045032 [99,] 0.8023259 0.39534814 0.19767407 [100,] 0.7774815 0.44503708 0.22251854 [101,] 0.7788167 0.44236657 0.22118329 [102,] 0.7303077 0.53938453 0.26969227 [103,] 0.6843957 0.63120863 0.31560432 [104,] 0.6578669 0.68426617 0.34213308 [105,] 0.5952340 0.80953197 0.40476598 [106,] 0.5352753 0.92944938 0.46472469 [107,] 0.6449011 0.71019773 0.35509886 [108,] 0.5742791 0.85144189 0.42572094 [109,] 0.4994339 0.99886784 0.50056608 [110,] 0.5515034 0.89699330 0.44849665 [111,] 0.4746417 0.94928335 0.52535832 [112,] 0.3904791 0.78095818 0.60952091 [113,] 0.3432646 0.68652922 0.65673539 [114,] 0.4287359 0.85747187 0.57126407 [115,] 0.4195381 0.83907615 0.58046193 [116,] 0.3351103 0.67022069 0.66488965 [117,] 0.5447857 0.91042865 0.45521432 [118,] 0.4754644 0.95092887 0.52453557 [119,] 0.6935332 0.61293356 0.30646678 [120,] 0.5581004 0.88379921 0.44189961 [121,] 0.8198406 0.36031888 0.18015944 > postscript(file="/var/www/html/rcomp/tmp/1fj6c1291471767.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/html/rcomp/tmp/2qtnx1291471767.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/html/rcomp/tmp/3qtnx1291471767.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/html/rcomp/tmp/4qtnx1291471767.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/html/rcomp/tmp/5jk501291471767.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 = 142 Frequency = 1 1 2 3 4 5 6 -0.54799499 -2.05996078 2.80234128 2.25661598 -4.24002834 -3.22117952 7 8 9 10 11 12 -3.50223518 0.28708639 -0.55035169 -1.50849145 -1.63762126 -4.61165725 13 14 15 16 17 18 1.70096820 -2.86964223 -0.99006285 -0.61386896 -1.58161194 -0.01971629 19 20 21 22 23 24 -1.26408682 -1.48161444 -0.48668096 1.46406669 -2.00406855 6.17952308 25 26 27 28 29 30 -1.14680082 -0.32956203 2.45896334 -0.62467673 -0.48169305 -2.28172110 31 32 33 34 35 36 0.65433893 0.63202694 -0.17882224 2.17971256 -1.01041681 -1.06684137 37 38 39 40 41 42 1.63369405 0.95220032 -1.69273045 0.02580427 3.21448541 2.96564130 43 44 45 46 47 48 -0.49519112 1.75171436 -1.17819276 -0.87295220 0.15527486 0.94707399 49 50 51 52 53 54 1.77792254 0.28580965 -1.87451994 0.28053882 3.76355597 0.58810145 55 56 57 58 59 60 1.92166021 1.84011870 3.33451466 -0.54891869 -1.44131951 4.27378281 61 62 63 64 65 66 1.44439523 1.51949308 -1.88335624 -1.27303546 -0.82276665 -2.56383903 67 68 69 70 71 72 -0.87573070 0.30859709 2.55885175 -2.25953412 -0.62395679 -0.13723232 73 74 75 76 77 78 2.28719911 -0.26228853 -2.20958356 0.60060528 -1.38634052 -0.33600656 79 80 81 82 83 84 0.16269414 -0.87344367 3.17420647 -2.59162714 0.25678072 -0.84857867 85 86 87 88 89 90 0.03890192 1.99377276 -0.83061628 -0.06606936 -0.04887871 -2.17878928 91 92 93 94 95 96 0.33955384 -1.51333577 1.33544128 -1.47885550 2.71030270 -2.16989749 97 98 99 100 101 102 2.22716105 -0.77335961 2.22617909 -0.12380063 -1.35253262 1.04557139 103 104 105 106 107 108 1.81480669 -1.52933914 -4.27076685 -0.12892006 -1.21418277 2.10982781 109 110 111 112 113 114 0.71153734 -0.06636434 0.39519074 -0.18495391 1.79680657 1.84786063 115 116 117 118 119 120 -1.12378793 -1.71254454 -3.11263330 -0.21475405 -0.73333799 3.11144431 121 122 123 124 125 126 1.29097059 -0.19195059 -1.26922453 -2.77602958 -0.43043022 1.42222666 127 128 129 130 131 132 0.75485362 1.39282405 -2.24667429 0.84599460 0.13287278 -0.49789271 133 134 135 136 137 138 -0.06017967 2.60031959 -0.02999404 -1.14680082 2.04585839 3.23247816 139 140 141 142 0.25678072 -0.22911167 -3.11263330 3.86129700 > postscript(file="/var/www/html/rcomp/tmp/6jk501291471767.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 = 142 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.54799499 NA 1 -2.05996078 -0.54799499 2 2.80234128 -2.05996078 3 2.25661598 2.80234128 4 -4.24002834 2.25661598 5 -3.22117952 -4.24002834 6 -3.50223518 -3.22117952 7 0.28708639 -3.50223518 8 -0.55035169 0.28708639 9 -1.50849145 -0.55035169 10 -1.63762126 -1.50849145 11 -4.61165725 -1.63762126 12 1.70096820 -4.61165725 13 -2.86964223 1.70096820 14 -0.99006285 -2.86964223 15 -0.61386896 -0.99006285 16 -1.58161194 -0.61386896 17 -0.01971629 -1.58161194 18 -1.26408682 -0.01971629 19 -1.48161444 -1.26408682 20 -0.48668096 -1.48161444 21 1.46406669 -0.48668096 22 -2.00406855 1.46406669 23 6.17952308 -2.00406855 24 -1.14680082 6.17952308 25 -0.32956203 -1.14680082 26 2.45896334 -0.32956203 27 -0.62467673 2.45896334 28 -0.48169305 -0.62467673 29 -2.28172110 -0.48169305 30 0.65433893 -2.28172110 31 0.63202694 0.65433893 32 -0.17882224 0.63202694 33 2.17971256 -0.17882224 34 -1.01041681 2.17971256 35 -1.06684137 -1.01041681 36 1.63369405 -1.06684137 37 0.95220032 1.63369405 38 -1.69273045 0.95220032 39 0.02580427 -1.69273045 40 3.21448541 0.02580427 41 2.96564130 3.21448541 42 -0.49519112 2.96564130 43 1.75171436 -0.49519112 44 -1.17819276 1.75171436 45 -0.87295220 -1.17819276 46 0.15527486 -0.87295220 47 0.94707399 0.15527486 48 1.77792254 0.94707399 49 0.28580965 1.77792254 50 -1.87451994 0.28580965 51 0.28053882 -1.87451994 52 3.76355597 0.28053882 53 0.58810145 3.76355597 54 1.92166021 0.58810145 55 1.84011870 1.92166021 56 3.33451466 1.84011870 57 -0.54891869 3.33451466 58 -1.44131951 -0.54891869 59 4.27378281 -1.44131951 60 1.44439523 4.27378281 61 1.51949308 1.44439523 62 -1.88335624 1.51949308 63 -1.27303546 -1.88335624 64 -0.82276665 -1.27303546 65 -2.56383903 -0.82276665 66 -0.87573070 -2.56383903 67 0.30859709 -0.87573070 68 2.55885175 0.30859709 69 -2.25953412 2.55885175 70 -0.62395679 -2.25953412 71 -0.13723232 -0.62395679 72 2.28719911 -0.13723232 73 -0.26228853 2.28719911 74 -2.20958356 -0.26228853 75 0.60060528 -2.20958356 76 -1.38634052 0.60060528 77 -0.33600656 -1.38634052 78 0.16269414 -0.33600656 79 -0.87344367 0.16269414 80 3.17420647 -0.87344367 81 -2.59162714 3.17420647 82 0.25678072 -2.59162714 83 -0.84857867 0.25678072 84 0.03890192 -0.84857867 85 1.99377276 0.03890192 86 -0.83061628 1.99377276 87 -0.06606936 -0.83061628 88 -0.04887871 -0.06606936 89 -2.17878928 -0.04887871 90 0.33955384 -2.17878928 91 -1.51333577 0.33955384 92 1.33544128 -1.51333577 93 -1.47885550 1.33544128 94 2.71030270 -1.47885550 95 -2.16989749 2.71030270 96 2.22716105 -2.16989749 97 -0.77335961 2.22716105 98 2.22617909 -0.77335961 99 -0.12380063 2.22617909 100 -1.35253262 -0.12380063 101 1.04557139 -1.35253262 102 1.81480669 1.04557139 103 -1.52933914 1.81480669 104 -4.27076685 -1.52933914 105 -0.12892006 -4.27076685 106 -1.21418277 -0.12892006 107 2.10982781 -1.21418277 108 0.71153734 2.10982781 109 -0.06636434 0.71153734 110 0.39519074 -0.06636434 111 -0.18495391 0.39519074 112 1.79680657 -0.18495391 113 1.84786063 1.79680657 114 -1.12378793 1.84786063 115 -1.71254454 -1.12378793 116 -3.11263330 -1.71254454 117 -0.21475405 -3.11263330 118 -0.73333799 -0.21475405 119 3.11144431 -0.73333799 120 1.29097059 3.11144431 121 -0.19195059 1.29097059 122 -1.26922453 -0.19195059 123 -2.77602958 -1.26922453 124 -0.43043022 -2.77602958 125 1.42222666 -0.43043022 126 0.75485362 1.42222666 127 1.39282405 0.75485362 128 -2.24667429 1.39282405 129 0.84599460 -2.24667429 130 0.13287278 0.84599460 131 -0.49789271 0.13287278 132 -0.06017967 -0.49789271 133 2.60031959 -0.06017967 134 -0.02999404 2.60031959 135 -1.14680082 -0.02999404 136 2.04585839 -1.14680082 137 3.23247816 2.04585839 138 0.25678072 3.23247816 139 -0.22911167 0.25678072 140 -3.11263330 -0.22911167 141 3.86129700 -3.11263330 142 NA 3.86129700 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.05996078 -0.54799499 [2,] 2.80234128 -2.05996078 [3,] 2.25661598 2.80234128 [4,] -4.24002834 2.25661598 [5,] -3.22117952 -4.24002834 [6,] -3.50223518 -3.22117952 [7,] 0.28708639 -3.50223518 [8,] -0.55035169 0.28708639 [9,] -1.50849145 -0.55035169 [10,] -1.63762126 -1.50849145 [11,] -4.61165725 -1.63762126 [12,] 1.70096820 -4.61165725 [13,] -2.86964223 1.70096820 [14,] -0.99006285 -2.86964223 [15,] -0.61386896 -0.99006285 [16,] -1.58161194 -0.61386896 [17,] -0.01971629 -1.58161194 [18,] -1.26408682 -0.01971629 [19,] -1.48161444 -1.26408682 [20,] -0.48668096 -1.48161444 [21,] 1.46406669 -0.48668096 [22,] -2.00406855 1.46406669 [23,] 6.17952308 -2.00406855 [24,] -1.14680082 6.17952308 [25,] -0.32956203 -1.14680082 [26,] 2.45896334 -0.32956203 [27,] -0.62467673 2.45896334 [28,] -0.48169305 -0.62467673 [29,] -2.28172110 -0.48169305 [30,] 0.65433893 -2.28172110 [31,] 0.63202694 0.65433893 [32,] -0.17882224 0.63202694 [33,] 2.17971256 -0.17882224 [34,] -1.01041681 2.17971256 [35,] -1.06684137 -1.01041681 [36,] 1.63369405 -1.06684137 [37,] 0.95220032 1.63369405 [38,] -1.69273045 0.95220032 [39,] 0.02580427 -1.69273045 [40,] 3.21448541 0.02580427 [41,] 2.96564130 3.21448541 [42,] -0.49519112 2.96564130 [43,] 1.75171436 -0.49519112 [44,] -1.17819276 1.75171436 [45,] -0.87295220 -1.17819276 [46,] 0.15527486 -0.87295220 [47,] 0.94707399 0.15527486 [48,] 1.77792254 0.94707399 [49,] 0.28580965 1.77792254 [50,] -1.87451994 0.28580965 [51,] 0.28053882 -1.87451994 [52,] 3.76355597 0.28053882 [53,] 0.58810145 3.76355597 [54,] 1.92166021 0.58810145 [55,] 1.84011870 1.92166021 [56,] 3.33451466 1.84011870 [57,] -0.54891869 3.33451466 [58,] -1.44131951 -0.54891869 [59,] 4.27378281 -1.44131951 [60,] 1.44439523 4.27378281 [61,] 1.51949308 1.44439523 [62,] -1.88335624 1.51949308 [63,] -1.27303546 -1.88335624 [64,] -0.82276665 -1.27303546 [65,] -2.56383903 -0.82276665 [66,] -0.87573070 -2.56383903 [67,] 0.30859709 -0.87573070 [68,] 2.55885175 0.30859709 [69,] -2.25953412 2.55885175 [70,] -0.62395679 -2.25953412 [71,] -0.13723232 -0.62395679 [72,] 2.28719911 -0.13723232 [73,] -0.26228853 2.28719911 [74,] -2.20958356 -0.26228853 [75,] 0.60060528 -2.20958356 [76,] -1.38634052 0.60060528 [77,] -0.33600656 -1.38634052 [78,] 0.16269414 -0.33600656 [79,] -0.87344367 0.16269414 [80,] 3.17420647 -0.87344367 [81,] -2.59162714 3.17420647 [82,] 0.25678072 -2.59162714 [83,] -0.84857867 0.25678072 [84,] 0.03890192 -0.84857867 [85,] 1.99377276 0.03890192 [86,] -0.83061628 1.99377276 [87,] -0.06606936 -0.83061628 [88,] -0.04887871 -0.06606936 [89,] -2.17878928 -0.04887871 [90,] 0.33955384 -2.17878928 [91,] -1.51333577 0.33955384 [92,] 1.33544128 -1.51333577 [93,] -1.47885550 1.33544128 [94,] 2.71030270 -1.47885550 [95,] -2.16989749 2.71030270 [96,] 2.22716105 -2.16989749 [97,] -0.77335961 2.22716105 [98,] 2.22617909 -0.77335961 [99,] -0.12380063 2.22617909 [100,] -1.35253262 -0.12380063 [101,] 1.04557139 -1.35253262 [102,] 1.81480669 1.04557139 [103,] -1.52933914 1.81480669 [104,] -4.27076685 -1.52933914 [105,] -0.12892006 -4.27076685 [106,] -1.21418277 -0.12892006 [107,] 2.10982781 -1.21418277 [108,] 0.71153734 2.10982781 [109,] -0.06636434 0.71153734 [110,] 0.39519074 -0.06636434 [111,] -0.18495391 0.39519074 [112,] 1.79680657 -0.18495391 [113,] 1.84786063 1.79680657 [114,] -1.12378793 1.84786063 [115,] -1.71254454 -1.12378793 [116,] -3.11263330 -1.71254454 [117,] -0.21475405 -3.11263330 [118,] -0.73333799 -0.21475405 [119,] 3.11144431 -0.73333799 [120,] 1.29097059 3.11144431 [121,] -0.19195059 1.29097059 [122,] -1.26922453 -0.19195059 [123,] -2.77602958 -1.26922453 [124,] -0.43043022 -2.77602958 [125,] 1.42222666 -0.43043022 [126,] 0.75485362 1.42222666 [127,] 1.39282405 0.75485362 [128,] -2.24667429 1.39282405 [129,] 0.84599460 -2.24667429 [130,] 0.13287278 0.84599460 [131,] -0.49789271 0.13287278 [132,] -0.06017967 -0.49789271 [133,] 2.60031959 -0.06017967 [134,] -0.02999404 2.60031959 [135,] -1.14680082 -0.02999404 [136,] 2.04585839 -1.14680082 [137,] 3.23247816 2.04585839 [138,] 0.25678072 3.23247816 [139,] -0.22911167 0.25678072 [140,] -3.11263330 -0.22911167 [141,] 3.86129700 -3.11263330 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.05996078 -0.54799499 2 2.80234128 -2.05996078 3 2.25661598 2.80234128 4 -4.24002834 2.25661598 5 -3.22117952 -4.24002834 6 -3.50223518 -3.22117952 7 0.28708639 -3.50223518 8 -0.55035169 0.28708639 9 -1.50849145 -0.55035169 10 -1.63762126 -1.50849145 11 -4.61165725 -1.63762126 12 1.70096820 -4.61165725 13 -2.86964223 1.70096820 14 -0.99006285 -2.86964223 15 -0.61386896 -0.99006285 16 -1.58161194 -0.61386896 17 -0.01971629 -1.58161194 18 -1.26408682 -0.01971629 19 -1.48161444 -1.26408682 20 -0.48668096 -1.48161444 21 1.46406669 -0.48668096 22 -2.00406855 1.46406669 23 6.17952308 -2.00406855 24 -1.14680082 6.17952308 25 -0.32956203 -1.14680082 26 2.45896334 -0.32956203 27 -0.62467673 2.45896334 28 -0.48169305 -0.62467673 29 -2.28172110 -0.48169305 30 0.65433893 -2.28172110 31 0.63202694 0.65433893 32 -0.17882224 0.63202694 33 2.17971256 -0.17882224 34 -1.01041681 2.17971256 35 -1.06684137 -1.01041681 36 1.63369405 -1.06684137 37 0.95220032 1.63369405 38 -1.69273045 0.95220032 39 0.02580427 -1.69273045 40 3.21448541 0.02580427 41 2.96564130 3.21448541 42 -0.49519112 2.96564130 43 1.75171436 -0.49519112 44 -1.17819276 1.75171436 45 -0.87295220 -1.17819276 46 0.15527486 -0.87295220 47 0.94707399 0.15527486 48 1.77792254 0.94707399 49 0.28580965 1.77792254 50 -1.87451994 0.28580965 51 0.28053882 -1.87451994 52 3.76355597 0.28053882 53 0.58810145 3.76355597 54 1.92166021 0.58810145 55 1.84011870 1.92166021 56 3.33451466 1.84011870 57 -0.54891869 3.33451466 58 -1.44131951 -0.54891869 59 4.27378281 -1.44131951 60 1.44439523 4.27378281 61 1.51949308 1.44439523 62 -1.88335624 1.51949308 63 -1.27303546 -1.88335624 64 -0.82276665 -1.27303546 65 -2.56383903 -0.82276665 66 -0.87573070 -2.56383903 67 0.30859709 -0.87573070 68 2.55885175 0.30859709 69 -2.25953412 2.55885175 70 -0.62395679 -2.25953412 71 -0.13723232 -0.62395679 72 2.28719911 -0.13723232 73 -0.26228853 2.28719911 74 -2.20958356 -0.26228853 75 0.60060528 -2.20958356 76 -1.38634052 0.60060528 77 -0.33600656 -1.38634052 78 0.16269414 -0.33600656 79 -0.87344367 0.16269414 80 3.17420647 -0.87344367 81 -2.59162714 3.17420647 82 0.25678072 -2.59162714 83 -0.84857867 0.25678072 84 0.03890192 -0.84857867 85 1.99377276 0.03890192 86 -0.83061628 1.99377276 87 -0.06606936 -0.83061628 88 -0.04887871 -0.06606936 89 -2.17878928 -0.04887871 90 0.33955384 -2.17878928 91 -1.51333577 0.33955384 92 1.33544128 -1.51333577 93 -1.47885550 1.33544128 94 2.71030270 -1.47885550 95 -2.16989749 2.71030270 96 2.22716105 -2.16989749 97 -0.77335961 2.22716105 98 2.22617909 -0.77335961 99 -0.12380063 2.22617909 100 -1.35253262 -0.12380063 101 1.04557139 -1.35253262 102 1.81480669 1.04557139 103 -1.52933914 1.81480669 104 -4.27076685 -1.52933914 105 -0.12892006 -4.27076685 106 -1.21418277 -0.12892006 107 2.10982781 -1.21418277 108 0.71153734 2.10982781 109 -0.06636434 0.71153734 110 0.39519074 -0.06636434 111 -0.18495391 0.39519074 112 1.79680657 -0.18495391 113 1.84786063 1.79680657 114 -1.12378793 1.84786063 115 -1.71254454 -1.12378793 116 -3.11263330 -1.71254454 117 -0.21475405 -3.11263330 118 -0.73333799 -0.21475405 119 3.11144431 -0.73333799 120 1.29097059 3.11144431 121 -0.19195059 1.29097059 122 -1.26922453 -0.19195059 123 -2.77602958 -1.26922453 124 -0.43043022 -2.77602958 125 1.42222666 -0.43043022 126 0.75485362 1.42222666 127 1.39282405 0.75485362 128 -2.24667429 1.39282405 129 0.84599460 -2.24667429 130 0.13287278 0.84599460 131 -0.49789271 0.13287278 132 -0.06017967 -0.49789271 133 2.60031959 -0.06017967 134 -0.02999404 2.60031959 135 -1.14680082 -0.02999404 136 2.04585839 -1.14680082 137 3.23247816 2.04585839 138 0.25678072 3.23247816 139 -0.22911167 0.25678072 140 -3.11263330 -0.22911167 141 3.86129700 -3.11263330 > 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/html/rcomp/tmp/74l7y1291471768.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/html/rcomp/tmp/84l7y1291471768.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/html/rcomp/tmp/9fv6j1291471768.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/html/rcomp/tmp/10fv6j1291471768.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/11t4ls1291471768.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/html/rcomp/tmp/123elv1291471768.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/html/rcomp/tmp/13afip1291471768.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/html/rcomp/tmp/14loh91291471768.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/html/rcomp/tmp/156ofx1291471768.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/html/rcomp/tmp/16kyvo1291471768.tab") + } > > try(system("convert tmp/1fj6c1291471767.ps tmp/1fj6c1291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/2qtnx1291471767.ps tmp/2qtnx1291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/3qtnx1291471767.ps tmp/3qtnx1291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/4qtnx1291471767.ps tmp/4qtnx1291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/5jk501291471767.ps tmp/5jk501291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/6jk501291471767.ps tmp/6jk501291471767.png",intern=TRUE)) character(0) > try(system("convert tmp/74l7y1291471768.ps tmp/74l7y1291471768.png",intern=TRUE)) character(0) > try(system("convert tmp/84l7y1291471768.ps tmp/84l7y1291471768.png",intern=TRUE)) character(0) > try(system("convert tmp/9fv6j1291471768.ps tmp/9fv6j1291471768.png",intern=TRUE)) character(0) > try(system("convert tmp/10fv6j1291471768.ps tmp/10fv6j1291471768.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.971 1.809 11.336