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(103.63,100.30,103.64,98.50,103.66,95.10,103.77,93.10,103.88,92.20,103.91,89.00,103.91,86.40,103.92,84.50,104.05,82.70,104.23,80.80,104.30,81.80,104.31,81.80,104.31,82.90,104.34,83.80,104.55,86.20,104.65,86.10,104.73,86.20,104.75,88.80,104.75,89.60,104.76,87.80,104.94,88.30,105.29,88.60,105.38,91.00,105.43,91.50,105.43,95.40,105.42,98.70,105.52,99.90,105.69,98.60,105.72,100.30,105.74,100.20,105.74,100.40,105.74,101.40,105.95,103.00,106.17,109.10,106.34,111.40,106.37,114.10,106.37,121.80,106.36,127.60,106.44,129.90,106.29,128.00,106.23,123.50,106.23,124.00,106.23,127.40,106.23,127.60,106.34,128.40,106.44,131.40,106.44,135.10,106.48,134.00,106.50,144.50,106.57,147.30,106.40,150.90,106.37,148.70,106.25,141.40,106.21,138.90,106.21,139.80,106.24,145.60,106.19,147.90,106.08,148.50,106.13,151.10,106.09,157.50),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal 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 X t 1 103.63 100.3 1 2 103.64 98.5 2 3 103.66 95.1 3 4 103.77 93.1 4 5 103.88 92.2 5 6 103.91 89.0 6 7 103.91 86.4 7 8 103.92 84.5 8 9 104.05 82.7 9 10 104.23 80.8 10 11 104.30 81.8 11 12 104.31 81.8 12 13 104.31 82.9 13 14 104.34 83.8 14 15 104.55 86.2 15 16 104.65 86.1 16 17 104.73 86.2 17 18 104.75 88.8 18 19 104.75 89.6 19 20 104.76 87.8 20 21 104.94 88.3 21 22 105.29 88.6 22 23 105.38 91.0 23 24 105.43 91.5 24 25 105.43 95.4 25 26 105.42 98.7 26 27 105.52 99.9 27 28 105.69 98.6 28 29 105.72 100.3 29 30 105.74 100.2 30 31 105.74 100.4 31 32 105.74 101.4 32 33 105.95 103.0 33 34 106.17 109.1 34 35 106.34 111.4 35 36 106.37 114.1 36 37 106.37 121.8 37 38 106.36 127.6 38 39 106.44 129.9 39 40 106.29 128.0 40 41 106.23 123.5 41 42 106.23 124.0 42 43 106.23 127.4 43 44 106.23 127.6 44 45 106.34 128.4 45 46 106.44 131.4 46 47 106.44 135.1 47 48 106.48 134.0 48 49 106.50 144.5 49 50 106.57 147.3 50 51 106.40 150.9 51 52 106.37 148.7 52 53 106.25 141.4 53 54 106.21 138.9 54 55 106.21 139.8 55 56 106.24 145.6 56 57 106.19 147.9 57 58 106.08 148.5 58 59 106.13 151.1 59 60 106.09 157.5 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X t 105.00359 -0.01564 0.07107 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.72254 -0.22515 0.07195 0.18836 0.69677 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 105.003586 0.368333 285.078 < 2e-16 *** X -0.015642 0.004946 -3.162 0.00251 ** t 0.071066 0.006770 10.497 6.17e-15 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3443 on 57 degrees of freedom Multiple R-squared: 0.8776, Adjusted R-squared: 0.8733 F-statistic: 204.4 on 2 and 57 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 1.139889e-03 2.279778e-03 9.988601e-01 [2,] 1.259573e-04 2.519147e-04 9.998740e-01 [3,] 5.445442e-05 1.089088e-04 9.999455e-01 [4,] 5.878387e-06 1.175677e-05 9.999941e-01 [5,] 5.860471e-06 1.172094e-05 9.999941e-01 [6,] 1.512160e-06 3.024319e-06 9.999985e-01 [7,] 9.182298e-07 1.836460e-06 9.999991e-01 [8,] 8.368448e-07 1.673690e-06 9.999992e-01 [9,] 4.177224e-07 8.354448e-07 9.999996e-01 [10,] 2.149531e-07 4.299062e-07 9.999998e-01 [11,] 9.787317e-08 1.957463e-07 9.999999e-01 [12,] 3.813057e-08 7.626114e-08 1.000000e+00 [13,] 1.874312e-08 3.748623e-08 1.000000e+00 [14,] 3.660596e-08 7.321192e-08 1.000000e+00 [15,] 1.898322e-07 3.796645e-07 9.999998e-01 [16,] 2.682764e-07 5.365529e-07 9.999997e-01 [17,] 2.829934e-05 5.659868e-05 9.999717e-01 [18,] 1.301718e-04 2.603436e-04 9.998698e-01 [19,] 1.639228e-04 3.278456e-04 9.998361e-01 [20,] 1.751348e-04 3.502696e-04 9.998249e-01 [21,] 7.411051e-04 1.482210e-03 9.992589e-01 [22,] 2.777230e-03 5.554460e-03 9.972228e-01 [23,] 3.431144e-03 6.862289e-03 9.965689e-01 [24,] 5.146862e-03 1.029372e-02 9.948531e-01 [25,] 9.167909e-03 1.833582e-02 9.908321e-01 [26,] 3.007636e-02 6.015273e-02 9.699236e-01 [27,] 2.210461e-01 4.420922e-01 7.789539e-01 [28,] 3.464599e-01 6.929199e-01 6.535401e-01 [29,] 3.627809e-01 7.255617e-01 6.372191e-01 [30,] 3.428977e-01 6.857953e-01 6.571023e-01 [31,] 2.854034e-01 5.708069e-01 7.145966e-01 [32,] 2.412410e-01 4.824820e-01 7.587590e-01 [33,] 2.854602e-01 5.709205e-01 7.145398e-01 [34,] 2.662562e-01 5.325125e-01 7.337438e-01 [35,] 5.188752e-01 9.622496e-01 4.811248e-01 [36,] 7.753111e-01 4.493778e-01 2.246889e-01 [37,] 9.168727e-01 1.662546e-01 8.312731e-02 [38,] 9.879749e-01 2.405023e-02 1.202511e-02 [39,] 9.997406e-01 5.188169e-04 2.594085e-04 [40,] 9.999716e-01 5.684223e-05 2.842112e-05 [41,] 9.999636e-01 7.277119e-05 3.638560e-05 [42,] 9.999644e-01 7.112609e-05 3.556304e-05 [43,] 9.998951e-01 2.098983e-04 1.049491e-04 [44,] 9.996562e-01 6.876762e-04 3.438381e-04 [45,] 9.999570e-01 8.590778e-05 4.295389e-05 [46,] 9.998119e-01 3.762710e-04 1.881355e-04 [47,] 9.992743e-01 1.451471e-03 7.257354e-04 [48,] 9.981213e-01 3.757434e-03 1.878717e-03 [49,] 9.954697e-01 9.060504e-03 4.530252e-03 > postscript(file="/var/www/html/rcomp/tmp/1t1l71258576024.ps",horizontal=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/2ejka1258576024.ps",horizontal=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/3npoa1258576024.ps",horizontal=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/4vwq01258576024.ps",horizontal=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/5dvc21258576024.ps",horizontal=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 = 60 Frequency = 1 1 2 3 4 5 6 0.124279400 0.035056738 -0.069193751 -0.061544891 -0.036689400 -0.127811411 7 8 9 10 11 12 -0.239547986 -0.330334887 -0.299557549 -0.220344450 -0.205768412 -0.266834768 13 14 15 16 17 18 -0.320694491 -0.347682693 -0.171207307 -0.143837901 -0.133340017 -0.143736152 19 20 21 22 23 24 -0.202288593 -0.291511255 -0.174756414 0.108869949 0.165345335 0.152100176 25 26 27 28 29 30 0.142039152 0.112592692 0.160297207 0.238895742 0.224421454 0.171790859 31 32 33 34 35 36 0.103852983 0.048429020 0.212390493 0.456742731 0.591653879 0.592821983 37 38 39 40 41 42 0.642202050 0.651861571 0.696772718 0.445985817 0.244528696 0.181283537 43 44 45 46 47 48 0.163401316 0.095463439 0.146910998 0.222771820 0.209582317 0.161309330 49 50 51 52 53 54 0.274488095 0.317220439 0.132466697 -0.003012922 -0.308268742 -0.458441078 55 56 57 58 59 60 -0.515429280 -0.465769759 -0.550858612 -0.722539532 -0.702935667 -0.713890710 > postscript(file="/var/www/html/rcomp/tmp/6obj61258576024.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.124279400 NA 1 0.035056738 0.124279400 2 -0.069193751 0.035056738 3 -0.061544891 -0.069193751 4 -0.036689400 -0.061544891 5 -0.127811411 -0.036689400 6 -0.239547986 -0.127811411 7 -0.330334887 -0.239547986 8 -0.299557549 -0.330334887 9 -0.220344450 -0.299557549 10 -0.205768412 -0.220344450 11 -0.266834768 -0.205768412 12 -0.320694491 -0.266834768 13 -0.347682693 -0.320694491 14 -0.171207307 -0.347682693 15 -0.143837901 -0.171207307 16 -0.133340017 -0.143837901 17 -0.143736152 -0.133340017 18 -0.202288593 -0.143736152 19 -0.291511255 -0.202288593 20 -0.174756414 -0.291511255 21 0.108869949 -0.174756414 22 0.165345335 0.108869949 23 0.152100176 0.165345335 24 0.142039152 0.152100176 25 0.112592692 0.142039152 26 0.160297207 0.112592692 27 0.238895742 0.160297207 28 0.224421454 0.238895742 29 0.171790859 0.224421454 30 0.103852983 0.171790859 31 0.048429020 0.103852983 32 0.212390493 0.048429020 33 0.456742731 0.212390493 34 0.591653879 0.456742731 35 0.592821983 0.591653879 36 0.642202050 0.592821983 37 0.651861571 0.642202050 38 0.696772718 0.651861571 39 0.445985817 0.696772718 40 0.244528696 0.445985817 41 0.181283537 0.244528696 42 0.163401316 0.181283537 43 0.095463439 0.163401316 44 0.146910998 0.095463439 45 0.222771820 0.146910998 46 0.209582317 0.222771820 47 0.161309330 0.209582317 48 0.274488095 0.161309330 49 0.317220439 0.274488095 50 0.132466697 0.317220439 51 -0.003012922 0.132466697 52 -0.308268742 -0.003012922 53 -0.458441078 -0.308268742 54 -0.515429280 -0.458441078 55 -0.465769759 -0.515429280 56 -0.550858612 -0.465769759 57 -0.722539532 -0.550858612 58 -0.702935667 -0.722539532 59 -0.713890710 -0.702935667 60 NA -0.713890710 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.035056738 0.124279400 [2,] -0.069193751 0.035056738 [3,] -0.061544891 -0.069193751 [4,] -0.036689400 -0.061544891 [5,] -0.127811411 -0.036689400 [6,] -0.239547986 -0.127811411 [7,] -0.330334887 -0.239547986 [8,] -0.299557549 -0.330334887 [9,] -0.220344450 -0.299557549 [10,] -0.205768412 -0.220344450 [11,] -0.266834768 -0.205768412 [12,] -0.320694491 -0.266834768 [13,] -0.347682693 -0.320694491 [14,] -0.171207307 -0.347682693 [15,] -0.143837901 -0.171207307 [16,] -0.133340017 -0.143837901 [17,] -0.143736152 -0.133340017 [18,] -0.202288593 -0.143736152 [19,] -0.291511255 -0.202288593 [20,] -0.174756414 -0.291511255 [21,] 0.108869949 -0.174756414 [22,] 0.165345335 0.108869949 [23,] 0.152100176 0.165345335 [24,] 0.142039152 0.152100176 [25,] 0.112592692 0.142039152 [26,] 0.160297207 0.112592692 [27,] 0.238895742 0.160297207 [28,] 0.224421454 0.238895742 [29,] 0.171790859 0.224421454 [30,] 0.103852983 0.171790859 [31,] 0.048429020 0.103852983 [32,] 0.212390493 0.048429020 [33,] 0.456742731 0.212390493 [34,] 0.591653879 0.456742731 [35,] 0.592821983 0.591653879 [36,] 0.642202050 0.592821983 [37,] 0.651861571 0.642202050 [38,] 0.696772718 0.651861571 [39,] 0.445985817 0.696772718 [40,] 0.244528696 0.445985817 [41,] 0.181283537 0.244528696 [42,] 0.163401316 0.181283537 [43,] 0.095463439 0.163401316 [44,] 0.146910998 0.095463439 [45,] 0.222771820 0.146910998 [46,] 0.209582317 0.222771820 [47,] 0.161309330 0.209582317 [48,] 0.274488095 0.161309330 [49,] 0.317220439 0.274488095 [50,] 0.132466697 0.317220439 [51,] -0.003012922 0.132466697 [52,] -0.308268742 -0.003012922 [53,] -0.458441078 -0.308268742 [54,] -0.515429280 -0.458441078 [55,] -0.465769759 -0.515429280 [56,] -0.550858612 -0.465769759 [57,] -0.722539532 -0.550858612 [58,] -0.702935667 -0.722539532 [59,] -0.713890710 -0.702935667 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.035056738 0.124279400 2 -0.069193751 0.035056738 3 -0.061544891 -0.069193751 4 -0.036689400 -0.061544891 5 -0.127811411 -0.036689400 6 -0.239547986 -0.127811411 7 -0.330334887 -0.239547986 8 -0.299557549 -0.330334887 9 -0.220344450 -0.299557549 10 -0.205768412 -0.220344450 11 -0.266834768 -0.205768412 12 -0.320694491 -0.266834768 13 -0.347682693 -0.320694491 14 -0.171207307 -0.347682693 15 -0.143837901 -0.171207307 16 -0.133340017 -0.143837901 17 -0.143736152 -0.133340017 18 -0.202288593 -0.143736152 19 -0.291511255 -0.202288593 20 -0.174756414 -0.291511255 21 0.108869949 -0.174756414 22 0.165345335 0.108869949 23 0.152100176 0.165345335 24 0.142039152 0.152100176 25 0.112592692 0.142039152 26 0.160297207 0.112592692 27 0.238895742 0.160297207 28 0.224421454 0.238895742 29 0.171790859 0.224421454 30 0.103852983 0.171790859 31 0.048429020 0.103852983 32 0.212390493 0.048429020 33 0.456742731 0.212390493 34 0.591653879 0.456742731 35 0.592821983 0.591653879 36 0.642202050 0.592821983 37 0.651861571 0.642202050 38 0.696772718 0.651861571 39 0.445985817 0.696772718 40 0.244528696 0.445985817 41 0.181283537 0.244528696 42 0.163401316 0.181283537 43 0.095463439 0.163401316 44 0.146910998 0.095463439 45 0.222771820 0.146910998 46 0.209582317 0.222771820 47 0.161309330 0.209582317 48 0.274488095 0.161309330 49 0.317220439 0.274488095 50 0.132466697 0.317220439 51 -0.003012922 0.132466697 52 -0.308268742 -0.003012922 53 -0.458441078 -0.308268742 54 -0.515429280 -0.458441078 55 -0.465769759 -0.515429280 56 -0.550858612 -0.465769759 57 -0.722539532 -0.550858612 58 -0.702935667 -0.722539532 59 -0.713890710 -0.702935667 > 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/7x8rc1258576024.ps",horizontal=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/8k7tf1258576024.ps",horizontal=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/9r92r1258576024.ps",horizontal=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/1019uw1258576024.ps",horizontal=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/11ey9i1258576024.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/12doqd1258576024.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/13r25l1258576024.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/1462de1258576024.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/1542go1258576024.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/16jw751258576024.tab") + } > > system("convert tmp/1t1l71258576024.ps tmp/1t1l71258576024.png") > system("convert tmp/2ejka1258576024.ps tmp/2ejka1258576024.png") > system("convert tmp/3npoa1258576024.ps tmp/3npoa1258576024.png") > system("convert tmp/4vwq01258576024.ps tmp/4vwq01258576024.png") > system("convert tmp/5dvc21258576024.ps tmp/5dvc21258576024.png") > system("convert tmp/6obj61258576024.ps tmp/6obj61258576024.png") > system("convert tmp/7x8rc1258576024.ps tmp/7x8rc1258576024.png") > system("convert tmp/8k7tf1258576024.ps tmp/8k7tf1258576024.png") > system("convert tmp/9r92r1258576024.ps tmp/9r92r1258576024.png") > system("convert tmp/1019uw1258576024.ps tmp/1019uw1258576024.png") > > > proc.time() user system elapsed 2.423 1.564 3.425