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(4 + ,4 + ,5 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,5 + ,4 + ,4 + ,5 + ,5 + ,4 + ,3 + ,3 + ,2 + ,3 + ,4 + ,4 + ,3 + ,2 + ,3 + ,2 + ,3 + ,2 + ,4 + ,3 + ,5 + ,4 + ,3 + ,3 + ,4 + ,5 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,2 + ,3 + ,4 + ,4 + ,2 + ,4 + ,2 + ,4 + ,4 + ,3 + ,4 + ,4 + ,5 + ,3 + ,4 + ,3 + ,2 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,4 + ,2 + ,3 + ,2 + ,5 + ,4 + ,2 + ,5 + ,5 + ,5 + ,4 + ,3 + ,4 + ,2 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,5 + ,4 + ,3 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,2 + ,2 + ,4 + ,2 + ,4 + ,2 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,2 + ,3 + ,4 + ,4 + ,4 + ,2 + ,4 + ,4 +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,4 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,5 + ,4 + ,2 + ,2 + ,2 + ,2 + ,4 + ,3 + ,3 + ,5 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,4 + ,2 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,3 + ,4 + ,2 + ,4 + ,3 + ,4 + ,4 + ,5 + ,3 + ,5 + ,5 + ,5 + ,5 + ,5) + ,dim=c(7 + ,152) + ,dimnames=list(c('y' + ,'x1' + ,'x2' + ,'x3' + ,'x4' + ,'x5' + ,'x6') + ,1:152)) > y <- array(NA,dim=c(7,152),dimnames=list(c('y','x1','x2','x3','x4','x5','x6'),1:152)) > 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 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x y x1 x2 x3 x4 x5 x6 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 4 4 5 4 4 4 4 1 0 0 0 0 0 0 0 0 0 0 2 4 4 4 4 3 4 4 0 1 0 0 0 0 0 0 0 0 0 3 5 5 4 4 5 5 4 0 0 1 0 0 0 0 0 0 0 0 4 3 3 2 3 4 4 3 0 0 0 1 0 0 0 0 0 0 0 5 2 3 2 3 2 4 3 0 0 0 0 1 0 0 0 0 0 0 6 5 4 3 3 4 5 4 0 0 0 0 0 1 0 0 0 0 0 7 4 3 3 3 3 4 4 0 0 0 0 0 0 1 0 0 0 0 8 2 3 4 4 2 4 2 0 0 0 0 0 0 0 1 0 0 0 9 4 4 3 4 4 5 3 0 0 0 0 0 0 0 0 1 0 0 10 4 3 2 3 2 2 3 0 0 0 0 0 0 0 0 0 1 0 11 4 3 2 4 4 4 4 0 0 0 0 0 0 0 0 0 0 1 12 2 3 2 4 2 3 2 0 0 0 0 0 0 0 0 0 0 0 13 5 4 2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 0 148 3 3 3 4 4 2 4 0 0 0 1 0 0 0 0 0 0 0 149 4 2 4 4 4 4 3 0 0 0 0 1 0 0 0 0 0 0 150 3 3 3 3 4 4 3 0 0 0 0 0 1 0 0 0 0 0 151 4 2 4 3 4 4 5 0 0 0 0 0 0 1 0 0 0 0 152 3 5 5 5 5 5 4 0 0 0 0 0 0 0 1 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) x1 x2 x3 x4 x5 0.798651 0.004725 0.207077 0.157772 0.149637 0.173327 x6 M1 M2 M3 M4 M5 0.031980 -0.038711 0.076874 0.112509 -0.132102 -0.157713 M6 M7 M8 M9 M10 M11 0.217054 0.161410 -0.554040 -0.206281 0.107726 0.377412 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.53901 -0.41049 0.05538 0.37671 1.45011 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.798651 0.446895 1.787 0.07618 . x1 0.004725 0.063896 0.074 0.94116 x2 0.207077 0.072053 2.874 0.00472 ** x3 0.157772 0.066102 2.387 0.01839 * x4 0.149637 0.083208 1.798 0.07437 . x5 0.173327 0.073206 2.368 0.01933 * x6 0.031980 0.063865 0.501 0.61738 M1 -0.038711 0.259658 -0.149 0.88171 M2 0.076874 0.253947 0.303 0.76258 M3 0.112509 0.254616 0.442 0.65929 M4 -0.132102 0.261175 -0.506 0.61383 M5 -0.157713 0.253138 -0.623 0.53432 M6 0.217054 0.255342 0.850 0.39681 M7 0.161410 0.255943 0.631 0.52935 M8 -0.554040 0.254923 -2.173 0.03151 * M9 -0.206281 0.258109 -0.799 0.42559 M10 0.107726 0.260012 0.414 0.67931 M11 0.377412 0.258872 1.458 0.14720 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6249 on 134 degrees of freedom Multiple R-squared: 0.3993, Adjusted R-squared: 0.3231 F-statistic: 5.239 on 17 and 134 DF, p-value: 1.010e-08 > 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.12059671 0.24119343 0.879403287 [2,] 0.81985618 0.36028765 0.180143824 [3,] 0.72740167 0.54519665 0.272598326 [4,] 0.73584813 0.52830375 0.264151875 [5,] 0.63888171 0.72223658 0.361118288 [6,] 0.64376114 0.71247771 0.356238855 [7,] 0.73866997 0.52266007 0.261330034 [8,] 0.67257488 0.65485023 0.327425117 [9,] 0.99330950 0.01338101 0.006690505 [10,] 0.99048207 0.01903586 0.009517930 [11,] 0.98457331 0.03085339 0.015426694 [12,] 0.98313875 0.03372250 0.016861248 [13,] 0.97675998 0.04648004 0.023240020 [14,] 0.96645528 0.06708945 0.033544723 [15,] 0.95529341 0.08941319 0.044706594 [16,] 0.93857247 0.12285506 0.061427528 [17,] 0.97015210 0.05969580 0.029847899 [18,] 0.95939433 0.08121134 0.040605669 [19,] 0.97698121 0.04603759 0.023018794 [20,] 0.98416639 0.03166722 0.015833611 [21,] 0.98614695 0.02770610 0.013853048 [22,] 0.98225934 0.03548132 0.017740662 [23,] 0.97717047 0.04565907 0.022829535 [24,] 0.97549588 0.04900824 0.024504121 [25,] 0.97390452 0.05219096 0.026095481 [26,] 0.96714660 0.06570680 0.032853398 [27,] 0.95708317 0.08583367 0.042916834 [28,] 0.95218286 0.09563428 0.047817139 [29,] 0.94152450 0.11695100 0.058475498 [30,] 0.92604961 0.14790077 0.073950386 [31,] 0.90842010 0.18315981 0.091579904 [32,] 0.88323066 0.23353869 0.116769343 [33,] 0.88341130 0.23317741 0.116588703 [34,] 0.86924869 0.26150262 0.130751309 [35,] 0.85648358 0.28703284 0.143516422 [36,] 0.84915574 0.30168851 0.150844257 [37,] 0.83271123 0.33457754 0.167288769 [38,] 0.80741199 0.38517603 0.192588014 [39,] 0.85936964 0.28126073 0.140630363 [40,] 0.84749528 0.30500944 0.152504722 [41,] 0.84676258 0.30647483 0.153237416 [42,] 0.81511373 0.36977253 0.184886267 [43,] 0.79223041 0.41553918 0.207769591 [44,] 0.75728620 0.48542760 0.242713801 [45,] 0.78393727 0.43212546 0.216062729 [46,] 0.80578791 0.38842419 0.194212093 [47,] 0.78298209 0.43403581 0.217017905 [48,] 0.76532330 0.46935341 0.234676703 [49,] 0.77140165 0.45719670 0.228598350 [50,] 0.79679886 0.40640229 0.203201145 [51,] 0.84449707 0.31100587 0.155502933 [52,] 0.82538536 0.34922928 0.174614640 [53,] 0.83185564 0.33628873 0.168144364 [54,] 0.80169051 0.39661899 0.198309493 [55,] 0.78789953 0.42420094 0.212100470 [56,] 0.75094519 0.49810962 0.249054809 [57,] 0.74164531 0.51670937 0.258354687 [58,] 0.80140560 0.39718879 0.198594396 [59,] 0.78762822 0.42474356 0.212371778 [60,] 0.76985271 0.46029457 0.230147286 [61,] 0.72959141 0.54081717 0.270408587 [62,] 0.71005975 0.57988051 0.289940255 [63,] 0.67478805 0.65042391 0.325211953 [64,] 0.70294764 0.59410472 0.297052361 [65,] 0.66654717 0.66690565 0.333452827 [66,] 0.66221741 0.67556518 0.337782588 [67,] 0.64804375 0.70391251 0.351956254 [68,] 0.73588026 0.52823947 0.264119737 [69,] 0.70399999 0.59200001 0.296000006 [70,] 0.70365914 0.59268172 0.296340861 [71,] 0.67794962 0.64410076 0.322050380 [72,] 0.68339459 0.63321081 0.316605405 [73,] 0.64389771 0.71220458 0.356102288 [74,] 0.60688223 0.78623554 0.393117771 [75,] 0.57320402 0.85359196 0.426795980 [76,] 0.60257380 0.79485240 0.397426199 [77,] 0.58669712 0.82660576 0.413302880 [78,] 0.71056936 0.57886128 0.289430642 [79,] 0.67014346 0.65971307 0.329856537 [80,] 0.72442639 0.55114722 0.275573611 [81,] 0.76469760 0.47060480 0.235302398 [82,] 0.77931427 0.44137145 0.220685727 [83,] 0.73223385 0.53553231 0.267766155 [84,] 0.68053282 0.63893436 0.319467182 [85,] 0.69873360 0.60253280 0.301266400 [86,] 0.64248721 0.71502558 0.357512789 [87,] 0.74878466 0.50243068 0.251215341 [88,] 0.71593934 0.56812133 0.284060663 [89,] 0.70079411 0.59841178 0.299205891 [90,] 0.65148839 0.69702322 0.348511612 [91,] 0.61893902 0.76212197 0.381060983 [92,] 0.58811530 0.82376939 0.411884695 [93,] 0.55865089 0.88269822 0.441349112 [94,] 0.62282526 0.75434949 0.377174745 [95,] 0.57415934 0.85168133 0.425840664 [96,] 0.50687251 0.98625499 0.493127493 [97,] 0.43355898 0.86711797 0.566441016 [98,] 0.36795830 0.73591660 0.632041701 [99,] 0.30870080 0.61740161 0.691299197 [100,] 0.26066085 0.52132171 0.739339147 [101,] 0.30862699 0.61725399 0.691373006 [102,] 0.24365047 0.48730093 0.756349533 [103,] 0.19635954 0.39271907 0.803640463 [104,] 0.14504816 0.29009632 0.854951841 [105,] 0.10080017 0.20160034 0.899199832 [106,] 0.13304409 0.26608819 0.866955905 [107,] 0.09463269 0.18926538 0.905367310 [108,] 0.05716468 0.11432936 0.942835320 [109,] 0.03135332 0.06270663 0.968646684 [110,] 0.03143631 0.06287262 0.968563690 [111,] 0.01538128 0.03076256 0.984618722 > postscript(file="/var/www/html/rcomp/tmp/1gsnv1291380810.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/2qj4g1291380810.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/3qj4g1291380810.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/4qj4g1291380810.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/51tmj1291380810.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 = 152 Frequency = 1 1 2 3 4 5 6 0.134913535 0.376043328 0.863081010 0.044011159 -0.631102888 1.277747015 7 8 9 10 11 12 0.661080961 -0.774720994 0.575289786 1.450111046 0.344746274 -0.741281548 13 14 15 16 17 18 1.275407419 -0.052031723 0.195495725 0.473856522 0.190235268 0.086225403 19 20 21 22 23 24 -0.760474310 1.016407960 -0.039581561 -0.322394858 0.340020959 0.510356107 25 26 27 28 29 30 0.341990118 0.619824743 1.190770410 -0.041998474 -2.539007329 0.269002788 31 32 33 34 35 36 0.151320581 0.379940148 -0.307662175 0.041190453 -0.074132208 0.271300008 37 38 39 40 41 42 -0.433348214 0.235856630 -0.439655909 0.629857992 -0.058271463 0.307956219 43 44 45 46 47 48 0.234190600 -0.215967090 -0.640076889 0.479117148 -0.397096291 -0.687269845 49 50 51 52 53 54 -0.322186029 0.203877113 0.232200557 0.037515530 -0.651538813 0.086225403 55 56 57 58 59 60 0.383881052 0.410149351 -0.418814635 0.195553098 -1.074132208 -0.506969177 61 62 63 64 65 66 0.563720934 0.089575316 0.158790893 -0.249075057 0.433738470 -0.601587047 67 68 69 70 71 72 0.341071880 0.436925267 0.537922058 -0.772467386 0.859100482 0.476553156 73 74 75 76 77 78 -0.540229494 0.054239784 0.010469742 0.107691978 0.655000725 0.755126866 79 80 81 82 83 84 -0.501156337 -0.413437404 -0.110036223 -0.439598536 0.273390874 0.841454644 85 86 87 88 89 90 -0.409503151 -0.498041831 0.388656162 0.992936045 0.357042243 0.285427334 91 92 93 94 95 96 -0.335509901 -0.562620598 -0.280407974 -0.234292265 -0.208267689 0.688408177 97 98 99 100 101 102 0.340219805 0.920582588 -0.229170187 0.349703080 1.003893107 0.162575643 103 104 105 106 107 108 0.001683252 -0.161799748 0.669102536 -0.154665186 -0.911635109 -0.513943091 109 110 111 112 113 114 -0.458807951 -0.542412555 -0.105446731 -0.488268383 0.526981818 -1.023351079 115 116 117 118 119 120 -0.335509901 0.193143851 0.052460876 0.179998127 0.477058320 0.008677058 121 122 123 124 125 126 0.378694950 -0.091885892 -0.646732492 -0.349407586 0.380039690 -1.219466519 127 128 129 130 131 132 0.325101470 0.056521929 0.104720679 0.208568506 0.445078804 0.339984356 133 134 135 136 137 138 -0.284955527 -0.256621865 0.190770410 -1.500659590 -0.169433647 0.126339373 139 140 141 142 143 144 -0.442792194 0.470675096 -0.142916478 -0.631120148 -0.074132208 -0.687269845 145 146 147 148 149 150 -0.585916396 -1.059005637 -1.809229590 -0.006163216 0.502422819 -0.512221399 151 152 0.277112848 -0.835217767 > postscript(file="/var/www/html/rcomp/tmp/61tmj1291380810.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 = 152 Frequency = 1 lag(myerror, k = 1) myerror 0 0.134913535 NA 1 0.376043328 0.134913535 2 0.863081010 0.376043328 3 0.044011159 0.863081010 4 -0.631102888 0.044011159 5 1.277747015 -0.631102888 6 0.661080961 1.277747015 7 -0.774720994 0.661080961 8 0.575289786 -0.774720994 9 1.450111046 0.575289786 10 0.344746274 1.450111046 11 -0.741281548 0.344746274 12 1.275407419 -0.741281548 13 -0.052031723 1.275407419 14 0.195495725 -0.052031723 15 0.473856522 0.195495725 16 0.190235268 0.473856522 17 0.086225403 0.190235268 18 -0.760474310 0.086225403 19 1.016407960 -0.760474310 20 -0.039581561 1.016407960 21 -0.322394858 -0.039581561 22 0.340020959 -0.322394858 23 0.510356107 0.340020959 24 0.341990118 0.510356107 25 0.619824743 0.341990118 26 1.190770410 0.619824743 27 -0.041998474 1.190770410 28 -2.539007329 -0.041998474 29 0.269002788 -2.539007329 30 0.151320581 0.269002788 31 0.379940148 0.151320581 32 -0.307662175 0.379940148 33 0.041190453 -0.307662175 34 -0.074132208 0.041190453 35 0.271300008 -0.074132208 36 -0.433348214 0.271300008 37 0.235856630 -0.433348214 38 -0.439655909 0.235856630 39 0.629857992 -0.439655909 40 -0.058271463 0.629857992 41 0.307956219 -0.058271463 42 0.234190600 0.307956219 43 -0.215967090 0.234190600 44 -0.640076889 -0.215967090 45 0.479117148 -0.640076889 46 -0.397096291 0.479117148 47 -0.687269845 -0.397096291 48 -0.322186029 -0.687269845 49 0.203877113 -0.322186029 50 0.232200557 0.203877113 51 0.037515530 0.232200557 52 -0.651538813 0.037515530 53 0.086225403 -0.651538813 54 0.383881052 0.086225403 55 0.410149351 0.383881052 56 -0.418814635 0.410149351 57 0.195553098 -0.418814635 58 -1.074132208 0.195553098 59 -0.506969177 -1.074132208 60 0.563720934 -0.506969177 61 0.089575316 0.563720934 62 0.158790893 0.089575316 63 -0.249075057 0.158790893 64 0.433738470 -0.249075057 65 -0.601587047 0.433738470 66 0.341071880 -0.601587047 67 0.436925267 0.341071880 68 0.537922058 0.436925267 69 -0.772467386 0.537922058 70 0.859100482 -0.772467386 71 0.476553156 0.859100482 72 -0.540229494 0.476553156 73 0.054239784 -0.540229494 74 0.010469742 0.054239784 75 0.107691978 0.010469742 76 0.655000725 0.107691978 77 0.755126866 0.655000725 78 -0.501156337 0.755126866 79 -0.413437404 -0.501156337 80 -0.110036223 -0.413437404 81 -0.439598536 -0.110036223 82 0.273390874 -0.439598536 83 0.841454644 0.273390874 84 -0.409503151 0.841454644 85 -0.498041831 -0.409503151 86 0.388656162 -0.498041831 87 0.992936045 0.388656162 88 0.357042243 0.992936045 89 0.285427334 0.357042243 90 -0.335509901 0.285427334 91 -0.562620598 -0.335509901 92 -0.280407974 -0.562620598 93 -0.234292265 -0.280407974 94 -0.208267689 -0.234292265 95 0.688408177 -0.208267689 96 0.340219805 0.688408177 97 0.920582588 0.340219805 98 -0.229170187 0.920582588 99 0.349703080 -0.229170187 100 1.003893107 0.349703080 101 0.162575643 1.003893107 102 0.001683252 0.162575643 103 -0.161799748 0.001683252 104 0.669102536 -0.161799748 105 -0.154665186 0.669102536 106 -0.911635109 -0.154665186 107 -0.513943091 -0.911635109 108 -0.458807951 -0.513943091 109 -0.542412555 -0.458807951 110 -0.105446731 -0.542412555 111 -0.488268383 -0.105446731 112 0.526981818 -0.488268383 113 -1.023351079 0.526981818 114 -0.335509901 -1.023351079 115 0.193143851 -0.335509901 116 0.052460876 0.193143851 117 0.179998127 0.052460876 118 0.477058320 0.179998127 119 0.008677058 0.477058320 120 0.378694950 0.008677058 121 -0.091885892 0.378694950 122 -0.646732492 -0.091885892 123 -0.349407586 -0.646732492 124 0.380039690 -0.349407586 125 -1.219466519 0.380039690 126 0.325101470 -1.219466519 127 0.056521929 0.325101470 128 0.104720679 0.056521929 129 0.208568506 0.104720679 130 0.445078804 0.208568506 131 0.339984356 0.445078804 132 -0.284955527 0.339984356 133 -0.256621865 -0.284955527 134 0.190770410 -0.256621865 135 -1.500659590 0.190770410 136 -0.169433647 -1.500659590 137 0.126339373 -0.169433647 138 -0.442792194 0.126339373 139 0.470675096 -0.442792194 140 -0.142916478 0.470675096 141 -0.631120148 -0.142916478 142 -0.074132208 -0.631120148 143 -0.687269845 -0.074132208 144 -0.585916396 -0.687269845 145 -1.059005637 -0.585916396 146 -1.809229590 -1.059005637 147 -0.006163216 -1.809229590 148 0.502422819 -0.006163216 149 -0.512221399 0.502422819 150 0.277112848 -0.512221399 151 -0.835217767 0.277112848 152 NA -0.835217767 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.376043328 0.134913535 [2,] 0.863081010 0.376043328 [3,] 0.044011159 0.863081010 [4,] -0.631102888 0.044011159 [5,] 1.277747015 -0.631102888 [6,] 0.661080961 1.277747015 [7,] -0.774720994 0.661080961 [8,] 0.575289786 -0.774720994 [9,] 1.450111046 0.575289786 [10,] 0.344746274 1.450111046 [11,] -0.741281548 0.344746274 [12,] 1.275407419 -0.741281548 [13,] -0.052031723 1.275407419 [14,] 0.195495725 -0.052031723 [15,] 0.473856522 0.195495725 [16,] 0.190235268 0.473856522 [17,] 0.086225403 0.190235268 [18,] -0.760474310 0.086225403 [19,] 1.016407960 -0.760474310 [20,] -0.039581561 1.016407960 [21,] -0.322394858 -0.039581561 [22,] 0.340020959 -0.322394858 [23,] 0.510356107 0.340020959 [24,] 0.341990118 0.510356107 [25,] 0.619824743 0.341990118 [26,] 1.190770410 0.619824743 [27,] -0.041998474 1.190770410 [28,] -2.539007329 -0.041998474 [29,] 0.269002788 -2.539007329 [30,] 0.151320581 0.269002788 [31,] 0.379940148 0.151320581 [32,] -0.307662175 0.379940148 [33,] 0.041190453 -0.307662175 [34,] -0.074132208 0.041190453 [35,] 0.271300008 -0.074132208 [36,] -0.433348214 0.271300008 [37,] 0.235856630 -0.433348214 [38,] -0.439655909 0.235856630 [39,] 0.629857992 -0.439655909 [40,] -0.058271463 0.629857992 [41,] 0.307956219 -0.058271463 [42,] 0.234190600 0.307956219 [43,] -0.215967090 0.234190600 [44,] -0.640076889 -0.215967090 [45,] 0.479117148 -0.640076889 [46,] -0.397096291 0.479117148 [47,] -0.687269845 -0.397096291 [48,] -0.322186029 -0.687269845 [49,] 0.203877113 -0.322186029 [50,] 0.232200557 0.203877113 [51,] 0.037515530 0.232200557 [52,] -0.651538813 0.037515530 [53,] 0.086225403 -0.651538813 [54,] 0.383881052 0.086225403 [55,] 0.410149351 0.383881052 [56,] -0.418814635 0.410149351 [57,] 0.195553098 -0.418814635 [58,] -1.074132208 0.195553098 [59,] -0.506969177 -1.074132208 [60,] 0.563720934 -0.506969177 [61,] 0.089575316 0.563720934 [62,] 0.158790893 0.089575316 [63,] -0.249075057 0.158790893 [64,] 0.433738470 -0.249075057 [65,] -0.601587047 0.433738470 [66,] 0.341071880 -0.601587047 [67,] 0.436925267 0.341071880 [68,] 0.537922058 0.436925267 [69,] -0.772467386 0.537922058 [70,] 0.859100482 -0.772467386 [71,] 0.476553156 0.859100482 [72,] -0.540229494 0.476553156 [73,] 0.054239784 -0.540229494 [74,] 0.010469742 0.054239784 [75,] 0.107691978 0.010469742 [76,] 0.655000725 0.107691978 [77,] 0.755126866 0.655000725 [78,] -0.501156337 0.755126866 [79,] -0.413437404 -0.501156337 [80,] -0.110036223 -0.413437404 [81,] -0.439598536 -0.110036223 [82,] 0.273390874 -0.439598536 [83,] 0.841454644 0.273390874 [84,] -0.409503151 0.841454644 [85,] -0.498041831 -0.409503151 [86,] 0.388656162 -0.498041831 [87,] 0.992936045 0.388656162 [88,] 0.357042243 0.992936045 [89,] 0.285427334 0.357042243 [90,] -0.335509901 0.285427334 [91,] -0.562620598 -0.335509901 [92,] -0.280407974 -0.562620598 [93,] -0.234292265 -0.280407974 [94,] -0.208267689 -0.234292265 [95,] 0.688408177 -0.208267689 [96,] 0.340219805 0.688408177 [97,] 0.920582588 0.340219805 [98,] -0.229170187 0.920582588 [99,] 0.349703080 -0.229170187 [100,] 1.003893107 0.349703080 [101,] 0.162575643 1.003893107 [102,] 0.001683252 0.162575643 [103,] -0.161799748 0.001683252 [104,] 0.669102536 -0.161799748 [105,] -0.154665186 0.669102536 [106,] -0.911635109 -0.154665186 [107,] -0.513943091 -0.911635109 [108,] -0.458807951 -0.513943091 [109,] -0.542412555 -0.458807951 [110,] -0.105446731 -0.542412555 [111,] -0.488268383 -0.105446731 [112,] 0.526981818 -0.488268383 [113,] -1.023351079 0.526981818 [114,] -0.335509901 -1.023351079 [115,] 0.193143851 -0.335509901 [116,] 0.052460876 0.193143851 [117,] 0.179998127 0.052460876 [118,] 0.477058320 0.179998127 [119,] 0.008677058 0.477058320 [120,] 0.378694950 0.008677058 [121,] -0.091885892 0.378694950 [122,] -0.646732492 -0.091885892 [123,] -0.349407586 -0.646732492 [124,] 0.380039690 -0.349407586 [125,] -1.219466519 0.380039690 [126,] 0.325101470 -1.219466519 [127,] 0.056521929 0.325101470 [128,] 0.104720679 0.056521929 [129,] 0.208568506 0.104720679 [130,] 0.445078804 0.208568506 [131,] 0.339984356 0.445078804 [132,] -0.284955527 0.339984356 [133,] -0.256621865 -0.284955527 [134,] 0.190770410 -0.256621865 [135,] -1.500659590 0.190770410 [136,] -0.169433647 -1.500659590 [137,] 0.126339373 -0.169433647 [138,] -0.442792194 0.126339373 [139,] 0.470675096 -0.442792194 [140,] -0.142916478 0.470675096 [141,] -0.631120148 -0.142916478 [142,] -0.074132208 -0.631120148 [143,] -0.687269845 -0.074132208 [144,] -0.585916396 -0.687269845 [145,] -1.059005637 -0.585916396 [146,] -1.809229590 -1.059005637 [147,] -0.006163216 -1.809229590 [148,] 0.502422819 -0.006163216 [149,] -0.512221399 0.502422819 [150,] 0.277112848 -0.512221399 [151,] -0.835217767 0.277112848 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.376043328 0.134913535 2 0.863081010 0.376043328 3 0.044011159 0.863081010 4 -0.631102888 0.044011159 5 1.277747015 -0.631102888 6 0.661080961 1.277747015 7 -0.774720994 0.661080961 8 0.575289786 -0.774720994 9 1.450111046 0.575289786 10 0.344746274 1.450111046 11 -0.741281548 0.344746274 12 1.275407419 -0.741281548 13 -0.052031723 1.275407419 14 0.195495725 -0.052031723 15 0.473856522 0.195495725 16 0.190235268 0.473856522 17 0.086225403 0.190235268 18 -0.760474310 0.086225403 19 1.016407960 -0.760474310 20 -0.039581561 1.016407960 21 -0.322394858 -0.039581561 22 0.340020959 -0.322394858 23 0.510356107 0.340020959 24 0.341990118 0.510356107 25 0.619824743 0.341990118 26 1.190770410 0.619824743 27 -0.041998474 1.190770410 28 -2.539007329 -0.041998474 29 0.269002788 -2.539007329 30 0.151320581 0.269002788 31 0.379940148 0.151320581 32 -0.307662175 0.379940148 33 0.041190453 -0.307662175 34 -0.074132208 0.041190453 35 0.271300008 -0.074132208 36 -0.433348214 0.271300008 37 0.235856630 -0.433348214 38 -0.439655909 0.235856630 39 0.629857992 -0.439655909 40 -0.058271463 0.629857992 41 0.307956219 -0.058271463 42 0.234190600 0.307956219 43 -0.215967090 0.234190600 44 -0.640076889 -0.215967090 45 0.479117148 -0.640076889 46 -0.397096291 0.479117148 47 -0.687269845 -0.397096291 48 -0.322186029 -0.687269845 49 0.203877113 -0.322186029 50 0.232200557 0.203877113 51 0.037515530 0.232200557 52 -0.651538813 0.037515530 53 0.086225403 -0.651538813 54 0.383881052 0.086225403 55 0.410149351 0.383881052 56 -0.418814635 0.410149351 57 0.195553098 -0.418814635 58 -1.074132208 0.195553098 59 -0.506969177 -1.074132208 60 0.563720934 -0.506969177 61 0.089575316 0.563720934 62 0.158790893 0.089575316 63 -0.249075057 0.158790893 64 0.433738470 -0.249075057 65 -0.601587047 0.433738470 66 0.341071880 -0.601587047 67 0.436925267 0.341071880 68 0.537922058 0.436925267 69 -0.772467386 0.537922058 70 0.859100482 -0.772467386 71 0.476553156 0.859100482 72 -0.540229494 0.476553156 73 0.054239784 -0.540229494 74 0.010469742 0.054239784 75 0.107691978 0.010469742 76 0.655000725 0.107691978 77 0.755126866 0.655000725 78 -0.501156337 0.755126866 79 -0.413437404 -0.501156337 80 -0.110036223 -0.413437404 81 -0.439598536 -0.110036223 82 0.273390874 -0.439598536 83 0.841454644 0.273390874 84 -0.409503151 0.841454644 85 -0.498041831 -0.409503151 86 0.388656162 -0.498041831 87 0.992936045 0.388656162 88 0.357042243 0.992936045 89 0.285427334 0.357042243 90 -0.335509901 0.285427334 91 -0.562620598 -0.335509901 92 -0.280407974 -0.562620598 93 -0.234292265 -0.280407974 94 -0.208267689 -0.234292265 95 0.688408177 -0.208267689 96 0.340219805 0.688408177 97 0.920582588 0.340219805 98 -0.229170187 0.920582588 99 0.349703080 -0.229170187 100 1.003893107 0.349703080 101 0.162575643 1.003893107 102 0.001683252 0.162575643 103 -0.161799748 0.001683252 104 0.669102536 -0.161799748 105 -0.154665186 0.669102536 106 -0.911635109 -0.154665186 107 -0.513943091 -0.911635109 108 -0.458807951 -0.513943091 109 -0.542412555 -0.458807951 110 -0.105446731 -0.542412555 111 -0.488268383 -0.105446731 112 0.526981818 -0.488268383 113 -1.023351079 0.526981818 114 -0.335509901 -1.023351079 115 0.193143851 -0.335509901 116 0.052460876 0.193143851 117 0.179998127 0.052460876 118 0.477058320 0.179998127 119 0.008677058 0.477058320 120 0.378694950 0.008677058 121 -0.091885892 0.378694950 122 -0.646732492 -0.091885892 123 -0.349407586 -0.646732492 124 0.380039690 -0.349407586 125 -1.219466519 0.380039690 126 0.325101470 -1.219466519 127 0.056521929 0.325101470 128 0.104720679 0.056521929 129 0.208568506 0.104720679 130 0.445078804 0.208568506 131 0.339984356 0.445078804 132 -0.284955527 0.339984356 133 -0.256621865 -0.284955527 134 0.190770410 -0.256621865 135 -1.500659590 0.190770410 136 -0.169433647 -1.500659590 137 0.126339373 -0.169433647 138 -0.442792194 0.126339373 139 0.470675096 -0.442792194 140 -0.142916478 0.470675096 141 -0.631120148 -0.142916478 142 -0.074132208 -0.631120148 143 -0.687269845 -0.074132208 144 -0.585916396 -0.687269845 145 -1.059005637 -0.585916396 146 -1.809229590 -1.059005637 147 -0.006163216 -1.809229590 148 0.502422819 -0.006163216 149 -0.512221399 0.502422819 150 0.277112848 -0.512221399 151 -0.835217767 0.277112848 > 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/7u2lm1291380810.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/84b2p1291380810.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/94b2p1291380810.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/104b2p1291380810.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/111liy1291380810.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/12tczj1291380810.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/130vwd1291380810.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/143ed01291380810.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/157wbo1291380810.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/16sfsc1291380810.tab") + } > > try(system("convert tmp/1gsnv1291380810.ps tmp/1gsnv1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/2qj4g1291380810.ps tmp/2qj4g1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/3qj4g1291380810.ps tmp/3qj4g1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/4qj4g1291380810.ps tmp/4qj4g1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/51tmj1291380810.ps tmp/51tmj1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/61tmj1291380810.ps tmp/61tmj1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/7u2lm1291380810.ps tmp/7u2lm1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/84b2p1291380810.ps tmp/84b2p1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/94b2p1291380810.ps tmp/94b2p1291380810.png",intern=TRUE)) character(0) > try(system("convert tmp/104b2p1291380810.ps tmp/104b2p1291380810.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.120 1.760 9.074