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(8.803,3,0,0.000,3,2,1.219,1,0,-0.083,3,0,7.843,4,1.8,2.356,4,0.7,-3.772,1,3.9,5.075,4,1,1.194,1,3.6,3.954,1,1.4,-0.856,4,1.5,6.142,5,0.7,-0.598,2,2.7,5.232,5,0,-2.590,1,2.1,1.099,2,0,-0.242,2,4.1,-1.609,2,1.2,0.344,1,1.3,4.094,1,6.1,6.271,5,0.3,3.320,5,0.5,-2.120,2,3.4,5.333,1,0,4.443,1,1.5,3.593,1,0,-2.293,3,3.4,0.039,4,0.8,6.256,5,0.8,4.605,1,0,3.555,4,0,-5.298,4,1.4,-4.605,1,2,4.127,1,1.9,-2.104,1,2.4,0.300,3,2.8,-3.772,3,1.3,-3.037,3,2,0.531,1,5.6,1.253,1,3.1,5.521,5,1,-0.734,2,1.8,2.303,4,0.9,0.482,2,1.8,5.257,4,1.9,0.916,5,0.9,8.364,2,0,-1.273,3,2.6,8.351,1,2.4,1.917,2,1.2,-0.288,2,0.9,1.281,3,0.5,2.697,5,0,4.016,5,0.6,0.336,2,0,-2.813,2,2.2,-0.105,2,2.3,0.693,3,0.5,-2.263,2,2.6,1.433,4,0.6,1.253,1,6.6,1.399,1,0),dim=c(3,62),dimnames=list(c('gewicht','gevaar','slowsleep'),1:62)) > y <- array(NA,dim=c(3,62),dimnames=list(c('gewicht','gevaar','slowsleep'),1:62)) > 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 = '3' > #'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 slowsleep gewicht gevaar 1 0.0 8.803 3 2 2.0 0.000 3 3 0.0 1.219 1 4 0.0 -0.083 3 5 1.8 7.843 4 6 0.7 2.356 4 7 3.9 -3.772 1 8 1.0 5.075 4 9 3.6 1.194 1 10 1.4 3.954 1 11 1.5 -0.856 4 12 0.7 6.142 5 13 2.7 -0.598 2 14 0.0 5.232 5 15 2.1 -2.590 1 16 0.0 1.099 2 17 4.1 -0.242 2 18 1.2 -1.609 2 19 1.3 0.344 1 20 6.1 4.094 1 21 0.3 6.271 5 22 0.5 3.320 5 23 3.4 -2.120 2 24 0.0 5.333 1 25 1.5 4.443 1 26 0.0 3.593 1 27 3.4 -2.293 3 28 0.8 0.039 4 29 0.8 6.256 5 30 0.0 4.605 1 31 0.0 3.555 4 32 1.4 -5.298 4 33 2.0 -4.605 1 34 1.9 4.127 1 35 2.4 -2.104 1 36 2.8 0.300 3 37 1.3 -3.772 3 38 2.0 -3.037 3 39 5.6 0.531 1 40 3.1 1.253 1 41 1.0 5.521 5 42 1.8 -0.734 2 43 0.9 2.303 4 44 1.8 0.482 2 45 1.9 5.257 4 46 0.9 0.916 5 47 0.0 8.364 2 48 2.6 -1.273 3 49 2.4 8.351 1 50 1.2 1.917 2 51 0.9 -0.288 2 52 0.5 1.281 3 53 0.0 2.697 5 54 0.6 4.016 5 55 0.0 0.336 2 56 2.2 -2.813 2 57 2.3 -0.105 2 58 0.5 0.693 3 59 2.6 -2.263 2 60 0.6 1.433 4 61 6.6 1.253 1 62 0.0 1.399 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) gewicht gevaar 2.7016 -0.1055 -0.3623 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.2107 -0.7970 -0.1178 0.6374 4.3929 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.70159 0.36080 7.488 4.03e-10 *** gewicht -0.10550 0.05356 -1.970 0.05358 . gevaar -0.36230 0.12503 -2.898 0.00527 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.364 on 59 degrees of freedom Multiple R-squared: 0.2143, Adjusted R-squared: 0.1876 F-statistic: 8.044 on 2 and 59 DF, p-value: 0.000814 > 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.364505089 0.72901018 0.6354949 [2,] 0.728299028 0.54340194 0.2717010 [3,] 0.599067378 0.80186524 0.4009326 [4,] 0.659890213 0.68021957 0.3401098 [5,] 0.549878575 0.90024285 0.4501214 [6,] 0.434234228 0.86846846 0.5657658 [7,] 0.333169229 0.66633846 0.6668308 [8,] 0.263740565 0.52748113 0.7362594 [9,] 0.195856573 0.39171315 0.8041434 [10,] 0.140636416 0.28127283 0.8593636 [11,] 0.187946711 0.37589342 0.8120533 [12,] 0.305427671 0.61085534 0.6945723 [13,] 0.265821597 0.53164319 0.7341784 [14,] 0.222412434 0.44482487 0.7775876 [15,] 0.805689975 0.38862005 0.1943100 [16,] 0.745162956 0.50967409 0.2548370 [17,] 0.676539581 0.64692084 0.3234604 [18,] 0.659911037 0.68017793 0.3400890 [19,] 0.717362144 0.56527571 0.2826379 [20,] 0.652846225 0.69430755 0.3471538 [21,] 0.712357645 0.57528471 0.2876424 [22,] 0.717866742 0.56426652 0.2821333 [23,] 0.660651485 0.67869703 0.3393485 [24,] 0.599933585 0.80013283 0.4000664 [25,] 0.656378890 0.68724222 0.3436211 [26,] 0.614867508 0.77026498 0.3851325 [27,] 0.554240046 0.89151991 0.4457600 [28,] 0.504993198 0.99001360 0.4950068 [29,] 0.435515578 0.87103116 0.5644844 [30,] 0.365125457 0.73025091 0.6348745 [31,] 0.346668614 0.69333723 0.6533314 [32,] 0.293904821 0.58780964 0.7060952 [33,] 0.230744409 0.46148882 0.7692556 [34,] 0.541791943 0.91641611 0.4582081 [35,] 0.492680438 0.98536088 0.5073196 [36,] 0.433219314 0.86643863 0.5667807 [37,] 0.355728526 0.71145705 0.6442715 [38,] 0.282019665 0.56403933 0.7179803 [39,] 0.215548332 0.43109666 0.7844517 [40,] 0.207655815 0.41531163 0.7923442 [41,] 0.159468277 0.31893655 0.8405317 [42,] 0.140146415 0.28029283 0.8598536 [43,] 0.123174448 0.24634890 0.8768256 [44,] 0.086780109 0.17356022 0.9132199 [45,] 0.059052721 0.11810544 0.9409473 [46,] 0.044285894 0.08857179 0.9557141 [47,] 0.029625670 0.05925134 0.9703743 [48,] 0.015982240 0.03196448 0.9840178 [49,] 0.009632876 0.01926575 0.9903671 [50,] 0.013267874 0.02653575 0.9867321 [51,] 0.005330708 0.01066142 0.9946693 > postscript(file="/var/www/html/rcomp/tmp/1sayq1292353255.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/2sayq1292353255.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/3sayq1292353255.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/43jxb1292353255.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/53jxb1292353255.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 = 62 Frequency = 1 1 2 3 4 5 6 -0.685992571 0.385301270 -2.210692545 -1.623455132 1.375026998 -0.303845056 7 8 9 10 11 12 1.162762819 0.283006249 1.386669985 -0.522153257 0.157292717 0.457871937 13 14 15 16 17 18 0.659914531 -0.338131994 -0.512537570 -1.861053962 2.097472113 -0.946744781 19 20 21 22 23 24 -1.003004017 4.192616578 0.071481286 -0.039845748 1.199345319 -1.776670377 25 26 27 28 29 30 -0.370564332 -1.960238333 1.543392464 -0.448285835 0.569898803 -1.853473522 31 32 33 34 35 36 -0.877351965 -0.411333065 -0.825117703 -0.003901961 -0.161265141 1.216950918 37 38 39 40 41 42 -0.712640299 0.064901338 3.316724264 0.892894416 0.692357167 -0.254433309 43 44 45 46 47 48 -0.109436494 -0.126146737 1.202207036 0.106535076 -1.094604997 0.851001265 49 50 51 52 53 54 0.941725077 -0.574755923 -1.107380833 -0.979554735 -0.605571516 0.133581435 55 56 57 58 59 60 -1.941549566 -0.073765367 0.311925452 -1.041588044 0.384258987 -0.501220472 61 62 4.392894416 -2.191702756 > postscript(file="/var/www/html/rcomp/tmp/63jxb1292353255.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 = 62 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.685992571 NA 1 0.385301270 -0.685992571 2 -2.210692545 0.385301270 3 -1.623455132 -2.210692545 4 1.375026998 -1.623455132 5 -0.303845056 1.375026998 6 1.162762819 -0.303845056 7 0.283006249 1.162762819 8 1.386669985 0.283006249 9 -0.522153257 1.386669985 10 0.157292717 -0.522153257 11 0.457871937 0.157292717 12 0.659914531 0.457871937 13 -0.338131994 0.659914531 14 -0.512537570 -0.338131994 15 -1.861053962 -0.512537570 16 2.097472113 -1.861053962 17 -0.946744781 2.097472113 18 -1.003004017 -0.946744781 19 4.192616578 -1.003004017 20 0.071481286 4.192616578 21 -0.039845748 0.071481286 22 1.199345319 -0.039845748 23 -1.776670377 1.199345319 24 -0.370564332 -1.776670377 25 -1.960238333 -0.370564332 26 1.543392464 -1.960238333 27 -0.448285835 1.543392464 28 0.569898803 -0.448285835 29 -1.853473522 0.569898803 30 -0.877351965 -1.853473522 31 -0.411333065 -0.877351965 32 -0.825117703 -0.411333065 33 -0.003901961 -0.825117703 34 -0.161265141 -0.003901961 35 1.216950918 -0.161265141 36 -0.712640299 1.216950918 37 0.064901338 -0.712640299 38 3.316724264 0.064901338 39 0.892894416 3.316724264 40 0.692357167 0.892894416 41 -0.254433309 0.692357167 42 -0.109436494 -0.254433309 43 -0.126146737 -0.109436494 44 1.202207036 -0.126146737 45 0.106535076 1.202207036 46 -1.094604997 0.106535076 47 0.851001265 -1.094604997 48 0.941725077 0.851001265 49 -0.574755923 0.941725077 50 -1.107380833 -0.574755923 51 -0.979554735 -1.107380833 52 -0.605571516 -0.979554735 53 0.133581435 -0.605571516 54 -1.941549566 0.133581435 55 -0.073765367 -1.941549566 56 0.311925452 -0.073765367 57 -1.041588044 0.311925452 58 0.384258987 -1.041588044 59 -0.501220472 0.384258987 60 4.392894416 -0.501220472 61 -2.191702756 4.392894416 62 NA -2.191702756 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.385301270 -0.685992571 [2,] -2.210692545 0.385301270 [3,] -1.623455132 -2.210692545 [4,] 1.375026998 -1.623455132 [5,] -0.303845056 1.375026998 [6,] 1.162762819 -0.303845056 [7,] 0.283006249 1.162762819 [8,] 1.386669985 0.283006249 [9,] -0.522153257 1.386669985 [10,] 0.157292717 -0.522153257 [11,] 0.457871937 0.157292717 [12,] 0.659914531 0.457871937 [13,] -0.338131994 0.659914531 [14,] -0.512537570 -0.338131994 [15,] -1.861053962 -0.512537570 [16,] 2.097472113 -1.861053962 [17,] -0.946744781 2.097472113 [18,] -1.003004017 -0.946744781 [19,] 4.192616578 -1.003004017 [20,] 0.071481286 4.192616578 [21,] -0.039845748 0.071481286 [22,] 1.199345319 -0.039845748 [23,] -1.776670377 1.199345319 [24,] -0.370564332 -1.776670377 [25,] -1.960238333 -0.370564332 [26,] 1.543392464 -1.960238333 [27,] -0.448285835 1.543392464 [28,] 0.569898803 -0.448285835 [29,] -1.853473522 0.569898803 [30,] -0.877351965 -1.853473522 [31,] -0.411333065 -0.877351965 [32,] -0.825117703 -0.411333065 [33,] -0.003901961 -0.825117703 [34,] -0.161265141 -0.003901961 [35,] 1.216950918 -0.161265141 [36,] -0.712640299 1.216950918 [37,] 0.064901338 -0.712640299 [38,] 3.316724264 0.064901338 [39,] 0.892894416 3.316724264 [40,] 0.692357167 0.892894416 [41,] -0.254433309 0.692357167 [42,] -0.109436494 -0.254433309 [43,] -0.126146737 -0.109436494 [44,] 1.202207036 -0.126146737 [45,] 0.106535076 1.202207036 [46,] -1.094604997 0.106535076 [47,] 0.851001265 -1.094604997 [48,] 0.941725077 0.851001265 [49,] -0.574755923 0.941725077 [50,] -1.107380833 -0.574755923 [51,] -0.979554735 -1.107380833 [52,] -0.605571516 -0.979554735 [53,] 0.133581435 -0.605571516 [54,] -1.941549566 0.133581435 [55,] -0.073765367 -1.941549566 [56,] 0.311925452 -0.073765367 [57,] -1.041588044 0.311925452 [58,] 0.384258987 -1.041588044 [59,] -0.501220472 0.384258987 [60,] 4.392894416 -0.501220472 [61,] -2.191702756 4.392894416 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.385301270 -0.685992571 2 -2.210692545 0.385301270 3 -1.623455132 -2.210692545 4 1.375026998 -1.623455132 5 -0.303845056 1.375026998 6 1.162762819 -0.303845056 7 0.283006249 1.162762819 8 1.386669985 0.283006249 9 -0.522153257 1.386669985 10 0.157292717 -0.522153257 11 0.457871937 0.157292717 12 0.659914531 0.457871937 13 -0.338131994 0.659914531 14 -0.512537570 -0.338131994 15 -1.861053962 -0.512537570 16 2.097472113 -1.861053962 17 -0.946744781 2.097472113 18 -1.003004017 -0.946744781 19 4.192616578 -1.003004017 20 0.071481286 4.192616578 21 -0.039845748 0.071481286 22 1.199345319 -0.039845748 23 -1.776670377 1.199345319 24 -0.370564332 -1.776670377 25 -1.960238333 -0.370564332 26 1.543392464 -1.960238333 27 -0.448285835 1.543392464 28 0.569898803 -0.448285835 29 -1.853473522 0.569898803 30 -0.877351965 -1.853473522 31 -0.411333065 -0.877351965 32 -0.825117703 -0.411333065 33 -0.003901961 -0.825117703 34 -0.161265141 -0.003901961 35 1.216950918 -0.161265141 36 -0.712640299 1.216950918 37 0.064901338 -0.712640299 38 3.316724264 0.064901338 39 0.892894416 3.316724264 40 0.692357167 0.892894416 41 -0.254433309 0.692357167 42 -0.109436494 -0.254433309 43 -0.126146737 -0.109436494 44 1.202207036 -0.126146737 45 0.106535076 1.202207036 46 -1.094604997 0.106535076 47 0.851001265 -1.094604997 48 0.941725077 0.851001265 49 -0.574755923 0.941725077 50 -1.107380833 -0.574755923 51 -0.979554735 -1.107380833 52 -0.605571516 -0.979554735 53 0.133581435 -0.605571516 54 -1.941549566 0.133581435 55 -0.073765367 -1.941549566 56 0.311925452 -0.073765367 57 -1.041588044 0.311925452 58 0.384258987 -1.041588044 59 -0.501220472 0.384258987 60 4.392894416 -0.501220472 61 -2.191702756 4.392894416 > 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/7ebxe1292353255.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/86keh1292353255.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/96keh1292353255.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/10hbdk1292353255.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/113uu81292353255.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/126cse1292353255.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/13k4qn1292353255.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/14vdp81292353255.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/15yw5v1292353255.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/16z9sb1292353255.tab") + } > > try(system("convert tmp/1sayq1292353255.ps tmp/1sayq1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/2sayq1292353255.ps tmp/2sayq1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/3sayq1292353255.ps tmp/3sayq1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/43jxb1292353255.ps tmp/43jxb1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/53jxb1292353255.ps tmp/53jxb1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/63jxb1292353255.ps tmp/63jxb1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/7ebxe1292353255.ps tmp/7ebxe1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/86keh1292353255.ps tmp/86keh1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/96keh1292353255.ps tmp/96keh1292353255.png",intern=TRUE)) character(0) > try(system("convert tmp/10hbdk1292353255.ps tmp/10hbdk1292353255.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.584 1.642 6.997