R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(135094,135411,135698,135880,135891,135971,136173,136358,136514,136506,136711,136891,137094,137182,137400,137479,137620,137687,137638,137612,137681,137772,137899,137983,137996,137913,137841,137656,137423,137245,137014,136747,136313,135804,135002,134383,133563,132837,132041,131381,130995,130493,130193,129962,129726,129505,129450,129320,129281,129246,129438,129715,130173,129981,129932,129873,129844,130015,130108,130260),dim=c(1,60),dimnames=list(c('aantal_WNs'),1:60)) > y <- array(NA,dim=c(1,60),dimnames=list(c('aantal_WNs'),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 = 'No Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > library(lattice) > library(lmtest) Loading required package: zoo > 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 aantal_WNs M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 135094 1 0 0 0 0 0 0 0 0 0 0 2 135411 0 1 0 0 0 0 0 0 0 0 0 3 135698 0 0 1 0 0 0 0 0 0 0 0 4 135880 0 0 0 1 0 0 0 0 0 0 0 5 135891 0 0 0 0 1 0 0 0 0 0 0 6 135971 0 0 0 0 0 1 0 0 0 0 0 7 136173 0 0 0 0 0 0 1 0 0 0 0 8 136358 0 0 0 0 0 0 0 1 0 0 0 9 136514 0 0 0 0 0 0 0 0 1 0 0 10 136506 0 0 0 0 0 0 0 0 0 1 0 11 136711 0 0 0 0 0 0 0 0 0 0 1 12 136891 0 0 0 0 0 0 0 0 0 0 0 13 137094 1 0 0 0 0 0 0 0 0 0 0 14 137182 0 1 0 0 0 0 0 0 0 0 0 15 137400 0 0 1 0 0 0 0 0 0 0 0 16 137479 0 0 0 1 0 0 0 0 0 0 0 17 137620 0 0 0 0 1 0 0 0 0 0 0 18 137687 0 0 0 0 0 1 0 0 0 0 0 19 137638 0 0 0 0 0 0 1 0 0 0 0 20 137612 0 0 0 0 0 0 0 1 0 0 0 21 137681 0 0 0 0 0 0 0 0 1 0 0 22 137772 0 0 0 0 0 0 0 0 0 1 0 23 137899 0 0 0 0 0 0 0 0 0 0 1 24 137983 0 0 0 0 0 0 0 0 0 0 0 25 137996 1 0 0 0 0 0 0 0 0 0 0 26 137913 0 1 0 0 0 0 0 0 0 0 0 27 137841 0 0 1 0 0 0 0 0 0 0 0 28 137656 0 0 0 1 0 0 0 0 0 0 0 29 137423 0 0 0 0 1 0 0 0 0 0 0 30 137245 0 0 0 0 0 1 0 0 0 0 0 31 137014 0 0 0 0 0 0 1 0 0 0 0 32 136747 0 0 0 0 0 0 0 1 0 0 0 33 136313 0 0 0 0 0 0 0 0 1 0 0 34 135804 0 0 0 0 0 0 0 0 0 1 0 35 135002 0 0 0 0 0 0 0 0 0 0 1 36 134383 0 0 0 0 0 0 0 0 0 0 0 37 133563 1 0 0 0 0 0 0 0 0 0 0 38 132837 0 1 0 0 0 0 0 0 0 0 0 39 132041 0 0 1 0 0 0 0 0 0 0 0 40 131381 0 0 0 1 0 0 0 0 0 0 0 41 130995 0 0 0 0 1 0 0 0 0 0 0 42 130493 0 0 0 0 0 1 0 0 0 0 0 43 130193 0 0 0 0 0 0 1 0 0 0 0 44 129962 0 0 0 0 0 0 0 1 0 0 0 45 129726 0 0 0 0 0 0 0 0 1 0 0 46 129505 0 0 0 0 0 0 0 0 0 1 0 47 129450 0 0 0 0 0 0 0 0 0 0 1 48 129320 0 0 0 0 0 0 0 0 0 0 0 49 129281 1 0 0 0 0 0 0 0 0 0 0 50 129246 0 1 0 0 0 0 0 0 0 0 0 51 129438 0 0 1 0 0 0 0 0 0 0 0 52 129715 0 0 0 1 0 0 0 0 0 0 0 53 130173 0 0 0 0 1 0 0 0 0 0 0 54 129981 0 0 0 0 0 1 0 0 0 0 0 55 129932 0 0 0 0 0 0 1 0 0 0 0 56 129873 0 0 0 0 0 0 0 1 0 0 0 57 129844 0 0 0 0 0 0 0 0 1 0 0 58 130015 0 0 0 0 0 0 0 0 0 1 0 59 130108 0 0 0 0 0 0 0 0 0 0 1 60 130260 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 133767.4 838.2 750.4 716.2 654.8 653.0 M6 M7 M8 M9 M10 M11 508.0 422.6 343.0 248.2 153.0 66.6 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5325 -3928 1464 2978 4216 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 133767.4 1668.1 80.189 <2e-16 *** M1 838.2 2359.1 0.355 0.724 M2 750.4 2359.1 0.318 0.752 M3 716.2 2359.1 0.304 0.763 M4 654.8 2359.1 0.278 0.783 M5 653.0 2359.1 0.277 0.783 M6 508.0 2359.1 0.215 0.830 M7 422.6 2359.1 0.179 0.859 M8 343.0 2359.1 0.145 0.885 M9 248.2 2359.1 0.105 0.917 M10 153.0 2359.1 0.065 0.949 M11 66.6 2359.1 0.028 0.978 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3730 on 48 degrees of freedom Multiple R-squared: 0.00661, Adjusted R-squared: -0.221 F-statistic: 0.02904 on 11 and 48 DF, p-value: 1 > 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,] 3.858056e-02 7.716112e-02 9.614194e-01 [2,] 1.523533e-02 3.047067e-02 9.847647e-01 [3,] 6.675659e-03 1.335132e-02 9.933243e-01 [4,] 3.038588e-03 6.077176e-03 9.969614e-01 [5,] 1.273947e-03 2.547893e-03 9.987261e-01 [6,] 5.061011e-04 1.012202e-03 9.994939e-01 [7,] 2.039236e-04 4.078472e-04 9.997961e-01 [8,] 9.140291e-05 1.828058e-04 9.999086e-01 [9,] 4.364024e-05 8.728047e-05 9.999564e-01 [10,] 2.243465e-05 4.486930e-05 9.999776e-01 [11,] 2.339231e-05 4.678462e-05 9.999766e-01 [12,] 2.171821e-05 4.343642e-05 9.999783e-01 [13,] 1.940759e-05 3.881517e-05 9.999806e-01 [14,] 1.759251e-05 3.518502e-05 9.999824e-01 [15,] 1.614943e-05 3.229887e-05 9.999839e-01 [16,] 1.889290e-05 3.778579e-05 9.999811e-01 [17,] 2.943953e-05 5.887907e-05 9.999706e-01 [18,] 7.000699e-05 1.400140e-04 9.999300e-01 [19,] 2.944087e-04 5.888174e-04 9.997056e-01 [20,] 2.285550e-03 4.571100e-03 9.977145e-01 [21,] 2.700965e-02 5.401929e-02 9.729904e-01 [22,] 2.452454e-01 4.904909e-01 7.547546e-01 [23,] 7.027853e-01 5.944295e-01 2.972147e-01 [24,] 9.719215e-01 5.615693e-02 2.807846e-02 [25,] 9.989885e-01 2.022902e-03 1.011451e-03 [26,] 9.999255e-01 1.490438e-04 7.452192e-05 [27,] 9.999449e-01 1.102494e-04 5.512472e-05 [28,] 9.998947e-01 2.105066e-04 1.052533e-04 [29,] 9.996318e-01 7.363896e-04 3.681948e-04 [30,] 9.983240e-01 3.352018e-03 1.676009e-03 [31,] 9.916527e-01 1.669463e-02 8.347317e-03 > postscript(file="/var/wessaorg/rcomp/tmp/1x3b61322147177.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/wessaorg/rcomp/tmp/2dcpz1322147177.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/wessaorg/rcomp/tmp/3a06c1322147177.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/wessaorg/rcomp/tmp/4bn1b1322147177.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/wessaorg/rcomp/tmp/50vkn1322147177.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 = 60 Frequency = 1 1 2 3 4 5 6 7 8 9 10 488.4 893.2 1214.4 1457.8 1470.6 1695.6 1983.0 2247.6 2498.4 2585.6 11 12 13 14 15 16 17 18 19 20 2877.0 3123.6 2488.4 2664.2 2916.4 3056.8 3199.6 3411.6 3448.0 3501.6 21 22 23 24 25 26 27 28 29 30 3665.4 3851.6 4065.0 4215.6 3390.4 3395.2 3357.4 3233.8 3002.6 2969.6 31 32 33 34 35 36 37 38 39 40 2824.0 2636.6 2297.4 1883.6 1168.0 615.6 -1042.6 -1680.8 -2442.6 -3041.2 41 42 43 44 45 46 47 48 49 50 -3425.4 -3782.4 -3997.0 -4148.4 -4289.6 -4415.4 -4384.0 -4447.4 -5324.6 -5271.8 51 52 53 54 55 56 57 58 59 60 -5045.6 -4707.2 -4247.4 -4294.4 -4258.0 -4237.4 -4171.6 -3905.4 -3726.0 -3507.4 > postscript(file="/var/wessaorg/rcomp/tmp/619t01322147177.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 488.4 NA 1 893.2 488.4 2 1214.4 893.2 3 1457.8 1214.4 4 1470.6 1457.8 5 1695.6 1470.6 6 1983.0 1695.6 7 2247.6 1983.0 8 2498.4 2247.6 9 2585.6 2498.4 10 2877.0 2585.6 11 3123.6 2877.0 12 2488.4 3123.6 13 2664.2 2488.4 14 2916.4 2664.2 15 3056.8 2916.4 16 3199.6 3056.8 17 3411.6 3199.6 18 3448.0 3411.6 19 3501.6 3448.0 20 3665.4 3501.6 21 3851.6 3665.4 22 4065.0 3851.6 23 4215.6 4065.0 24 3390.4 4215.6 25 3395.2 3390.4 26 3357.4 3395.2 27 3233.8 3357.4 28 3002.6 3233.8 29 2969.6 3002.6 30 2824.0 2969.6 31 2636.6 2824.0 32 2297.4 2636.6 33 1883.6 2297.4 34 1168.0 1883.6 35 615.6 1168.0 36 -1042.6 615.6 37 -1680.8 -1042.6 38 -2442.6 -1680.8 39 -3041.2 -2442.6 40 -3425.4 -3041.2 41 -3782.4 -3425.4 42 -3997.0 -3782.4 43 -4148.4 -3997.0 44 -4289.6 -4148.4 45 -4415.4 -4289.6 46 -4384.0 -4415.4 47 -4447.4 -4384.0 48 -5324.6 -4447.4 49 -5271.8 -5324.6 50 -5045.6 -5271.8 51 -4707.2 -5045.6 52 -4247.4 -4707.2 53 -4294.4 -4247.4 54 -4258.0 -4294.4 55 -4237.4 -4258.0 56 -4171.6 -4237.4 57 -3905.4 -4171.6 58 -3726.0 -3905.4 59 -3507.4 -3726.0 60 NA -3507.4 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 893.2 488.4 [2,] 1214.4 893.2 [3,] 1457.8 1214.4 [4,] 1470.6 1457.8 [5,] 1695.6 1470.6 [6,] 1983.0 1695.6 [7,] 2247.6 1983.0 [8,] 2498.4 2247.6 [9,] 2585.6 2498.4 [10,] 2877.0 2585.6 [11,] 3123.6 2877.0 [12,] 2488.4 3123.6 [13,] 2664.2 2488.4 [14,] 2916.4 2664.2 [15,] 3056.8 2916.4 [16,] 3199.6 3056.8 [17,] 3411.6 3199.6 [18,] 3448.0 3411.6 [19,] 3501.6 3448.0 [20,] 3665.4 3501.6 [21,] 3851.6 3665.4 [22,] 4065.0 3851.6 [23,] 4215.6 4065.0 [24,] 3390.4 4215.6 [25,] 3395.2 3390.4 [26,] 3357.4 3395.2 [27,] 3233.8 3357.4 [28,] 3002.6 3233.8 [29,] 2969.6 3002.6 [30,] 2824.0 2969.6 [31,] 2636.6 2824.0 [32,] 2297.4 2636.6 [33,] 1883.6 2297.4 [34,] 1168.0 1883.6 [35,] 615.6 1168.0 [36,] -1042.6 615.6 [37,] -1680.8 -1042.6 [38,] -2442.6 -1680.8 [39,] -3041.2 -2442.6 [40,] -3425.4 -3041.2 [41,] -3782.4 -3425.4 [42,] -3997.0 -3782.4 [43,] -4148.4 -3997.0 [44,] -4289.6 -4148.4 [45,] -4415.4 -4289.6 [46,] -4384.0 -4415.4 [47,] -4447.4 -4384.0 [48,] -5324.6 -4447.4 [49,] -5271.8 -5324.6 [50,] -5045.6 -5271.8 [51,] -4707.2 -5045.6 [52,] -4247.4 -4707.2 [53,] -4294.4 -4247.4 [54,] -4258.0 -4294.4 [55,] -4237.4 -4258.0 [56,] -4171.6 -4237.4 [57,] -3905.4 -4171.6 [58,] -3726.0 -3905.4 [59,] -3507.4 -3726.0 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 893.2 488.4 2 1214.4 893.2 3 1457.8 1214.4 4 1470.6 1457.8 5 1695.6 1470.6 6 1983.0 1695.6 7 2247.6 1983.0 8 2498.4 2247.6 9 2585.6 2498.4 10 2877.0 2585.6 11 3123.6 2877.0 12 2488.4 3123.6 13 2664.2 2488.4 14 2916.4 2664.2 15 3056.8 2916.4 16 3199.6 3056.8 17 3411.6 3199.6 18 3448.0 3411.6 19 3501.6 3448.0 20 3665.4 3501.6 21 3851.6 3665.4 22 4065.0 3851.6 23 4215.6 4065.0 24 3390.4 4215.6 25 3395.2 3390.4 26 3357.4 3395.2 27 3233.8 3357.4 28 3002.6 3233.8 29 2969.6 3002.6 30 2824.0 2969.6 31 2636.6 2824.0 32 2297.4 2636.6 33 1883.6 2297.4 34 1168.0 1883.6 35 615.6 1168.0 36 -1042.6 615.6 37 -1680.8 -1042.6 38 -2442.6 -1680.8 39 -3041.2 -2442.6 40 -3425.4 -3041.2 41 -3782.4 -3425.4 42 -3997.0 -3782.4 43 -4148.4 -3997.0 44 -4289.6 -4148.4 45 -4415.4 -4289.6 46 -4384.0 -4415.4 47 -4447.4 -4384.0 48 -5324.6 -4447.4 49 -5271.8 -5324.6 50 -5045.6 -5271.8 51 -4707.2 -5045.6 52 -4247.4 -4707.2 53 -4294.4 -4247.4 54 -4258.0 -4294.4 55 -4237.4 -4258.0 56 -4171.6 -4237.4 57 -3905.4 -4171.6 58 -3726.0 -3905.4 59 -3507.4 -3726.0 > 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/wessaorg/rcomp/tmp/7umyc1322147177.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/wessaorg/rcomp/tmp/8w0xu1322147177.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/wessaorg/rcomp/tmp/9391h1322147177.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') hat values (leverages) are all = 0.2 and there are no factor predictors; no plot no. 5 > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/10lqgv1322147177.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11qn821322147177.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/wessaorg/rcomp/tmp/12baeb1322147177.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/wessaorg/rcomp/tmp/136yy71322147177.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/wessaorg/rcomp/tmp/147s721322147177.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/wessaorg/rcomp/tmp/15f6fb1322147177.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/wessaorg/rcomp/tmp/166c6a1322147177.tab") + } > > try(system("convert tmp/1x3b61322147177.ps tmp/1x3b61322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/2dcpz1322147177.ps tmp/2dcpz1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/3a06c1322147177.ps tmp/3a06c1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/4bn1b1322147177.ps tmp/4bn1b1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/50vkn1322147177.ps tmp/50vkn1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/619t01322147177.ps tmp/619t01322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/7umyc1322147177.ps tmp/7umyc1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/8w0xu1322147177.ps tmp/8w0xu1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/9391h1322147177.ps tmp/9391h1322147177.png",intern=TRUE)) character(0) > try(system("convert tmp/10lqgv1322147177.ps tmp/10lqgv1322147177.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.219 0.489 3.726