R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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 + ,5 + ,2 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,2 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,2 + ,4 + ,2 + ,5 + ,4 + ,2 + ,4 + ,2 + ,2 + ,2 + ,2 + ,4 + ,3 + ,2 + ,2 + ,2 + ,3 + ,2 + ,4 + ,4 + ,5 + ,1 + ,3 + ,2 + ,4 + ,5 + ,3 + ,5 + ,1 + ,2 + ,1 + ,4 + ,4 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,3 + ,2 + ,3 + ,2 + ,4 + ,4 + ,2 + ,4 + ,1 + ,3 + ,2 + ,2 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,4 + ,2 + ,2 + ,4 + ,2 + ,4 + ,4 + ,3 + ,3 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,3 + ,2 + ,2 + ,2 + ,4 + ,2 + ,4 + ,4 + ,1 + ,1 + ,3 + ,4 + ,3 + ,4 + ,5 + ,1 + ,1 + ,1 + ,4 + ,4 + ,3 + ,4 + ,2 + ,3 + ,3 + ,4 + ,3 + ,3 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,3 + ,4 + ,2 + ,2 + ,3 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,4 + ,4 + ,3 + ,2 + ,4 + ,1 + ,4 + ,2 + ,4 + ,3 + ,5 + ,4 + ,2 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4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+ ,2 + ,3 + ,4 + ,3 + ,2 + ,2 + ,2 + ,4 + ,4 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,2 + ,5 + ,3 + ,5 + ,2 + ,5 + ,2 + ,5 + ,3 + ,1 + ,2 + ,4 + ,1 + ,2 + ,1 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,2 + ,4 + ,5 + ,3 + ,4 + ,2 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,2 + ,5 + ,3 + ,3 + ,2 + ,2 + ,4 + ,2 + ,3 + ,4 + ,3 + ,2 + ,1 + ,1 + ,3 + ,2 + ,3 + ,4 + ,4 + ,4 + ,4 + ,2 + ,4 + ,4 + ,4 + ,3 + ,2 + ,4 + ,1 + ,3 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,3 + ,1 + ,1 + ,5 + ,5 + ,4 + ,2 + ,1 + ,2 + ,2 + ,3 + ,2 + ,5 + ,5 + ,4 + ,2 + ,3 + ,3 + ,3 + ,3 + ,4 + ,2 + ,2 + ,2 + ,3 + ,3 + ,3 + ,4 + ,2 + ,3 + ,2 + ,5 + ,4 + ,4 + ,4 + ,4 + ,3 + ,2 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,4 + ,2 + ,3) + ,dim=c(7 + ,159) + ,dimnames=list(c('standards' + ,'organization' + ,'punished' + ,'secondrate' + ,'mistakes' + ,'competent' + ,'neat') + ,1:159)) > y <- array(NA,dim=c(7,159),dimnames=list(c('standards','organization','punished','secondrate','mistakes','competent','neat'),1:159)) > 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 = '7' > #'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 neat standards organization punished secondrate mistakes competent 1 4 2 5 2 3 3 4 2 4 2 4 2 4 3 4 3 4 4 4 2 4 2 5 4 4 2 4 2 2 2 2 5 4 3 2 2 2 3 2 6 5 4 5 1 3 2 4 7 4 3 5 1 2 1 4 8 3 3 4 3 3 3 4 9 4 3 3 2 3 2 4 10 4 2 4 1 3 2 2 11 4 4 4 4 3 3 3 12 4 4 2 2 4 2 4 13 4 3 3 3 2 2 3 14 2 3 3 2 2 2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 4 79 5 3 5 2 2 2 4 80 4 4 4 2 2 1 4 81 5 2 5 2 4 4 4 82 5 3 3 2 2 2 2 83 4 3 4 1 4 3 3 84 4 4 4 4 2 2 5 85 4 2 4 1 3 1 3 86 4 4 4 1 4 2 3 87 4 2 4 1 3 2 4 88 5 2 5 1 1 1 4 89 4 4 4 4 3 2 4 90 3 3 4 2 2 1 4 91 4 4 4 2 2 2 4 92 3 2 5 1 1 1 3 93 4 2 3 1 3 2 4 94 4 3 3 1 2 2 4 95 4 3 5 3 3 3 4 96 4 5 5 4 5 4 5 97 4 2 4 4 3 1 4 98 3 3 4 3 4 3 4 99 3 4 4 2 2 1 2 100 3 3 4 2 2 1 3 101 3 4 4 3 3 2 3 102 3 3 4 1 2 1 3 103 2 3 4 3 2 3 4 104 3 2 4 2 2 2 4 105 5 3 5 2 3 2 2 106 2 2 2 2 5 1 3 107 2 3 4 2 2 2 3 108 3 2 2 4 3 2 4 109 3 4 4 3 3 1 4 110 3 2 5 1 1 2 2 111 4 4 3 1 1 2 3 112 4 4 4 2 3 4 4 113 3 1 3 1 4 3 4 114 2 5 4 3 5 2 5 115 3 2 4 2 3 5 3 116 4 3 4 2 3 1 3 117 2 4 2 2 3 2 4 118 4 1 1 1 2 1 3 119 4 5 4 3 3 2 3 120 2 3 3 1 2 1 2 121 3 3 4 1 3 1 4 122 3 3 3 2 2 2 3 123 3 3 3 3 4 2 4 124 4 2 5 2 2 2 5 125 4 2 4 1 2 3 4 126 4 4 3 2 4 2 3 127 3 4 4 1 4 1 3 128 4 3 4 2 3 2 3 129 4 3 4 1 3 2 3 130 4 3 4 2 3 3 4 131 2 4 3 3 4 2 4 132 4 3 4 2 2 2 3 133 5 4 4 1 1 2 2 134 4 4 4 1 3 1 3 135 4 2 4 2 2 2 2 136 4 4 4 2 3 2 4 137 3 2 3 1 2 2 4 138 1 4 4 2 2 3 4 139 4 3 4 3 3 1 4 140 3 3 2 4 2 3 4 141 3 2 2 2 4 4 4 142 3 2 4 4 4 2 5 143 1 5 2 5 2 5 3 144 4 2 4 1 2 1 4 145 5 4 3 3 3 2 4 146 4 3 4 2 4 3 4 147 3 3 3 2 4 2 5 148 4 3 2 2 4 2 3 149 3 3 2 1 1 3 2 150 4 4 4 4 4 2 4 151 4 4 3 2 4 1 3 152 4 4 4 2 3 2 4 153 5 4 4 3 1 1 5 154 2 4 2 1 2 2 3 155 3 5 5 4 2 3 3 156 3 3 4 2 2 2 3 157 4 3 4 2 3 2 5 158 4 4 4 4 3 2 4 159 3 4 3 4 3 4 2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) standards organization punished secondrate 2.66021 -0.02165 0.31710 -0.12757 0.01454 mistakes competent -0.05518 0.04891 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.6461 -0.5612 0.1712 0.4357 1.7289 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.66021 0.42574 6.248 3.97e-09 *** standards -0.02165 0.06571 -0.329 0.7423 organization 0.31710 0.07124 4.451 1.64e-05 *** punished -0.12757 0.07323 -1.742 0.0835 . secondrate 0.01454 0.06292 0.231 0.8175 mistakes -0.05518 0.07060 -0.782 0.4356 competent 0.04891 0.07842 0.624 0.5338 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 0.7397 on 152 degrees of freedom Multiple R-squared: 0.1682, Adjusted R-squared: 0.1353 F-statistic: 5.121 on 6 and 152 DF, p-value: 8.09e-05 > 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.213016950 0.426033899 0.7869831 [2,] 0.165618609 0.331237219 0.8343814 [3,] 0.083382563 0.166765125 0.9166174 [4,] 0.068499889 0.136999777 0.9315001 [5,] 0.363035208 0.726070416 0.6369648 [6,] 0.276900227 0.553800454 0.7230998 [7,] 0.201012611 0.402025222 0.7989874 [8,] 0.185781790 0.371563579 0.8142182 [9,] 0.458396568 0.916793135 0.5416034 [10,] 0.469548848 0.939097695 0.5304512 [11,] 0.463855219 0.927710438 0.5361448 [12,] 0.502276917 0.995446165 0.4977231 [13,] 0.463507108 0.927014216 0.5364929 [14,] 0.430016193 0.860032386 0.5699838 [15,] 0.379501237 0.759002474 0.6204988 [16,] 0.332624173 0.665248346 0.6673758 [17,] 0.271262294 0.542524589 0.7287377 [18,] 0.216419125 0.432838251 0.7835809 [19,] 0.178269678 0.356539355 0.8217303 [20,] 0.152116145 0.304232290 0.8478839 [21,] 0.115853621 0.231707241 0.8841464 [22,] 0.333053111 0.666106221 0.6669469 [23,] 0.297145369 0.594290738 0.7028546 [24,] 0.263083999 0.526167998 0.7369160 [25,] 0.215835583 0.431671167 0.7841644 [26,] 0.198192297 0.396384594 0.8018077 [27,] 0.161758586 0.323517172 0.8382414 [28,] 0.239199265 0.478398529 0.7608007 [29,] 0.198900722 0.397801445 0.8010993 [30,] 0.169660483 0.339320965 0.8303395 [31,] 0.186961771 0.373923541 0.8130382 [32,] 0.233162258 0.466324516 0.7668377 [33,] 0.193673143 0.387346286 0.8063269 [34,] 0.187300188 0.374600376 0.8126998 [35,] 0.236482932 0.472965863 0.7635171 [36,] 0.229200782 0.458401564 0.7707992 [37,] 0.192629506 0.385259012 0.8073705 [38,] 0.166216996 0.332433991 0.8337830 [39,] 0.136366294 0.272732589 0.8636337 [40,] 0.112691693 0.225383385 0.8873083 [41,] 0.094225281 0.188450563 0.9057747 [42,] 0.076788372 0.153576744 0.9232116 [43,] 0.061831580 0.123663159 0.9381684 [44,] 0.108726505 0.217453011 0.8912735 [45,] 0.091093473 0.182186946 0.9089065 [46,] 0.074410219 0.148820439 0.9255898 [47,] 0.092774292 0.185548584 0.9072257 [48,] 0.137933341 0.275866683 0.8620667 [49,] 0.113329043 0.226658086 0.8866710 [50,] 0.092541003 0.185082005 0.9074590 [51,] 0.077476339 0.154952678 0.9225237 [52,] 0.061446474 0.122892947 0.9385535 [53,] 0.047862306 0.095724613 0.9521377 [54,] 0.052996404 0.105992808 0.9470036 [55,] 0.042233094 0.084466189 0.9577669 [56,] 0.032823881 0.065647761 0.9671761 [57,] 0.034086279 0.068172557 0.9659137 [58,] 0.027537323 0.055074645 0.9724627 [59,] 0.030680820 0.061361640 0.9693192 [60,] 0.023743279 0.047486558 0.9762567 [61,] 0.018166875 0.036333750 0.9818331 [62,] 0.014946466 0.029892932 0.9850535 [63,] 0.011056920 0.022113841 0.9889431 [64,] 0.008042514 0.016085028 0.9919575 [65,] 0.005794113 0.011588226 0.9942059 [66,] 0.004139347 0.008278694 0.9958607 [67,] 0.004382960 0.008765920 0.9956170 [68,] 0.003115216 0.006230431 0.9968848 [69,] 0.003907930 0.007815861 0.9960921 [70,] 0.005132935 0.010265870 0.9948671 [71,] 0.003755723 0.007511446 0.9962443 [72,] 0.005433648 0.010867296 0.9945664 [73,] 0.018643742 0.037287485 0.9813563 [74,] 0.014687143 0.029374286 0.9853129 [75,] 0.012249702 0.024499404 0.9877503 [76,] 0.009036238 0.018072477 0.9909638 [77,] 0.006840936 0.013681873 0.9931591 [78,] 0.004996704 0.009993408 0.9950033 [79,] 0.005393404 0.010786807 0.9946066 [80,] 0.004489372 0.008978743 0.9955106 [81,] 0.004832156 0.009664313 0.9951678 [82,] 0.003687177 0.007374354 0.9963128 [83,] 0.005981770 0.011963540 0.9940182 [84,] 0.004843134 0.009686267 0.9951569 [85,] 0.004066602 0.008133204 0.9959334 [86,] 0.002942427 0.005884853 0.9970576 [87,] 0.002410013 0.004820026 0.9975900 [88,] 0.001803618 0.003607237 0.9981964 [89,] 0.001549449 0.003098898 0.9984506 [90,] 0.001476344 0.002952689 0.9985237 [91,] 0.001495372 0.002990744 0.9985046 [92,] 0.001243085 0.002486171 0.9987569 [93,] 0.001394538 0.002789077 0.9986055 [94,] 0.004504534 0.009009067 0.9954955 [95,] 0.004491441 0.008982881 0.9955086 [96,] 0.006568228 0.013136456 0.9934318 [97,] 0.010838915 0.021677830 0.9891611 [98,] 0.033899725 0.067799451 0.9661003 [99,] 0.025954124 0.051908249 0.9740459 [100,] 0.024602568 0.049205135 0.9753974 [101,] 0.037714870 0.075429739 0.9622851 [102,] 0.034421406 0.068842813 0.9655786 [103,] 0.040945275 0.081890550 0.9590547 [104,] 0.034592776 0.069185551 0.9654072 [105,] 0.063350438 0.126700876 0.9366496 [106,] 0.053513968 0.107027936 0.9464860 [107,] 0.041691563 0.083383126 0.9583084 [108,] 0.048597607 0.097195214 0.9514024 [109,] 0.050173804 0.100347608 0.9498262 [110,] 0.042040135 0.084080271 0.9579599 [111,] 0.116879782 0.233759564 0.8831202 [112,] 0.140559791 0.281119582 0.8594402 [113,] 0.124850587 0.249701175 0.8751494 [114,] 0.107226722 0.214453444 0.8927733 [115,] 0.083390625 0.166781249 0.9166094 [116,] 0.072183923 0.144367847 0.9278161 [117,] 0.064357644 0.128715287 0.9356424 [118,] 0.085410609 0.170821218 0.9145894 [119,] 0.065107521 0.130215042 0.9348925 [120,] 0.048266723 0.096533447 0.9517333 [121,] 0.047648469 0.095296938 0.9523515 [122,] 0.107825061 0.215650123 0.8921749 [123,] 0.083244035 0.166488070 0.9167560 [124,] 0.180012178 0.360024356 0.8199878 [125,] 0.140349078 0.280698157 0.8596509 [126,] 0.111340365 0.222680731 0.8886596 [127,] 0.090448528 0.180897056 0.9095515 [128,] 0.068860729 0.137721457 0.9311393 [129,] 0.352747394 0.705494789 0.6472526 [130,] 0.292214523 0.584429046 0.7077855 [131,] 0.230094865 0.460189731 0.7699051 [132,] 0.206722873 0.413445746 0.7932771 [133,] 0.299433174 0.598866347 0.7005668 [134,] 0.424388631 0.848777262 0.5756114 [135,] 0.329578448 0.659156896 0.6704216 [136,] 0.500783291 0.998433418 0.4992167 [137,] 0.516710522 0.966578955 0.4832895 [138,] 0.566502083 0.866995833 0.4334979 [139,] 0.453492302 0.906984603 0.5465077 [140,] 0.470471187 0.940942374 0.5295288 > postscript(file="/var/www/html/freestat/rcomp/tmp/1ey321291223514.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/freestat/rcomp/tmp/2ey321291223514.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/freestat/rcomp/tmp/3pqk51291223514.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/freestat/rcomp/tmp/4pqk51291223514.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/freestat/rcomp/tmp/5pqk51291223514.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 = 159 Frequency = 1 1 2 3 4 5 6 -0.02099306 0.28156872 0.22076921 0.35328813 1.06431865 0.83954399 7 8 9 10 11 12 -0.22274372 -0.55467132 0.57967491 0.21117435 0.64345949 0.90388287 13 14 15 16 17 18 0.77069928 -1.40578534 -0.75909370 -0.18655779 -0.68224535 -0.99086262 19 20 21 22 23 24 0.33229440 -0.60541789 -0.90118659 0.39541785 -0.19726736 -0.74453306 25 26 27 28 29 30 0.04329303 0.37377167 0.28421955 0.32602372 0.44087309 0.28421955 31 32 33 34 35 36 1.16142801 0.63519042 0.74277374 0.26702897 -0.64605942 -0.11797850 37 38 39 40 41 42 -1.14589537 0.34139921 0.60842751 -0.73032020 0.93274718 0.22903827 43 44 45 46 47 48 -0.62506569 -1.10260301 -0.75907281 -0.17466887 0.50694305 0.03536307 49 50 51 52 53 54 0.29875930 0.45920730 0.02198595 0.29875930 1.25546694 -0.26582088 55 56 57 58 59 60 0.08613667 0.94547184 1.22638744 0.17118527 -0.23728347 -0.27442906 61 62 63 64 65 66 -0.11681587 0.07981806 0.81079138 0.27446229 0.19844969 0.78171188 67 68 69 70 71 72 0.37493431 -0.78371761 -0.20820397 0.24092719 0.46664063 0.12789291 73 74 75 76 77 78 0.09469205 0.12906289 -0.10260301 -0.74453306 0.13499934 -0.91984770 79 80 81 82 83 84 0.96001159 0.24357803 1.01964846 1.69203584 0.22455146 0.50499677 85 86 87 88 89 90 0.10708248 0.19101636 0.11335316 0.77014985 0.53936762 -0.77806815 91 92 93 94 95 96 0.29875930 -1.18093955 0.43045469 0.46664063 0.12822715 0.27628472 97 98 99 100 101 102 0.44089398 -0.56921107 -0.65860079 -0.72915756 -0.53929582 -0.85673159 103 104 105 106 107 108 -1.54013157 -0.74453306 1.04329303 -1.16021993 -1.67397628 0.13027832 109 110 111 112 113 114 -0.64338769 -1.07684768 0.55173715 0.39458211 -0.55054996 -1.64455033 115 116 117 118 119 120 -0.54461838 0.25630269 -1.08157738 1.05128065 0.48235036 -1.49071947 121 122 123 124 125 126 -0.92018194 -0.35687475 -0.30729081 -0.11054518 0.18307419 0.63569193 127 128 129 130 131 132 -0.86416491 0.31148397 0.18390993 0.31775465 -1.28564463 0.32602372 133 134 135 136 137 138 1.28354621 0.15037484 0.35328813 0.28421955 -0.55500555 -2.64605942 139 140 141 142 143 144 0.33496613 0.22164553 -0.02904694 -0.56737509 -1.44821493 0.07271164 145 146 147 148 149 150 1.72889512 0.30321490 -0.48377544 0.93114728 -0.04871563 0.52482786 151 152 153 154 155 156 0.58051065 0.28421955 1.33678122 -1.14570107 -0.63745612 -0.67397628 157 158 159 0.21366278 0.53936762 0.06465289 > postscript(file="/var/www/html/freestat/rcomp/tmp/6zh181291223514.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.02099306 NA 1 0.28156872 -0.02099306 2 0.22076921 0.28156872 3 0.35328813 0.22076921 4 1.06431865 0.35328813 5 0.83954399 1.06431865 6 -0.22274372 0.83954399 7 -0.55467132 -0.22274372 8 0.57967491 -0.55467132 9 0.21117435 0.57967491 10 0.64345949 0.21117435 11 0.90388287 0.64345949 12 0.77069928 0.90388287 13 -1.40578534 0.77069928 14 -0.75909370 -1.40578534 15 -0.18655779 -0.75909370 16 -0.68224535 -0.18655779 17 -0.99086262 -0.68224535 18 0.33229440 -0.99086262 19 -0.60541789 0.33229440 20 -0.90118659 -0.60541789 21 0.39541785 -0.90118659 22 -0.19726736 0.39541785 23 -0.74453306 -0.19726736 24 0.04329303 -0.74453306 25 0.37377167 0.04329303 26 0.28421955 0.37377167 27 0.32602372 0.28421955 28 0.44087309 0.32602372 29 0.28421955 0.44087309 30 1.16142801 0.28421955 31 0.63519042 1.16142801 32 0.74277374 0.63519042 33 0.26702897 0.74277374 34 -0.64605942 0.26702897 35 -0.11797850 -0.64605942 36 -1.14589537 -0.11797850 37 0.34139921 -1.14589537 38 0.60842751 0.34139921 39 -0.73032020 0.60842751 40 0.93274718 -0.73032020 41 0.22903827 0.93274718 42 -0.62506569 0.22903827 43 -1.10260301 -0.62506569 44 -0.75907281 -1.10260301 45 -0.17466887 -0.75907281 46 0.50694305 -0.17466887 47 0.03536307 0.50694305 48 0.29875930 0.03536307 49 0.45920730 0.29875930 50 0.02198595 0.45920730 51 0.29875930 0.02198595 52 1.25546694 0.29875930 53 -0.26582088 1.25546694 54 0.08613667 -0.26582088 55 0.94547184 0.08613667 56 1.22638744 0.94547184 57 0.17118527 1.22638744 58 -0.23728347 0.17118527 59 -0.27442906 -0.23728347 60 -0.11681587 -0.27442906 61 0.07981806 -0.11681587 62 0.81079138 0.07981806 63 0.27446229 0.81079138 64 0.19844969 0.27446229 65 0.78171188 0.19844969 66 0.37493431 0.78171188 67 -0.78371761 0.37493431 68 -0.20820397 -0.78371761 69 0.24092719 -0.20820397 70 0.46664063 0.24092719 71 0.12789291 0.46664063 72 0.09469205 0.12789291 73 0.12906289 0.09469205 74 -0.10260301 0.12906289 75 -0.74453306 -0.10260301 76 0.13499934 -0.74453306 77 -0.91984770 0.13499934 78 0.96001159 -0.91984770 79 0.24357803 0.96001159 80 1.01964846 0.24357803 81 1.69203584 1.01964846 82 0.22455146 1.69203584 83 0.50499677 0.22455146 84 0.10708248 0.50499677 85 0.19101636 0.10708248 86 0.11335316 0.19101636 87 0.77014985 0.11335316 88 0.53936762 0.77014985 89 -0.77806815 0.53936762 90 0.29875930 -0.77806815 91 -1.18093955 0.29875930 92 0.43045469 -1.18093955 93 0.46664063 0.43045469 94 0.12822715 0.46664063 95 0.27628472 0.12822715 96 0.44089398 0.27628472 97 -0.56921107 0.44089398 98 -0.65860079 -0.56921107 99 -0.72915756 -0.65860079 100 -0.53929582 -0.72915756 101 -0.85673159 -0.53929582 102 -1.54013157 -0.85673159 103 -0.74453306 -1.54013157 104 1.04329303 -0.74453306 105 -1.16021993 1.04329303 106 -1.67397628 -1.16021993 107 0.13027832 -1.67397628 108 -0.64338769 0.13027832 109 -1.07684768 -0.64338769 110 0.55173715 -1.07684768 111 0.39458211 0.55173715 112 -0.55054996 0.39458211 113 -1.64455033 -0.55054996 114 -0.54461838 -1.64455033 115 0.25630269 -0.54461838 116 -1.08157738 0.25630269 117 1.05128065 -1.08157738 118 0.48235036 1.05128065 119 -1.49071947 0.48235036 120 -0.92018194 -1.49071947 121 -0.35687475 -0.92018194 122 -0.30729081 -0.35687475 123 -0.11054518 -0.30729081 124 0.18307419 -0.11054518 125 0.63569193 0.18307419 126 -0.86416491 0.63569193 127 0.31148397 -0.86416491 128 0.18390993 0.31148397 129 0.31775465 0.18390993 130 -1.28564463 0.31775465 131 0.32602372 -1.28564463 132 1.28354621 0.32602372 133 0.15037484 1.28354621 134 0.35328813 0.15037484 135 0.28421955 0.35328813 136 -0.55500555 0.28421955 137 -2.64605942 -0.55500555 138 0.33496613 -2.64605942 139 0.22164553 0.33496613 140 -0.02904694 0.22164553 141 -0.56737509 -0.02904694 142 -1.44821493 -0.56737509 143 0.07271164 -1.44821493 144 1.72889512 0.07271164 145 0.30321490 1.72889512 146 -0.48377544 0.30321490 147 0.93114728 -0.48377544 148 -0.04871563 0.93114728 149 0.52482786 -0.04871563 150 0.58051065 0.52482786 151 0.28421955 0.58051065 152 1.33678122 0.28421955 153 -1.14570107 1.33678122 154 -0.63745612 -1.14570107 155 -0.67397628 -0.63745612 156 0.21366278 -0.67397628 157 0.53936762 0.21366278 158 0.06465289 0.53936762 159 NA 0.06465289 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.28156872 -0.02099306 [2,] 0.22076921 0.28156872 [3,] 0.35328813 0.22076921 [4,] 1.06431865 0.35328813 [5,] 0.83954399 1.06431865 [6,] -0.22274372 0.83954399 [7,] -0.55467132 -0.22274372 [8,] 0.57967491 -0.55467132 [9,] 0.21117435 0.57967491 [10,] 0.64345949 0.21117435 [11,] 0.90388287 0.64345949 [12,] 0.77069928 0.90388287 [13,] -1.40578534 0.77069928 [14,] -0.75909370 -1.40578534 [15,] -0.18655779 -0.75909370 [16,] -0.68224535 -0.18655779 [17,] -0.99086262 -0.68224535 [18,] 0.33229440 -0.99086262 [19,] -0.60541789 0.33229440 [20,] -0.90118659 -0.60541789 [21,] 0.39541785 -0.90118659 [22,] -0.19726736 0.39541785 [23,] -0.74453306 -0.19726736 [24,] 0.04329303 -0.74453306 [25,] 0.37377167 0.04329303 [26,] 0.28421955 0.37377167 [27,] 0.32602372 0.28421955 [28,] 0.44087309 0.32602372 [29,] 0.28421955 0.44087309 [30,] 1.16142801 0.28421955 [31,] 0.63519042 1.16142801 [32,] 0.74277374 0.63519042 [33,] 0.26702897 0.74277374 [34,] -0.64605942 0.26702897 [35,] -0.11797850 -0.64605942 [36,] -1.14589537 -0.11797850 [37,] 0.34139921 -1.14589537 [38,] 0.60842751 0.34139921 [39,] -0.73032020 0.60842751 [40,] 0.93274718 -0.73032020 [41,] 0.22903827 0.93274718 [42,] -0.62506569 0.22903827 [43,] -1.10260301 -0.62506569 [44,] -0.75907281 -1.10260301 [45,] -0.17466887 -0.75907281 [46,] 0.50694305 -0.17466887 [47,] 0.03536307 0.50694305 [48,] 0.29875930 0.03536307 [49,] 0.45920730 0.29875930 [50,] 0.02198595 0.45920730 [51,] 0.29875930 0.02198595 [52,] 1.25546694 0.29875930 [53,] -0.26582088 1.25546694 [54,] 0.08613667 -0.26582088 [55,] 0.94547184 0.08613667 [56,] 1.22638744 0.94547184 [57,] 0.17118527 1.22638744 [58,] -0.23728347 0.17118527 [59,] -0.27442906 -0.23728347 [60,] -0.11681587 -0.27442906 [61,] 0.07981806 -0.11681587 [62,] 0.81079138 0.07981806 [63,] 0.27446229 0.81079138 [64,] 0.19844969 0.27446229 [65,] 0.78171188 0.19844969 [66,] 0.37493431 0.78171188 [67,] -0.78371761 0.37493431 [68,] -0.20820397 -0.78371761 [69,] 0.24092719 -0.20820397 [70,] 0.46664063 0.24092719 [71,] 0.12789291 0.46664063 [72,] 0.09469205 0.12789291 [73,] 0.12906289 0.09469205 [74,] -0.10260301 0.12906289 [75,] -0.74453306 -0.10260301 [76,] 0.13499934 -0.74453306 [77,] -0.91984770 0.13499934 [78,] 0.96001159 -0.91984770 [79,] 0.24357803 0.96001159 [80,] 1.01964846 0.24357803 [81,] 1.69203584 1.01964846 [82,] 0.22455146 1.69203584 [83,] 0.50499677 0.22455146 [84,] 0.10708248 0.50499677 [85,] 0.19101636 0.10708248 [86,] 0.11335316 0.19101636 [87,] 0.77014985 0.11335316 [88,] 0.53936762 0.77014985 [89,] -0.77806815 0.53936762 [90,] 0.29875930 -0.77806815 [91,] -1.18093955 0.29875930 [92,] 0.43045469 -1.18093955 [93,] 0.46664063 0.43045469 [94,] 0.12822715 0.46664063 [95,] 0.27628472 0.12822715 [96,] 0.44089398 0.27628472 [97,] -0.56921107 0.44089398 [98,] -0.65860079 -0.56921107 [99,] -0.72915756 -0.65860079 [100,] -0.53929582 -0.72915756 [101,] -0.85673159 -0.53929582 [102,] -1.54013157 -0.85673159 [103,] -0.74453306 -1.54013157 [104,] 1.04329303 -0.74453306 [105,] -1.16021993 1.04329303 [106,] -1.67397628 -1.16021993 [107,] 0.13027832 -1.67397628 [108,] -0.64338769 0.13027832 [109,] -1.07684768 -0.64338769 [110,] 0.55173715 -1.07684768 [111,] 0.39458211 0.55173715 [112,] -0.55054996 0.39458211 [113,] -1.64455033 -0.55054996 [114,] -0.54461838 -1.64455033 [115,] 0.25630269 -0.54461838 [116,] -1.08157738 0.25630269 [117,] 1.05128065 -1.08157738 [118,] 0.48235036 1.05128065 [119,] -1.49071947 0.48235036 [120,] -0.92018194 -1.49071947 [121,] -0.35687475 -0.92018194 [122,] -0.30729081 -0.35687475 [123,] -0.11054518 -0.30729081 [124,] 0.18307419 -0.11054518 [125,] 0.63569193 0.18307419 [126,] -0.86416491 0.63569193 [127,] 0.31148397 -0.86416491 [128,] 0.18390993 0.31148397 [129,] 0.31775465 0.18390993 [130,] -1.28564463 0.31775465 [131,] 0.32602372 -1.28564463 [132,] 1.28354621 0.32602372 [133,] 0.15037484 1.28354621 [134,] 0.35328813 0.15037484 [135,] 0.28421955 0.35328813 [136,] -0.55500555 0.28421955 [137,] -2.64605942 -0.55500555 [138,] 0.33496613 -2.64605942 [139,] 0.22164553 0.33496613 [140,] -0.02904694 0.22164553 [141,] -0.56737509 -0.02904694 [142,] -1.44821493 -0.56737509 [143,] 0.07271164 -1.44821493 [144,] 1.72889512 0.07271164 [145,] 0.30321490 1.72889512 [146,] -0.48377544 0.30321490 [147,] 0.93114728 -0.48377544 [148,] -0.04871563 0.93114728 [149,] 0.52482786 -0.04871563 [150,] 0.58051065 0.52482786 [151,] 0.28421955 0.58051065 [152,] 1.33678122 0.28421955 [153,] -1.14570107 1.33678122 [154,] -0.63745612 -1.14570107 [155,] -0.67397628 -0.63745612 [156,] 0.21366278 -0.67397628 [157,] 0.53936762 0.21366278 [158,] 0.06465289 0.53936762 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.28156872 -0.02099306 2 0.22076921 0.28156872 3 0.35328813 0.22076921 4 1.06431865 0.35328813 5 0.83954399 1.06431865 6 -0.22274372 0.83954399 7 -0.55467132 -0.22274372 8 0.57967491 -0.55467132 9 0.21117435 0.57967491 10 0.64345949 0.21117435 11 0.90388287 0.64345949 12 0.77069928 0.90388287 13 -1.40578534 0.77069928 14 -0.75909370 -1.40578534 15 -0.18655779 -0.75909370 16 -0.68224535 -0.18655779 17 -0.99086262 -0.68224535 18 0.33229440 -0.99086262 19 -0.60541789 0.33229440 20 -0.90118659 -0.60541789 21 0.39541785 -0.90118659 22 -0.19726736 0.39541785 23 -0.74453306 -0.19726736 24 0.04329303 -0.74453306 25 0.37377167 0.04329303 26 0.28421955 0.37377167 27 0.32602372 0.28421955 28 0.44087309 0.32602372 29 0.28421955 0.44087309 30 1.16142801 0.28421955 31 0.63519042 1.16142801 32 0.74277374 0.63519042 33 0.26702897 0.74277374 34 -0.64605942 0.26702897 35 -0.11797850 -0.64605942 36 -1.14589537 -0.11797850 37 0.34139921 -1.14589537 38 0.60842751 0.34139921 39 -0.73032020 0.60842751 40 0.93274718 -0.73032020 41 0.22903827 0.93274718 42 -0.62506569 0.22903827 43 -1.10260301 -0.62506569 44 -0.75907281 -1.10260301 45 -0.17466887 -0.75907281 46 0.50694305 -0.17466887 47 0.03536307 0.50694305 48 0.29875930 0.03536307 49 0.45920730 0.29875930 50 0.02198595 0.45920730 51 0.29875930 0.02198595 52 1.25546694 0.29875930 53 -0.26582088 1.25546694 54 0.08613667 -0.26582088 55 0.94547184 0.08613667 56 1.22638744 0.94547184 57 0.17118527 1.22638744 58 -0.23728347 0.17118527 59 -0.27442906 -0.23728347 60 -0.11681587 -0.27442906 61 0.07981806 -0.11681587 62 0.81079138 0.07981806 63 0.27446229 0.81079138 64 0.19844969 0.27446229 65 0.78171188 0.19844969 66 0.37493431 0.78171188 67 -0.78371761 0.37493431 68 -0.20820397 -0.78371761 69 0.24092719 -0.20820397 70 0.46664063 0.24092719 71 0.12789291 0.46664063 72 0.09469205 0.12789291 73 0.12906289 0.09469205 74 -0.10260301 0.12906289 75 -0.74453306 -0.10260301 76 0.13499934 -0.74453306 77 -0.91984770 0.13499934 78 0.96001159 -0.91984770 79 0.24357803 0.96001159 80 1.01964846 0.24357803 81 1.69203584 1.01964846 82 0.22455146 1.69203584 83 0.50499677 0.22455146 84 0.10708248 0.50499677 85 0.19101636 0.10708248 86 0.11335316 0.19101636 87 0.77014985 0.11335316 88 0.53936762 0.77014985 89 -0.77806815 0.53936762 90 0.29875930 -0.77806815 91 -1.18093955 0.29875930 92 0.43045469 -1.18093955 93 0.46664063 0.43045469 94 0.12822715 0.46664063 95 0.27628472 0.12822715 96 0.44089398 0.27628472 97 -0.56921107 0.44089398 98 -0.65860079 -0.56921107 99 -0.72915756 -0.65860079 100 -0.53929582 -0.72915756 101 -0.85673159 -0.53929582 102 -1.54013157 -0.85673159 103 -0.74453306 -1.54013157 104 1.04329303 -0.74453306 105 -1.16021993 1.04329303 106 -1.67397628 -1.16021993 107 0.13027832 -1.67397628 108 -0.64338769 0.13027832 109 -1.07684768 -0.64338769 110 0.55173715 -1.07684768 111 0.39458211 0.55173715 112 -0.55054996 0.39458211 113 -1.64455033 -0.55054996 114 -0.54461838 -1.64455033 115 0.25630269 -0.54461838 116 -1.08157738 0.25630269 117 1.05128065 -1.08157738 118 0.48235036 1.05128065 119 -1.49071947 0.48235036 120 -0.92018194 -1.49071947 121 -0.35687475 -0.92018194 122 -0.30729081 -0.35687475 123 -0.11054518 -0.30729081 124 0.18307419 -0.11054518 125 0.63569193 0.18307419 126 -0.86416491 0.63569193 127 0.31148397 -0.86416491 128 0.18390993 0.31148397 129 0.31775465 0.18390993 130 -1.28564463 0.31775465 131 0.32602372 -1.28564463 132 1.28354621 0.32602372 133 0.15037484 1.28354621 134 0.35328813 0.15037484 135 0.28421955 0.35328813 136 -0.55500555 0.28421955 137 -2.64605942 -0.55500555 138 0.33496613 -2.64605942 139 0.22164553 0.33496613 140 -0.02904694 0.22164553 141 -0.56737509 -0.02904694 142 -1.44821493 -0.56737509 143 0.07271164 -1.44821493 144 1.72889512 0.07271164 145 0.30321490 1.72889512 146 -0.48377544 0.30321490 147 0.93114728 -0.48377544 148 -0.04871563 0.93114728 149 0.52482786 -0.04871563 150 0.58051065 0.52482786 151 0.28421955 0.58051065 152 1.33678122 0.28421955 153 -1.14570107 1.33678122 154 -0.63745612 -1.14570107 155 -0.67397628 -0.63745612 156 0.21366278 -0.67397628 157 0.53936762 0.21366278 158 0.06465289 0.53936762 > 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/freestat/rcomp/tmp/7sqjb1291223514.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/freestat/rcomp/tmp/8sqjb1291223514.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/freestat/rcomp/tmp/9sqjb1291223514.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/freestat/rcomp/tmp/10vr3r1291223515.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11ya1w1291223515.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/freestat/rcomp/tmp/12ks031291223515.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/freestat/rcomp/tmp/13y2fb1291223515.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/freestat/rcomp/tmp/1412wh1291223515.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/freestat/rcomp/tmp/1553u51291223515.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/freestat/rcomp/tmp/1684bb1291223515.tab") + } > > try(system("convert tmp/1ey321291223514.ps tmp/1ey321291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/2ey321291223514.ps tmp/2ey321291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/3pqk51291223514.ps tmp/3pqk51291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/4pqk51291223514.ps tmp/4pqk51291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/5pqk51291223514.ps tmp/5pqk51291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/6zh181291223514.ps tmp/6zh181291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/7sqjb1291223514.ps tmp/7sqjb1291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/8sqjb1291223514.ps tmp/8sqjb1291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/9sqjb1291223514.ps tmp/9sqjb1291223514.png",intern=TRUE)) character(0) > try(system("convert tmp/10vr3r1291223515.ps tmp/10vr3r1291223515.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.759 2.630 6.090