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 = '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 t 1 6539 2605 1 2 6699 2682 2 3 6962 2755 3 4 6981 2760 4 5 7024 2735 5 6 6940 2659 6 7 6774 2654 7 8 6671 2670 8 9 6965 2785 9 10 6969 2845 10 11 6822 2723 11 12 6878 2746 12 13 6691 2767 13 14 6837 2940 14 15 7018 2977 15 16 7167 2993 16 17 7076 2892 17 18 7171 2824 18 19 7093 2771 19 20 6971 2686 20 21 7142 2738 21 22 7047 2723 22 23 6999 2731 23 24 6650 2632 24 25 6475 2606 25 26 6437 2605 26 27 6639 2646 27 28 6422 2627 28 29 6272 2535 29 30 6232 2456 30 31 6003 2404 31 32 5673 2319 32 33 6050 2519 33 34 5977 2504 34 35 5796 2382 35 36 5752 2394 36 37 5609 2381 37 38 5839 2501 38 39 6069 2532 39 40 6006 2515 40 41 5809 2429 41 42 5797 2389 42 43 5502 2261 43 44 5568 2272 44 45 5864 2439 45 46 5764 2373 46 47 5615 2327 47 48 5615 2364 48 49 5681 2388 49 50 5915 2553 50 51 6334 2663 51 52 6494 2694 52 53 6620 2679 53 54 6578 2611 54 55 6495 2580 55 56 6538 2627 56 57 6737 2732 57 58 6651 2707 58 59 6530 2633 59 60 6563 2683 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Landbouw-Mannen` t 6.545 2.512 -4.284 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -495.168 -123.005 -1.208 116.247 347.266 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.5453 424.8576 0.015 0.98776 `Landbouw-Mannen` 2.5121 0.1529 16.433 < 2e-16 *** t -4.2840 1.5304 -2.799 0.00698 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 178 on 57 degrees of freedom Multiple R-squared: 0.8831, Adjusted R-squared: 0.879 F-statistic: 215.2 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,] 0.006333351 0.0126667026 0.9936666487 [2,] 0.049844599 0.0996891988 0.9501554006 [3,] 0.144077606 0.2881552115 0.8559223942 [4,] 0.118576213 0.2371524258 0.8814237871 [5,] 0.122826847 0.2456536941 0.8771731530 [6,] 0.071571717 0.1431434345 0.9284282828 [7,] 0.038634327 0.0772686548 0.9613656726 [8,] 0.059640567 0.1192811334 0.9403594333 [9,] 0.163637570 0.3272751394 0.8363624303 [10,] 0.194943321 0.3898866427 0.8050566787 [11,] 0.298981658 0.5979633156 0.7010183422 [12,] 0.380338519 0.7606770376 0.6196614812 [13,] 0.512033153 0.9759336937 0.4879668468 [14,] 0.490665409 0.9813308172 0.5093345914 [15,] 0.448617288 0.8972345764 0.5513827118 [16,] 0.486497006 0.9729940112 0.5135029944 [17,] 0.473630910 0.9472618205 0.5263690898 [18,] 0.454996873 0.9099937453 0.5450031274 [19,] 0.641132569 0.7177348627 0.3588674314 [20,] 0.802695329 0.3946093429 0.1973046714 [21,] 0.857735946 0.2845281073 0.1422640537 [22,] 0.852793104 0.2944137919 0.1472068960 [23,] 0.869095579 0.2618088429 0.1309044214 [24,] 0.884767303 0.2304653932 0.1152326966 [25,] 0.951079869 0.0978402622 0.0489201311 [26,] 0.982359722 0.0352805566 0.0176402783 [27,] 0.991966498 0.0160670042 0.0080335021 [28,] 0.992098144 0.0158037126 0.0079018563 [29,] 0.991302891 0.0173942188 0.0086971094 [30,] 0.992893203 0.0142135940 0.0071067970 [31,] 0.992059397 0.0158812051 0.0079406025 [32,] 0.990347551 0.0193048971 0.0096524486 [33,] 0.989030940 0.0219381198 0.0109690599 [34,] 0.982449737 0.0351005251 0.0175502626 [35,] 0.971722218 0.0565555635 0.0282777817 [36,] 0.955283401 0.0894331972 0.0447165986 [37,] 0.943523610 0.1129527791 0.0564763895 [38,] 0.922786179 0.1544276425 0.0772138213 [39,] 0.916289248 0.1674215037 0.0837107519 [40,] 0.884377635 0.2312447309 0.1156223655 [41,] 0.866735932 0.2665281360 0.1332640680 [42,] 0.823170543 0.3536589143 0.1768294572 [43,] 0.744302197 0.5113956051 0.2556978026 [44,] 0.654998739 0.6900025217 0.3450012609 [45,] 0.943203039 0.1135939216 0.0567969608 [46,] 0.985445490 0.0291090205 0.0145545102 [47,] 0.999153230 0.0016935391 0.0008467696 [48,] 0.999701703 0.0005965945 0.0002982972 [49,] 0.997713345 0.0045733095 0.0022866548 > postscript(file="/var/www/html/rcomp/tmp/1ur4m1258726430.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/2a2zn1258726430.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/3tmc11258726430.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/478zf1258726430.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/5en9v1258726430.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 -7.3032436 -36.4516174 47.4484417 58.1718587 168.2585217 279.4627031 7 8 9 10 11 12 130.3072021 -8.6025712 0.7889433 -141.6535910 22.1075678 24.6130371 13 14 15 16 17 18 -210.8572772 -495.1680385 -402.8320841 -289.7418574 -122.7349709 147.3723449 19 20 21 22 23 24 206.7980376 302.6111929 347.2655242 294.2311052 230.4181976 134.4008677 25 26 27 28 29 30 28.9996389 -2.2042949 101.0832267 -63.9027595 21.4951532 184.2356592 31 32 33 34 35 36 90.1492437 -22.0376010 -143.1752838 -174.2097028 -44.4485440 -114.3098845 37 38 39 40 41 42 -220.3685199 -287.5375464 -131.1289428 -147.1391453 -123.8138819 -31.0455958 43 44 45 46 47 48 -0.2117878 42.4389799 -76.7991321 -6.7160327 -35.8750974 -124.5391430 49 50 51 52 53 54 -114.5457820 -290.7596776 -143.8076221 -57.3990184 110.5665626 243.6738784 55 56 57 58 59 60 242.8331906 172.0480630 111.5606596 92.6473226 161.8272876 73.5058354 > postscript(file="/var/www/html/rcomp/tmp/6ov6w1258726430.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 -7.3032436 NA 1 -36.4516174 -7.3032436 2 47.4484417 -36.4516174 3 58.1718587 47.4484417 4 168.2585217 58.1718587 5 279.4627031 168.2585217 6 130.3072021 279.4627031 7 -8.6025712 130.3072021 8 0.7889433 -8.6025712 9 -141.6535910 0.7889433 10 22.1075678 -141.6535910 11 24.6130371 22.1075678 12 -210.8572772 24.6130371 13 -495.1680385 -210.8572772 14 -402.8320841 -495.1680385 15 -289.7418574 -402.8320841 16 -122.7349709 -289.7418574 17 147.3723449 -122.7349709 18 206.7980376 147.3723449 19 302.6111929 206.7980376 20 347.2655242 302.6111929 21 294.2311052 347.2655242 22 230.4181976 294.2311052 23 134.4008677 230.4181976 24 28.9996389 134.4008677 25 -2.2042949 28.9996389 26 101.0832267 -2.2042949 27 -63.9027595 101.0832267 28 21.4951532 -63.9027595 29 184.2356592 21.4951532 30 90.1492437 184.2356592 31 -22.0376010 90.1492437 32 -143.1752838 -22.0376010 33 -174.2097028 -143.1752838 34 -44.4485440 -174.2097028 35 -114.3098845 -44.4485440 36 -220.3685199 -114.3098845 37 -287.5375464 -220.3685199 38 -131.1289428 -287.5375464 39 -147.1391453 -131.1289428 40 -123.8138819 -147.1391453 41 -31.0455958 -123.8138819 42 -0.2117878 -31.0455958 43 42.4389799 -0.2117878 44 -76.7991321 42.4389799 45 -6.7160327 -76.7991321 46 -35.8750974 -6.7160327 47 -124.5391430 -35.8750974 48 -114.5457820 -124.5391430 49 -290.7596776 -114.5457820 50 -143.8076221 -290.7596776 51 -57.3990184 -143.8076221 52 110.5665626 -57.3990184 53 243.6738784 110.5665626 54 242.8331906 243.6738784 55 172.0480630 242.8331906 56 111.5606596 172.0480630 57 92.6473226 111.5606596 58 161.8272876 92.6473226 59 73.5058354 161.8272876 60 NA 73.5058354 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -36.4516174 -7.3032436 [2,] 47.4484417 -36.4516174 [3,] 58.1718587 47.4484417 [4,] 168.2585217 58.1718587 [5,] 279.4627031 168.2585217 [6,] 130.3072021 279.4627031 [7,] -8.6025712 130.3072021 [8,] 0.7889433 -8.6025712 [9,] -141.6535910 0.7889433 [10,] 22.1075678 -141.6535910 [11,] 24.6130371 22.1075678 [12,] -210.8572772 24.6130371 [13,] -495.1680385 -210.8572772 [14,] -402.8320841 -495.1680385 [15,] -289.7418574 -402.8320841 [16,] -122.7349709 -289.7418574 [17,] 147.3723449 -122.7349709 [18,] 206.7980376 147.3723449 [19,] 302.6111929 206.7980376 [20,] 347.2655242 302.6111929 [21,] 294.2311052 347.2655242 [22,] 230.4181976 294.2311052 [23,] 134.4008677 230.4181976 [24,] 28.9996389 134.4008677 [25,] -2.2042949 28.9996389 [26,] 101.0832267 -2.2042949 [27,] -63.9027595 101.0832267 [28,] 21.4951532 -63.9027595 [29,] 184.2356592 21.4951532 [30,] 90.1492437 184.2356592 [31,] -22.0376010 90.1492437 [32,] -143.1752838 -22.0376010 [33,] -174.2097028 -143.1752838 [34,] -44.4485440 -174.2097028 [35,] -114.3098845 -44.4485440 [36,] -220.3685199 -114.3098845 [37,] -287.5375464 -220.3685199 [38,] -131.1289428 -287.5375464 [39,] -147.1391453 -131.1289428 [40,] -123.8138819 -147.1391453 [41,] -31.0455958 -123.8138819 [42,] -0.2117878 -31.0455958 [43,] 42.4389799 -0.2117878 [44,] -76.7991321 42.4389799 [45,] -6.7160327 -76.7991321 [46,] -35.8750974 -6.7160327 [47,] -124.5391430 -35.8750974 [48,] -114.5457820 -124.5391430 [49,] -290.7596776 -114.5457820 [50,] -143.8076221 -290.7596776 [51,] -57.3990184 -143.8076221 [52,] 110.5665626 -57.3990184 [53,] 243.6738784 110.5665626 [54,] 242.8331906 243.6738784 [55,] 172.0480630 242.8331906 [56,] 111.5606596 172.0480630 [57,] 92.6473226 111.5606596 [58,] 161.8272876 92.6473226 [59,] 73.5058354 161.8272876 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -36.4516174 -7.3032436 2 47.4484417 -36.4516174 3 58.1718587 47.4484417 4 168.2585217 58.1718587 5 279.4627031 168.2585217 6 130.3072021 279.4627031 7 -8.6025712 130.3072021 8 0.7889433 -8.6025712 9 -141.6535910 0.7889433 10 22.1075678 -141.6535910 11 24.6130371 22.1075678 12 -210.8572772 24.6130371 13 -495.1680385 -210.8572772 14 -402.8320841 -495.1680385 15 -289.7418574 -402.8320841 16 -122.7349709 -289.7418574 17 147.3723449 -122.7349709 18 206.7980376 147.3723449 19 302.6111929 206.7980376 20 347.2655242 302.6111929 21 294.2311052 347.2655242 22 230.4181976 294.2311052 23 134.4008677 230.4181976 24 28.9996389 134.4008677 25 -2.2042949 28.9996389 26 101.0832267 -2.2042949 27 -63.9027595 101.0832267 28 21.4951532 -63.9027595 29 184.2356592 21.4951532 30 90.1492437 184.2356592 31 -22.0376010 90.1492437 32 -143.1752838 -22.0376010 33 -174.2097028 -143.1752838 34 -44.4485440 -174.2097028 35 -114.3098845 -44.4485440 36 -220.3685199 -114.3098845 37 -287.5375464 -220.3685199 38 -131.1289428 -287.5375464 39 -147.1391453 -131.1289428 40 -123.8138819 -147.1391453 41 -31.0455958 -123.8138819 42 -0.2117878 -31.0455958 43 42.4389799 -0.2117878 44 -76.7991321 42.4389799 45 -6.7160327 -76.7991321 46 -35.8750974 -6.7160327 47 -124.5391430 -35.8750974 48 -114.5457820 -124.5391430 49 -290.7596776 -114.5457820 50 -143.8076221 -290.7596776 51 -57.3990184 -143.8076221 52 110.5665626 -57.3990184 53 243.6738784 110.5665626 54 242.8331906 243.6738784 55 172.0480630 242.8331906 56 111.5606596 172.0480630 57 92.6473226 111.5606596 58 161.8272876 92.6473226 59 73.5058354 161.8272876 > 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/7dg9n1258726430.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/88knc1258726430.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/9gczj1258726430.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/10dcmc1258726430.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/11cxi81258726430.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/12ajk91258726430.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/13cmle1258726430.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/148bhj1258726430.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/150l4d1258726430.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/162bot1258726430.tab") + } > > system("convert tmp/1ur4m1258726430.ps tmp/1ur4m1258726430.png") > system("convert tmp/2a2zn1258726430.ps tmp/2a2zn1258726430.png") > system("convert tmp/3tmc11258726430.ps tmp/3tmc11258726430.png") > system("convert tmp/478zf1258726430.ps tmp/478zf1258726430.png") > system("convert tmp/5en9v1258726430.ps tmp/5en9v1258726430.png") > system("convert tmp/6ov6w1258726430.ps tmp/6ov6w1258726430.png") > system("convert tmp/7dg9n1258726430.ps tmp/7dg9n1258726430.png") > system("convert tmp/88knc1258726430.ps tmp/88knc1258726430.png") > system("convert tmp/9gczj1258726430.ps tmp/9gczj1258726430.png") > system("convert tmp/10dcmc1258726430.ps tmp/10dcmc1258726430.png") > > > proc.time() user system elapsed 2.494 1.575 2.931