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(6539,2605,6699,2682,6962,2755,6981,2760,7024,2735,6940,2659,6774,2654,6671,2670,6965,2785,6969,2845,6822,2723,6878,2746,6691,2767,6837,2940,7018,2977,7167,2993,7076,2892,7171,2824,7093,2771,6971,2686,7142,2738,7047,2723,6999,2731,6650,2632,6475,2606,6437,2605,6639,2646,6422,2627,6272,2535,6232,2456,6003,2404,5673,2319,6050,2519,5977,2504,5796,2382,5752,2394,5609,2381,5839,2501,6069,2532,6006,2515,5809,2429,5797,2389,5502,2261,5568,2272,5864,2439,5764,2373,5615,2327,5615,2364,5681,2388,5915,2553,6334,2663,6494,2694,6620,2679,6578,2611,6495,2580,6538,2627,6737,2732,6651,2707,6530,2633,6563,2683),dim=c(2,60),dimnames=list(c('Voeding-Mannen','Landbouw-Mannen'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Voeding-Mannen','Landbouw-Mannen'),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 = '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 Voeding-Mannen Landbouw-Mannen 1 6539 2605 2 6699 2682 3 6962 2755 4 6981 2760 5 7024 2735 6 6940 2659 7 6774 2654 8 6671 2670 9 6965 2785 10 6969 2845 11 6822 2723 12 6878 2746 13 6691 2767 14 6837 2940 15 7018 2977 16 7167 2993 17 7076 2892 18 7171 2824 19 7093 2771 20 6971 2686 21 7142 2738 22 7047 2723 23 6999 2731 24 6650 2632 25 6475 2606 26 6437 2605 27 6639 2646 28 6422 2627 29 6272 2535 30 6232 2456 31 6003 2404 32 5673 2319 33 6050 2519 34 5977 2504 35 5796 2382 36 5752 2394 37 5609 2381 38 5839 2501 39 6069 2532 40 6006 2515 41 5809 2429 42 5797 2389 43 5502 2261 44 5568 2272 45 5864 2439 46 5764 2373 47 5615 2327 48 5615 2364 49 5681 2388 50 5915 2553 51 6334 2663 52 6494 2694 53 6620 2679 54 6578 2611 55 6495 2580 56 6538 2627 57 6737 2732 58 6651 2707 59 6530 2633 60 6563 2683 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Landbouw-Mannen` -680.486 2.725 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -494.74 -131.20 19.46 132.60 374.06 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -680.4859 366.6620 -1.856 0.0686 . `Landbouw-Mannen` 2.7252 0.1402 19.445 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 188.2 on 58 degrees of freedom Multiple R-squared: 0.867, Adjusted R-squared: 0.8647 F-statistic: 378.1 on 1 and 58 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,] 0.06289996 0.1257999181 0.9371000410 [2,] 0.23030511 0.4606102173 0.7696948914 [3,] 0.13550614 0.2710122864 0.8644938568 [4,] 0.10230612 0.2046122347 0.8976938826 [5,] 0.06832937 0.1366587387 0.9316706306 [6,] 0.07051519 0.1410303870 0.9294848065 [7,] 0.04072510 0.0814502053 0.9592748974 [8,] 0.02182953 0.0436590685 0.9781704657 [9,] 0.05150842 0.1030168492 0.9484915754 [10,] 0.13534491 0.2706898234 0.8646550883 [11,] 0.14455103 0.2891020661 0.8554489670 [12,] 0.18518237 0.3703647315 0.8148176343 [13,] 0.17583918 0.3516783556 0.8241608222 [14,] 0.24460703 0.4892140688 0.7553929656 [15,] 0.28212448 0.5642489544 0.7178755228 [16,] 0.33882281 0.6776456151 0.6611771924 [17,] 0.54647625 0.9070474967 0.4535237483 [18,] 0.65230853 0.6953829334 0.3476914667 [19,] 0.69661342 0.6067731551 0.3033865776 [20,] 0.73419805 0.5316038969 0.2658019485 [21,] 0.80800477 0.3839904671 0.1919952335 [22,] 0.85286203 0.2942759387 0.1471379694 [23,] 0.85229408 0.2954118499 0.1477059249 [24,] 0.87874416 0.2425116806 0.1212558403 [25,] 0.90116099 0.1976780164 0.0988390082 [26,] 0.94454440 0.1109112023 0.0554556011 [27,] 0.96598279 0.0680344139 0.0340172070 [28,] 0.97804686 0.0439062856 0.0219531428 [29,] 0.98081965 0.0383607091 0.0191803545 [30,] 0.98427457 0.0314508645 0.0157254323 [31,] 0.98050559 0.0389888139 0.0194944069 [32,] 0.97612286 0.0477542747 0.0238771373 [33,] 0.97990477 0.0401904587 0.0200952293 [34,] 0.99159591 0.0168081823 0.0084040912 [35,] 0.98895707 0.0220858612 0.0110429306 [36,] 0.98671994 0.0265601250 0.0132800625 [37,] 0.98130162 0.0373967688 0.0186983844 [38,] 0.96873777 0.0625244650 0.0312622325 [39,] 0.95243283 0.0951343477 0.0475671739 [40,] 0.94160764 0.1167847199 0.0583923599 [41,] 0.91176955 0.1764609015 0.0882304507 [42,] 0.87350671 0.2529865816 0.1264932908 [43,] 0.82672376 0.3465524891 0.1732762446 [44,] 0.76140810 0.4771837916 0.2385918958 [45,] 0.68612922 0.6277415630 0.3138707815 [46,] 0.97665840 0.0466831933 0.0233415967 [47,] 0.99835821 0.0032835704 0.0016417852 [48,] 0.99971937 0.0005612589 0.0002806294 [49,] 0.99851303 0.0029739388 0.0014869694 [50,] 0.99682831 0.0063433889 0.0031716944 [51,] 0.98967111 0.0206577793 0.0103288896 > postscript(file="/var/www/html/rcomp/tmp/1gb101258724818.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/2kb5n1258724818.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/3m6q91258724818.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/4dk7k1258724818.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/5bvw41258724818.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 120.2209060 70.3769875 134.4340518 139.8078233 250.9389657 374.0576385 7 8 9 10 11 12 221.6838669 75.0799358 55.6766809 -103.8380608 81.6419140 74.9612630 13 14 15 16 17 18 -169.2688966 -494.7364018 -414.5704925 -309.1744236 -124.9246084 155.3920988 19 20 21 22 23 24 221.8301206 331.4760047 360.7632286 306.6419140 236.8399484 157.6392722 25 26 27 28 29 30 53.4956603 18.2209060 108.4858325 -56.7344993 43.9881046 219.2825145 31 32 33 34 35 36 131.9952907 33.6411747 -134.4079643 -166.5292788 -15.0493041 -91.7522524 37 38 39 40 41 42 -199.3240584 -296.3535417 -150.8361583 -167.5069815 -130.1358517 -33.1260239 43 44 45 46 47 48 20.7054250 56.7277224 -102.3883087 -22.5220928 -46.1607908 -146.9948815 49 50 51 52 53 54 -146.4007782 -362.0663179 -242.8433443 -167.3259609 -0.4472754 142.8694318 55 56 57 58 59 60 144.3520484 59.2655007 -27.8852973 -45.7541549 34.9140265 -68.3482582 > postscript(file="/var/www/html/rcomp/tmp/6igtm1258724818.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 120.2209060 NA 1 70.3769875 120.2209060 2 134.4340518 70.3769875 3 139.8078233 134.4340518 4 250.9389657 139.8078233 5 374.0576385 250.9389657 6 221.6838669 374.0576385 7 75.0799358 221.6838669 8 55.6766809 75.0799358 9 -103.8380608 55.6766809 10 81.6419140 -103.8380608 11 74.9612630 81.6419140 12 -169.2688966 74.9612630 13 -494.7364018 -169.2688966 14 -414.5704925 -494.7364018 15 -309.1744236 -414.5704925 16 -124.9246084 -309.1744236 17 155.3920988 -124.9246084 18 221.8301206 155.3920988 19 331.4760047 221.8301206 20 360.7632286 331.4760047 21 306.6419140 360.7632286 22 236.8399484 306.6419140 23 157.6392722 236.8399484 24 53.4956603 157.6392722 25 18.2209060 53.4956603 26 108.4858325 18.2209060 27 -56.7344993 108.4858325 28 43.9881046 -56.7344993 29 219.2825145 43.9881046 30 131.9952907 219.2825145 31 33.6411747 131.9952907 32 -134.4079643 33.6411747 33 -166.5292788 -134.4079643 34 -15.0493041 -166.5292788 35 -91.7522524 -15.0493041 36 -199.3240584 -91.7522524 37 -296.3535417 -199.3240584 38 -150.8361583 -296.3535417 39 -167.5069815 -150.8361583 40 -130.1358517 -167.5069815 41 -33.1260239 -130.1358517 42 20.7054250 -33.1260239 43 56.7277224 20.7054250 44 -102.3883087 56.7277224 45 -22.5220928 -102.3883087 46 -46.1607908 -22.5220928 47 -146.9948815 -46.1607908 48 -146.4007782 -146.9948815 49 -362.0663179 -146.4007782 50 -242.8433443 -362.0663179 51 -167.3259609 -242.8433443 52 -0.4472754 -167.3259609 53 142.8694318 -0.4472754 54 144.3520484 142.8694318 55 59.2655007 144.3520484 56 -27.8852973 59.2655007 57 -45.7541549 -27.8852973 58 34.9140265 -45.7541549 59 -68.3482582 34.9140265 60 NA -68.3482582 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 70.3769875 120.2209060 [2,] 134.4340518 70.3769875 [3,] 139.8078233 134.4340518 [4,] 250.9389657 139.8078233 [5,] 374.0576385 250.9389657 [6,] 221.6838669 374.0576385 [7,] 75.0799358 221.6838669 [8,] 55.6766809 75.0799358 [9,] -103.8380608 55.6766809 [10,] 81.6419140 -103.8380608 [11,] 74.9612630 81.6419140 [12,] -169.2688966 74.9612630 [13,] -494.7364018 -169.2688966 [14,] -414.5704925 -494.7364018 [15,] -309.1744236 -414.5704925 [16,] -124.9246084 -309.1744236 [17,] 155.3920988 -124.9246084 [18,] 221.8301206 155.3920988 [19,] 331.4760047 221.8301206 [20,] 360.7632286 331.4760047 [21,] 306.6419140 360.7632286 [22,] 236.8399484 306.6419140 [23,] 157.6392722 236.8399484 [24,] 53.4956603 157.6392722 [25,] 18.2209060 53.4956603 [26,] 108.4858325 18.2209060 [27,] -56.7344993 108.4858325 [28,] 43.9881046 -56.7344993 [29,] 219.2825145 43.9881046 [30,] 131.9952907 219.2825145 [31,] 33.6411747 131.9952907 [32,] -134.4079643 33.6411747 [33,] -166.5292788 -134.4079643 [34,] -15.0493041 -166.5292788 [35,] -91.7522524 -15.0493041 [36,] -199.3240584 -91.7522524 [37,] -296.3535417 -199.3240584 [38,] -150.8361583 -296.3535417 [39,] -167.5069815 -150.8361583 [40,] -130.1358517 -167.5069815 [41,] -33.1260239 -130.1358517 [42,] 20.7054250 -33.1260239 [43,] 56.7277224 20.7054250 [44,] -102.3883087 56.7277224 [45,] -22.5220928 -102.3883087 [46,] -46.1607908 -22.5220928 [47,] -146.9948815 -46.1607908 [48,] -146.4007782 -146.9948815 [49,] -362.0663179 -146.4007782 [50,] -242.8433443 -362.0663179 [51,] -167.3259609 -242.8433443 [52,] -0.4472754 -167.3259609 [53,] 142.8694318 -0.4472754 [54,] 144.3520484 142.8694318 [55,] 59.2655007 144.3520484 [56,] -27.8852973 59.2655007 [57,] -45.7541549 -27.8852973 [58,] 34.9140265 -45.7541549 [59,] -68.3482582 34.9140265 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 70.3769875 120.2209060 2 134.4340518 70.3769875 3 139.8078233 134.4340518 4 250.9389657 139.8078233 5 374.0576385 250.9389657 6 221.6838669 374.0576385 7 75.0799358 221.6838669 8 55.6766809 75.0799358 9 -103.8380608 55.6766809 10 81.6419140 -103.8380608 11 74.9612630 81.6419140 12 -169.2688966 74.9612630 13 -494.7364018 -169.2688966 14 -414.5704925 -494.7364018 15 -309.1744236 -414.5704925 16 -124.9246084 -309.1744236 17 155.3920988 -124.9246084 18 221.8301206 155.3920988 19 331.4760047 221.8301206 20 360.7632286 331.4760047 21 306.6419140 360.7632286 22 236.8399484 306.6419140 23 157.6392722 236.8399484 24 53.4956603 157.6392722 25 18.2209060 53.4956603 26 108.4858325 18.2209060 27 -56.7344993 108.4858325 28 43.9881046 -56.7344993 29 219.2825145 43.9881046 30 131.9952907 219.2825145 31 33.6411747 131.9952907 32 -134.4079643 33.6411747 33 -166.5292788 -134.4079643 34 -15.0493041 -166.5292788 35 -91.7522524 -15.0493041 36 -199.3240584 -91.7522524 37 -296.3535417 -199.3240584 38 -150.8361583 -296.3535417 39 -167.5069815 -150.8361583 40 -130.1358517 -167.5069815 41 -33.1260239 -130.1358517 42 20.7054250 -33.1260239 43 56.7277224 20.7054250 44 -102.3883087 56.7277224 45 -22.5220928 -102.3883087 46 -46.1607908 -22.5220928 47 -146.9948815 -46.1607908 48 -146.4007782 -146.9948815 49 -362.0663179 -146.4007782 50 -242.8433443 -362.0663179 51 -167.3259609 -242.8433443 52 -0.4472754 -167.3259609 53 142.8694318 -0.4472754 54 144.3520484 142.8694318 55 59.2655007 144.3520484 56 -27.8852973 59.2655007 57 -45.7541549 -27.8852973 58 34.9140265 -45.7541549 59 -68.3482582 34.9140265 > 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/7z1no1258724818.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/8je9a1258724818.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/9m4jf1258724818.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/10tbfz1258724818.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/11d7so1258724818.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/129w2i1258724818.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/1378sv1258724819.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/14d1cn1258724819.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/15e2e01258724819.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/16fsfx1258724819.tab") + } > > system("convert tmp/1gb101258724818.ps tmp/1gb101258724818.png") > system("convert tmp/2kb5n1258724818.ps tmp/2kb5n1258724818.png") > system("convert tmp/3m6q91258724818.ps tmp/3m6q91258724818.png") > system("convert tmp/4dk7k1258724818.ps tmp/4dk7k1258724818.png") > system("convert tmp/5bvw41258724818.ps tmp/5bvw41258724818.png") > system("convert tmp/6igtm1258724818.ps tmp/6igtm1258724818.png") > system("convert tmp/7z1no1258724818.ps tmp/7z1no1258724818.png") > system("convert tmp/8je9a1258724818.ps tmp/8je9a1258724818.png") > system("convert tmp/9m4jf1258724818.ps tmp/9m4jf1258724818.png") > system("convert tmp/10tbfz1258724818.ps tmp/10tbfz1258724818.png") > > > proc.time() user system elapsed 2.482 1.568 2.898