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(20366,0,22782,0,19169,0,13807,0,29743,0,25591,0,29096,0,26482,0,22405,0,27044,0,17970,0,18730,0,19684,0,19785,0,18479,0,10698,0,31956,0,29506,0,34506,0,27165,0,26736,0,23691,0,18157,0,17328,0,18205,0,20995,0,17382,0,9367,0,31124,0,26551,0,30651,0,25859,0,25100,0,25778,0,20418,0,18688,0,20424,0,24776,0,19814,0,12738,0,31566,0,30111,0,30019,0,31934,1,25826,1,26835,1,20205,1,17789,1,20520,1,22518,1,15572,1,11509,1,25447,1,24090,1,27786,1,26195,1,20516,1,22759,1,19028,1,16971,1,20036,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > 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 20366 0 1 2 22782 0 2 3 19169 0 3 4 13807 0 4 5 29743 0 5 6 25591 0 6 7 29096 0 7 8 26482 0 8 9 22405 0 9 10 27044 0 10 11 17970 0 11 12 18730 0 12 13 19684 0 13 14 19785 0 14 15 18479 0 15 16 10698 0 16 17 31956 0 17 18 29506 0 18 19 34506 0 19 20 27165 0 20 21 26736 0 21 22 23691 0 22 23 18157 0 23 24 17328 0 24 25 18205 0 25 26 20995 0 26 27 17382 0 27 28 9367 0 28 29 31124 0 29 30 26551 0 30 31 30651 0 31 32 25859 0 32 33 25100 0 33 34 25778 0 34 35 20418 0 35 36 18688 0 36 37 20424 0 37 38 24776 0 38 39 19814 0 39 40 12738 0 40 41 31566 0 41 42 30111 0 42 43 30019 0 43 44 31934 1 44 45 25826 1 45 46 26835 1 46 47 20205 1 47 48 17789 1 48 49 20520 1 49 50 22518 1 50 51 15572 1 51 52 11509 1 52 53 25447 1 53 54 24090 1 54 55 27786 1 55 56 26195 1 56 57 20516 1 57 58 22759 1 58 59 19028 1 59 60 16971 1 60 61 20036 1 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X t 22527.82 -1760.42 22.99 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -13804.5 -4073.7 208.2 4140.3 11541.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 22527.82 1750.23 12.871 <2e-16 *** X -1760.42 2651.69 -0.664 0.509 t 22.99 68.69 0.335 0.739 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5790 on 58 degrees of freedom Multiple R-squared: 0.009168, Adjusted R-squared: -0.025 F-statistic: 0.2683 on 2 and 58 DF, p-value: 0.7656 > 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.6902283 0.61954341 0.30977170 [2,] 0.5607304 0.87853917 0.43926959 [3,] 0.4302175 0.86043503 0.56978249 [4,] 0.4052909 0.81058183 0.59470908 [5,] 0.2952236 0.59044723 0.70477638 [6,] 0.4084833 0.81696669 0.59151665 [7,] 0.3896969 0.77939382 0.61030309 [8,] 0.3208151 0.64163024 0.67918488 [9,] 0.2497812 0.49956233 0.75021884 [10,] 0.2001896 0.40037920 0.79981040 [11,] 0.3734326 0.74686516 0.62656742 [12,] 0.6138109 0.77237821 0.38618911 [13,] 0.6414608 0.71707831 0.35853915 [14,] 0.7895204 0.42095921 0.21047960 [15,] 0.7429772 0.51404563 0.25702281 [16,] 0.6908718 0.61825642 0.30912821 [17,] 0.6271271 0.74574586 0.37287293 [18,] 0.6290677 0.74186452 0.37093226 [19,] 0.6342711 0.73145773 0.36572887 [20,] 0.6108928 0.77821436 0.38910718 [21,] 0.5440321 0.91193585 0.45596792 [22,] 0.5393416 0.92131677 0.46065839 [23,] 0.8499099 0.30018016 0.15009008 [24,] 0.8816153 0.23676940 0.11838470 [25,] 0.8519107 0.29617869 0.14808934 [26,] 0.8642587 0.27148260 0.13574130 [27,] 0.8226864 0.35462714 0.17731357 [28,] 0.7697925 0.46041508 0.23020754 [29,] 0.7132945 0.57341102 0.28670551 [30,] 0.6668462 0.66630767 0.33315384 [31,] 0.6538921 0.69221574 0.34610787 [32,] 0.6143238 0.77135240 0.38567620 [33,] 0.5387257 0.92254861 0.46127430 [34,] 0.5221123 0.95577541 0.47788771 [35,] 0.8882999 0.22340014 0.11170007 [36,] 0.8742939 0.25141219 0.12570610 [37,] 0.8421105 0.31577906 0.15788953 [38,] 0.7988433 0.40231338 0.20115669 [39,] 0.8520552 0.29588962 0.14794481 [40,] 0.8256696 0.34866081 0.17433041 [41,] 0.8352352 0.32952960 0.16476480 [42,] 0.7833011 0.43339779 0.21669890 [43,] 0.7371090 0.52578194 0.26289097 [44,] 0.6482443 0.70351130 0.35175565 [45,] 0.5529841 0.89403171 0.44701585 [46,] 0.5542137 0.89157270 0.44578635 [47,] 0.9845304 0.03093921 0.01546961 [48,] 0.9664842 0.06703170 0.03351585 [49,] 0.9510626 0.09787484 0.04893742 [50,] 0.8926352 0.21472959 0.10736479 > postscript(file="/var/www/html/rcomp/tmp/1gv2b1258728868.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/2x35h1258728868.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/3eoc51258728868.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/4vzn81258728868.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/5qfys1258728868.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 = 61 Frequency = 1 1 2 3 4 5 6 -2184.8053 208.2076 -3427.7795 -8812.7666 7100.2462 2925.2591 7 8 9 10 11 12 6407.2720 3770.2849 -329.7023 4286.3106 -4810.6765 -4073.6636 13 14 15 16 17 18 -3142.6508 -3064.6379 -4393.6250 -12197.6121 9037.4007 6564.4136 19 20 21 22 23 24 11541.4265 4177.4394 3725.4522 657.4651 -4899.5220 -5751.5091 25 26 27 28 29 30 -4897.4963 -2130.4834 -5766.4705 -13804.4576 7929.5552 3333.5681 31 32 33 34 35 36 7410.5810 2595.5939 1813.6067 2468.6196 -2914.3675 -4667.3546 37 38 39 40 41 42 -2954.3418 1374.6711 -3610.3160 -10709.3031 8095.7098 6617.7226 43 44 45 46 47 48 6502.7355 10155.1683 4024.1812 5010.1941 -1642.7930 -4081.7802 49 50 51 52 53 54 -1373.7673 601.2456 -6367.7415 -10453.7287 3461.2842 2081.2971 55 56 57 58 59 60 5754.3100 4140.3228 -1561.6643 658.3486 -3095.6385 -5175.6257 61 -2133.6128 > postscript(file="/var/www/html/rcomp/tmp/6pzyv1258728868.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -2184.8053 NA 1 208.2076 -2184.8053 2 -3427.7795 208.2076 3 -8812.7666 -3427.7795 4 7100.2462 -8812.7666 5 2925.2591 7100.2462 6 6407.2720 2925.2591 7 3770.2849 6407.2720 8 -329.7023 3770.2849 9 4286.3106 -329.7023 10 -4810.6765 4286.3106 11 -4073.6636 -4810.6765 12 -3142.6508 -4073.6636 13 -3064.6379 -3142.6508 14 -4393.6250 -3064.6379 15 -12197.6121 -4393.6250 16 9037.4007 -12197.6121 17 6564.4136 9037.4007 18 11541.4265 6564.4136 19 4177.4394 11541.4265 20 3725.4522 4177.4394 21 657.4651 3725.4522 22 -4899.5220 657.4651 23 -5751.5091 -4899.5220 24 -4897.4963 -5751.5091 25 -2130.4834 -4897.4963 26 -5766.4705 -2130.4834 27 -13804.4576 -5766.4705 28 7929.5552 -13804.4576 29 3333.5681 7929.5552 30 7410.5810 3333.5681 31 2595.5939 7410.5810 32 1813.6067 2595.5939 33 2468.6196 1813.6067 34 -2914.3675 2468.6196 35 -4667.3546 -2914.3675 36 -2954.3418 -4667.3546 37 1374.6711 -2954.3418 38 -3610.3160 1374.6711 39 -10709.3031 -3610.3160 40 8095.7098 -10709.3031 41 6617.7226 8095.7098 42 6502.7355 6617.7226 43 10155.1683 6502.7355 44 4024.1812 10155.1683 45 5010.1941 4024.1812 46 -1642.7930 5010.1941 47 -4081.7802 -1642.7930 48 -1373.7673 -4081.7802 49 601.2456 -1373.7673 50 -6367.7415 601.2456 51 -10453.7287 -6367.7415 52 3461.2842 -10453.7287 53 2081.2971 3461.2842 54 5754.3100 2081.2971 55 4140.3228 5754.3100 56 -1561.6643 4140.3228 57 658.3486 -1561.6643 58 -3095.6385 658.3486 59 -5175.6257 -3095.6385 60 -2133.6128 -5175.6257 61 NA -2133.6128 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 208.2076 -2184.8053 [2,] -3427.7795 208.2076 [3,] -8812.7666 -3427.7795 [4,] 7100.2462 -8812.7666 [5,] 2925.2591 7100.2462 [6,] 6407.2720 2925.2591 [7,] 3770.2849 6407.2720 [8,] -329.7023 3770.2849 [9,] 4286.3106 -329.7023 [10,] -4810.6765 4286.3106 [11,] -4073.6636 -4810.6765 [12,] -3142.6508 -4073.6636 [13,] -3064.6379 -3142.6508 [14,] -4393.6250 -3064.6379 [15,] -12197.6121 -4393.6250 [16,] 9037.4007 -12197.6121 [17,] 6564.4136 9037.4007 [18,] 11541.4265 6564.4136 [19,] 4177.4394 11541.4265 [20,] 3725.4522 4177.4394 [21,] 657.4651 3725.4522 [22,] -4899.5220 657.4651 [23,] -5751.5091 -4899.5220 [24,] -4897.4963 -5751.5091 [25,] -2130.4834 -4897.4963 [26,] -5766.4705 -2130.4834 [27,] -13804.4576 -5766.4705 [28,] 7929.5552 -13804.4576 [29,] 3333.5681 7929.5552 [30,] 7410.5810 3333.5681 [31,] 2595.5939 7410.5810 [32,] 1813.6067 2595.5939 [33,] 2468.6196 1813.6067 [34,] -2914.3675 2468.6196 [35,] -4667.3546 -2914.3675 [36,] -2954.3418 -4667.3546 [37,] 1374.6711 -2954.3418 [38,] -3610.3160 1374.6711 [39,] -10709.3031 -3610.3160 [40,] 8095.7098 -10709.3031 [41,] 6617.7226 8095.7098 [42,] 6502.7355 6617.7226 [43,] 10155.1683 6502.7355 [44,] 4024.1812 10155.1683 [45,] 5010.1941 4024.1812 [46,] -1642.7930 5010.1941 [47,] -4081.7802 -1642.7930 [48,] -1373.7673 -4081.7802 [49,] 601.2456 -1373.7673 [50,] -6367.7415 601.2456 [51,] -10453.7287 -6367.7415 [52,] 3461.2842 -10453.7287 [53,] 2081.2971 3461.2842 [54,] 5754.3100 2081.2971 [55,] 4140.3228 5754.3100 [56,] -1561.6643 4140.3228 [57,] 658.3486 -1561.6643 [58,] -3095.6385 658.3486 [59,] -5175.6257 -3095.6385 [60,] -2133.6128 -5175.6257 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 208.2076 -2184.8053 2 -3427.7795 208.2076 3 -8812.7666 -3427.7795 4 7100.2462 -8812.7666 5 2925.2591 7100.2462 6 6407.2720 2925.2591 7 3770.2849 6407.2720 8 -329.7023 3770.2849 9 4286.3106 -329.7023 10 -4810.6765 4286.3106 11 -4073.6636 -4810.6765 12 -3142.6508 -4073.6636 13 -3064.6379 -3142.6508 14 -4393.6250 -3064.6379 15 -12197.6121 -4393.6250 16 9037.4007 -12197.6121 17 6564.4136 9037.4007 18 11541.4265 6564.4136 19 4177.4394 11541.4265 20 3725.4522 4177.4394 21 657.4651 3725.4522 22 -4899.5220 657.4651 23 -5751.5091 -4899.5220 24 -4897.4963 -5751.5091 25 -2130.4834 -4897.4963 26 -5766.4705 -2130.4834 27 -13804.4576 -5766.4705 28 7929.5552 -13804.4576 29 3333.5681 7929.5552 30 7410.5810 3333.5681 31 2595.5939 7410.5810 32 1813.6067 2595.5939 33 2468.6196 1813.6067 34 -2914.3675 2468.6196 35 -4667.3546 -2914.3675 36 -2954.3418 -4667.3546 37 1374.6711 -2954.3418 38 -3610.3160 1374.6711 39 -10709.3031 -3610.3160 40 8095.7098 -10709.3031 41 6617.7226 8095.7098 42 6502.7355 6617.7226 43 10155.1683 6502.7355 44 4024.1812 10155.1683 45 5010.1941 4024.1812 46 -1642.7930 5010.1941 47 -4081.7802 -1642.7930 48 -1373.7673 -4081.7802 49 601.2456 -1373.7673 50 -6367.7415 601.2456 51 -10453.7287 -6367.7415 52 3461.2842 -10453.7287 53 2081.2971 3461.2842 54 5754.3100 2081.2971 55 4140.3228 5754.3100 56 -1561.6643 4140.3228 57 658.3486 -1561.6643 58 -3095.6385 658.3486 59 -5175.6257 -3095.6385 60 -2133.6128 -5175.6257 > 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/7mcy81258728868.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/80ztv1258728868.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/9z3uz1258728868.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/10nn8b1258728868.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/114vet1258728868.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/127np31258728868.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/13ummj1258728868.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/14j7h51258728868.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/15xnz01258728868.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/16ys1p1258728868.tab") + } > > system("convert tmp/1gv2b1258728868.ps tmp/1gv2b1258728868.png") > system("convert tmp/2x35h1258728868.ps tmp/2x35h1258728868.png") > system("convert tmp/3eoc51258728868.ps tmp/3eoc51258728868.png") > system("convert tmp/4vzn81258728868.ps tmp/4vzn81258728868.png") > system("convert tmp/5qfys1258728868.ps tmp/5qfys1258728868.png") > system("convert tmp/6pzyv1258728868.ps tmp/6pzyv1258728868.png") > system("convert tmp/7mcy81258728868.ps tmp/7mcy81258728868.png") > system("convert tmp/80ztv1258728868.ps tmp/80ztv1258728868.png") > system("convert tmp/9z3uz1258728868.ps tmp/9z3uz1258728868.png") > system("convert tmp/10nn8b1258728868.ps tmp/10nn8b1258728868.png") > > > proc.time() user system elapsed 2.467 1.566 2.851