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(8.9,1.6,8.8,1.8,8.3,1.6,7.5,1.5,7.2,1.5,7.4,1.3,8.8,1.4,9.3,1.4,9.3,1.3,8.7,1.3,8.2,1.2,8.3,1.1,8.5,1.4,8.6,1.2,8.5,1.5,8.2,1.1,8.1,1.3,7.9,1.5,8.6,1.1,8.7,1.4,8.7,1.3,8.5,1.5,8.4,1.6,8.5,1.7,8.7,1.1,8.7,1.6,8.6,1.3,8.5,1.7,8.3,1.6,8,1.7,8.2,1.9,8.1,1.8,8.1,1.9,8,1.6,7.9,1.5,7.9,1.6,8,1.6,8,1.7,7.9,2,8,2,7.7,1.9,7.2,1.7,7.5,1.8,7.3,1.9,7,1.7,7,2,7,2.1,7.2,2.4,7.3,2.5,7.1,2.5,6.8,2.6,6.4,2.2,6.1,2.5,6.5,2.8,7.7,2.8,7.9,2.9,7.5,3,6.9,3.1,6.6,2.9,6.9,2.7),dim=c(2,60),dimnames=list(c('graad','inflatie'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('graad','inflatie'),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 = '2' > #'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 inflatie graad t 1 1.6 8.9 1 2 1.8 8.8 2 3 1.6 8.3 3 4 1.5 7.5 4 5 1.5 7.2 5 6 1.3 7.4 6 7 1.4 8.8 7 8 1.4 9.3 8 9 1.3 9.3 9 10 1.3 8.7 10 11 1.2 8.2 11 12 1.1 8.3 12 13 1.4 8.5 13 14 1.2 8.6 14 15 1.5 8.5 15 16 1.1 8.2 16 17 1.3 8.1 17 18 1.5 7.9 18 19 1.1 8.6 19 20 1.4 8.7 20 21 1.3 8.7 21 22 1.5 8.5 22 23 1.6 8.4 23 24 1.7 8.5 24 25 1.1 8.7 25 26 1.6 8.7 26 27 1.3 8.6 27 28 1.7 8.5 28 29 1.6 8.3 29 30 1.7 8.0 30 31 1.9 8.2 31 32 1.8 8.1 32 33 1.9 8.1 33 34 1.6 8.0 34 35 1.5 7.9 35 36 1.6 7.9 36 37 1.6 8.0 37 38 1.7 8.0 38 39 2.0 7.9 39 40 2.0 8.0 40 41 1.9 7.7 41 42 1.7 7.2 42 43 1.8 7.5 43 44 1.9 7.3 44 45 1.7 7.0 45 46 2.0 7.0 46 47 2.1 7.0 47 48 2.4 7.2 48 49 2.5 7.3 49 50 2.5 7.1 50 51 2.6 6.8 51 52 2.2 6.4 52 53 2.5 6.1 53 54 2.8 6.5 54 55 2.8 7.7 55 56 2.9 7.9 56 57 3.0 7.5 57 58 3.1 6.9 58 59 2.9 6.6 59 60 2.7 6.9 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) graad t 2.14074 -0.12609 0.02162 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.531190 -0.253037 -0.008696 0.162547 0.725570 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.140743 0.681777 3.140 0.00268 ** graad -0.126086 0.076435 -1.650 0.10453 t 0.021623 0.003253 6.647 1.23e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2954 on 57 degrees of freedom Multiple R-squared: 0.7071, Adjusted R-squared: 0.6968 F-statistic: 68.81 on 2 and 57 DF, p-value: 6.318e-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.1330242631 0.2660485262 0.86697574 [2,] 0.0572763654 0.1145527307 0.94272363 [3,] 0.0236361426 0.0472722852 0.97636386 [4,] 0.0090771161 0.0181542323 0.99092288 [5,] 0.0038342841 0.0076685682 0.99616572 [6,] 0.0012893546 0.0025787093 0.99871065 [7,] 0.0004355596 0.0008711193 0.99956444 [8,] 0.0062951399 0.0125902798 0.99370486 [9,] 0.0030130654 0.0060261308 0.99698693 [10,] 0.0327721925 0.0655443849 0.96722781 [11,] 0.0190349218 0.0380698436 0.98096508 [12,] 0.0186052556 0.0372105112 0.98139474 [13,] 0.0792552315 0.1585104631 0.92074477 [14,] 0.0549898166 0.1099796332 0.94501018 [15,] 0.0636140994 0.1272281987 0.93638590 [16,] 0.0458683039 0.0917366079 0.95413170 [17,] 0.0765943920 0.1531887840 0.92340561 [18,] 0.1674232837 0.3348465674 0.83257672 [19,] 0.3690271580 0.7380543160 0.63097284 [20,] 0.3899682225 0.7799364450 0.61003178 [21,] 0.4274749749 0.8549499499 0.57252503 [22,] 0.3654612287 0.7309224575 0.63453877 [23,] 0.4566674047 0.9133348094 0.54333260 [24,] 0.4417369457 0.8834738915 0.55826305 [25,] 0.5066701198 0.9866597603 0.49332988 [26,] 0.7429346086 0.5141307828 0.25706539 [27,] 0.8255918810 0.3488162380 0.17440812 [28,] 0.9430083740 0.1139832519 0.05699163 [29,] 0.9275277310 0.1449445381 0.07247227 [30,] 0.8995014871 0.2009970258 0.10049851 [31,] 0.8600422499 0.2799155003 0.13995775 [32,] 0.8126599680 0.3746800641 0.18734003 [33,] 0.7559298536 0.4881402928 0.24407015 [34,] 0.8090364912 0.3819270176 0.19096351 [35,] 0.8299381633 0.3401236734 0.17006184 [36,] 0.7959030034 0.4081939933 0.20409700 [37,] 0.7393657584 0.5212684832 0.26063424 [38,] 0.6812137561 0.6375724878 0.31878624 [39,] 0.6091408419 0.7817183162 0.39085916 [40,] 0.7591287927 0.4817424146 0.24087121 [41,] 0.7568765213 0.4862469575 0.24312348 [42,] 0.7749009292 0.4501981415 0.22509907 [43,] 0.7567872783 0.4864254433 0.24321272 [44,] 0.7342754892 0.5314490216 0.26572451 [45,] 0.6765449783 0.6469100433 0.32345502 [46,] 0.6260841049 0.7478317901 0.37391590 [47,] 0.7647514042 0.4704971915 0.23524860 [48,] 0.7565000968 0.4869998065 0.24349990 [49,] 0.7117708142 0.5764583716 0.28822919 > postscript(file="/var/www/html/rcomp/tmp/1kzt31258564709.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/2nw0f1258564709.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/3jcia1258564709.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/4kufn1258564709.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/5j30i1258564709.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 0.559801809 0.725569808 0.440903283 0.218410865 0.158961603 -0.037444505 7 8 9 10 11 12 0.217452959 0.258872744 0.137249375 0.039974219 -0.144692306 -0.253707045 13 14 15 16 17 18 0.049886848 -0.159127891 0.106640108 -0.352809155 -0.187041155 -0.033881787 19 20 21 22 23 24 -0.367244740 -0.076259479 -0.197882848 -0.044723480 0.021044519 0.112029781 25 26 27 28 29 30 -0.484376327 -0.005999697 -0.340231698 0.025536302 -0.121304330 -0.080753593 31 32 33 34 35 36 0.122840299 -0.011391701 0.066984929 -0.267247072 -0.401479073 -0.323102442 37 38 39 40 41 42 -0.332117181 -0.253740551 0.012027448 0.003012710 -0.156436553 -0.441103078 43 44 45 46 47 48 -0.324900554 -0.271741186 -0.531190449 -0.252813819 -0.174437188 0.129156704 49 50 51 52 53 54 0.220141965 0.173301333 0.213852071 -0.258205823 -0.017655086 0.311156068 55 56 57 58 59 60 0.440836271 0.544430163 0.572372269 0.575097113 0.315647851 0.131850374 > postscript(file="/var/www/html/rcomp/tmp/6ltf51258564709.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 0.559801809 NA 1 0.725569808 0.559801809 2 0.440903283 0.725569808 3 0.218410865 0.440903283 4 0.158961603 0.218410865 5 -0.037444505 0.158961603 6 0.217452959 -0.037444505 7 0.258872744 0.217452959 8 0.137249375 0.258872744 9 0.039974219 0.137249375 10 -0.144692306 0.039974219 11 -0.253707045 -0.144692306 12 0.049886848 -0.253707045 13 -0.159127891 0.049886848 14 0.106640108 -0.159127891 15 -0.352809155 0.106640108 16 -0.187041155 -0.352809155 17 -0.033881787 -0.187041155 18 -0.367244740 -0.033881787 19 -0.076259479 -0.367244740 20 -0.197882848 -0.076259479 21 -0.044723480 -0.197882848 22 0.021044519 -0.044723480 23 0.112029781 0.021044519 24 -0.484376327 0.112029781 25 -0.005999697 -0.484376327 26 -0.340231698 -0.005999697 27 0.025536302 -0.340231698 28 -0.121304330 0.025536302 29 -0.080753593 -0.121304330 30 0.122840299 -0.080753593 31 -0.011391701 0.122840299 32 0.066984929 -0.011391701 33 -0.267247072 0.066984929 34 -0.401479073 -0.267247072 35 -0.323102442 -0.401479073 36 -0.332117181 -0.323102442 37 -0.253740551 -0.332117181 38 0.012027448 -0.253740551 39 0.003012710 0.012027448 40 -0.156436553 0.003012710 41 -0.441103078 -0.156436553 42 -0.324900554 -0.441103078 43 -0.271741186 -0.324900554 44 -0.531190449 -0.271741186 45 -0.252813819 -0.531190449 46 -0.174437188 -0.252813819 47 0.129156704 -0.174437188 48 0.220141965 0.129156704 49 0.173301333 0.220141965 50 0.213852071 0.173301333 51 -0.258205823 0.213852071 52 -0.017655086 -0.258205823 53 0.311156068 -0.017655086 54 0.440836271 0.311156068 55 0.544430163 0.440836271 56 0.572372269 0.544430163 57 0.575097113 0.572372269 58 0.315647851 0.575097113 59 0.131850374 0.315647851 60 NA 0.131850374 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.725569808 0.559801809 [2,] 0.440903283 0.725569808 [3,] 0.218410865 0.440903283 [4,] 0.158961603 0.218410865 [5,] -0.037444505 0.158961603 [6,] 0.217452959 -0.037444505 [7,] 0.258872744 0.217452959 [8,] 0.137249375 0.258872744 [9,] 0.039974219 0.137249375 [10,] -0.144692306 0.039974219 [11,] -0.253707045 -0.144692306 [12,] 0.049886848 -0.253707045 [13,] -0.159127891 0.049886848 [14,] 0.106640108 -0.159127891 [15,] -0.352809155 0.106640108 [16,] -0.187041155 -0.352809155 [17,] -0.033881787 -0.187041155 [18,] -0.367244740 -0.033881787 [19,] -0.076259479 -0.367244740 [20,] -0.197882848 -0.076259479 [21,] -0.044723480 -0.197882848 [22,] 0.021044519 -0.044723480 [23,] 0.112029781 0.021044519 [24,] -0.484376327 0.112029781 [25,] -0.005999697 -0.484376327 [26,] -0.340231698 -0.005999697 [27,] 0.025536302 -0.340231698 [28,] -0.121304330 0.025536302 [29,] -0.080753593 -0.121304330 [30,] 0.122840299 -0.080753593 [31,] -0.011391701 0.122840299 [32,] 0.066984929 -0.011391701 [33,] -0.267247072 0.066984929 [34,] -0.401479073 -0.267247072 [35,] -0.323102442 -0.401479073 [36,] -0.332117181 -0.323102442 [37,] -0.253740551 -0.332117181 [38,] 0.012027448 -0.253740551 [39,] 0.003012710 0.012027448 [40,] -0.156436553 0.003012710 [41,] -0.441103078 -0.156436553 [42,] -0.324900554 -0.441103078 [43,] -0.271741186 -0.324900554 [44,] -0.531190449 -0.271741186 [45,] -0.252813819 -0.531190449 [46,] -0.174437188 -0.252813819 [47,] 0.129156704 -0.174437188 [48,] 0.220141965 0.129156704 [49,] 0.173301333 0.220141965 [50,] 0.213852071 0.173301333 [51,] -0.258205823 0.213852071 [52,] -0.017655086 -0.258205823 [53,] 0.311156068 -0.017655086 [54,] 0.440836271 0.311156068 [55,] 0.544430163 0.440836271 [56,] 0.572372269 0.544430163 [57,] 0.575097113 0.572372269 [58,] 0.315647851 0.575097113 [59,] 0.131850374 0.315647851 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.725569808 0.559801809 2 0.440903283 0.725569808 3 0.218410865 0.440903283 4 0.158961603 0.218410865 5 -0.037444505 0.158961603 6 0.217452959 -0.037444505 7 0.258872744 0.217452959 8 0.137249375 0.258872744 9 0.039974219 0.137249375 10 -0.144692306 0.039974219 11 -0.253707045 -0.144692306 12 0.049886848 -0.253707045 13 -0.159127891 0.049886848 14 0.106640108 -0.159127891 15 -0.352809155 0.106640108 16 -0.187041155 -0.352809155 17 -0.033881787 -0.187041155 18 -0.367244740 -0.033881787 19 -0.076259479 -0.367244740 20 -0.197882848 -0.076259479 21 -0.044723480 -0.197882848 22 0.021044519 -0.044723480 23 0.112029781 0.021044519 24 -0.484376327 0.112029781 25 -0.005999697 -0.484376327 26 -0.340231698 -0.005999697 27 0.025536302 -0.340231698 28 -0.121304330 0.025536302 29 -0.080753593 -0.121304330 30 0.122840299 -0.080753593 31 -0.011391701 0.122840299 32 0.066984929 -0.011391701 33 -0.267247072 0.066984929 34 -0.401479073 -0.267247072 35 -0.323102442 -0.401479073 36 -0.332117181 -0.323102442 37 -0.253740551 -0.332117181 38 0.012027448 -0.253740551 39 0.003012710 0.012027448 40 -0.156436553 0.003012710 41 -0.441103078 -0.156436553 42 -0.324900554 -0.441103078 43 -0.271741186 -0.324900554 44 -0.531190449 -0.271741186 45 -0.252813819 -0.531190449 46 -0.174437188 -0.252813819 47 0.129156704 -0.174437188 48 0.220141965 0.129156704 49 0.173301333 0.220141965 50 0.213852071 0.173301333 51 -0.258205823 0.213852071 52 -0.017655086 -0.258205823 53 0.311156068 -0.017655086 54 0.440836271 0.311156068 55 0.544430163 0.440836271 56 0.572372269 0.544430163 57 0.575097113 0.572372269 58 0.315647851 0.575097113 59 0.131850374 0.315647851 > 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/7a0gr1258564709.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/89i4m1258564709.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/9i14y1258564709.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/102k3u1258564709.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/11hmgs1258564709.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/12qehr1258564710.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/139fhy1258564710.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/148zvp1258564710.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/159x4d1258564710.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/16ed6r1258564710.tab") + } > > system("convert tmp/1kzt31258564709.ps tmp/1kzt31258564709.png") > system("convert tmp/2nw0f1258564709.ps tmp/2nw0f1258564709.png") > system("convert tmp/3jcia1258564709.ps tmp/3jcia1258564709.png") > system("convert tmp/4kufn1258564709.ps tmp/4kufn1258564709.png") > system("convert tmp/5j30i1258564709.ps tmp/5j30i1258564709.png") > system("convert tmp/6ltf51258564709.ps tmp/6ltf51258564709.png") > system("convert tmp/7a0gr1258564709.ps tmp/7a0gr1258564709.png") > system("convert tmp/89i4m1258564709.ps tmp/89i4m1258564709.png") > system("convert tmp/9i14y1258564709.ps tmp/9i14y1258564709.png") > system("convert tmp/102k3u1258564709.ps tmp/102k3u1258564709.png") > > > proc.time() user system elapsed 2.453 1.555 2.864