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.1,10.9,7.7,10.0,7.5,9.2,7.6,9.2,7.8,9.5,7.8,9.6,7.8,9.5,7.5,9.1,7.5,8.9,7.1,9.0,7.5,10.1,7.5,10.3,7.6,10.2,7.7,9.6,7.7,9.2,7.9,9.3,8.1,9.4,8.2,9.4,8.2,9.2,8.2,9.0,7.9,9.0,7.3,9.0,6.9,9.8,6.6,10.0,6.7,9.8,6.9,9.3,7.0,9.0,7.1,9.0,7.2,9.1,7.1,9.1,6.9,9.1,7.0,9.2,6.8,8.8,6.4,8.3,6.7,8.4,6.6,8.1,6.4,7.7,6.3,7.9,6.2,7.9,6.5,8.0,6.8,7.9,6.8,7.6,6.4,7.1,6.1,6.8,5.8,6.5,6.1,6.9,7.2,8.2,7.3,8.7,6.9,8.3,6.1,7.9,5.8,7.5,6.2,7.8,7.1,8.3,7.7,8.4,7.9,8.2,7.7,7.7,7.4,7.2,7.5,7.3,8.0,8.1,8.1,8.5),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 Y X 1 8.1 10.9 2 7.7 10.0 3 7.5 9.2 4 7.6 9.2 5 7.8 9.5 6 7.8 9.6 7 7.8 9.5 8 7.5 9.1 9 7.5 8.9 10 7.1 9.0 11 7.5 10.1 12 7.5 10.3 13 7.6 10.2 14 7.7 9.6 15 7.7 9.2 16 7.9 9.3 17 8.1 9.4 18 8.2 9.4 19 8.2 9.2 20 8.2 9.0 21 7.9 9.0 22 7.3 9.0 23 6.9 9.8 24 6.6 10.0 25 6.7 9.8 26 6.9 9.3 27 7.0 9.0 28 7.1 9.0 29 7.2 9.1 30 7.1 9.1 31 6.9 9.1 32 7.0 9.2 33 6.8 8.8 34 6.4 8.3 35 6.7 8.4 36 6.6 8.1 37 6.4 7.7 38 6.3 7.9 39 6.2 7.9 40 6.5 8.0 41 6.8 7.9 42 6.8 7.6 43 6.4 7.1 44 6.1 6.8 45 5.8 6.5 46 6.1 6.9 47 7.2 8.2 48 7.3 8.7 49 6.9 8.3 50 6.1 7.9 51 5.8 7.5 52 6.2 7.8 53 7.1 8.3 54 7.7 8.4 55 7.9 8.2 56 7.7 7.7 57 7.4 7.2 58 7.5 7.3 59 8.0 8.1 60 8.1 8.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 3.676 0.402 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.09596 -0.37207 -0.08212 0.30505 1.06788 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.67573 0.64978 5.657 4.98e-07 *** X 0.40202 0.07425 5.414 1.23e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5425 on 58 degrees of freedom Multiple R-squared: 0.3357, Adjusted R-squared: 0.3243 F-statistic: 29.31 on 1 and 58 DF, p-value: 1.230e-06 > 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,] 1.058222e-02 2.116445e-02 0.9894177772 [2,] 2.618280e-03 5.236560e-03 0.9973817200 [3,] 7.196508e-04 1.439302e-03 0.9992803492 [4,] 1.610311e-04 3.220622e-04 0.9998389689 [5,] 2.608331e-05 5.216662e-05 0.9999739167 [6,] 4.362051e-04 8.724102e-04 0.9995637949 [7,] 5.685435e-04 1.137087e-03 0.9994314565 [8,] 5.673224e-04 1.134645e-03 0.9994326776 [9,] 2.308053e-04 4.616106e-04 0.9997691947 [10,] 7.963105e-05 1.592621e-04 0.9999203690 [11,] 3.507202e-05 7.014405e-05 0.9999649280 [12,] 3.842459e-05 7.684919e-05 0.9999615754 [13,] 1.187595e-04 2.375190e-04 0.9998812405 [14,] 4.333052e-04 8.666104e-04 0.9995666948 [15,] 1.205834e-03 2.411669e-03 0.9987941657 [16,] 2.882502e-03 5.765004e-03 0.9971174982 [17,] 2.341904e-03 4.683808e-03 0.9976580958 [18,] 2.353990e-03 4.707981e-03 0.9976460096 [19,] 9.706993e-03 1.941399e-02 0.9902930073 [20,] 5.700896e-02 1.140179e-01 0.9429910369 [21,] 1.198123e-01 2.396247e-01 0.8801876570 [22,] 1.444359e-01 2.888718e-01 0.8555640841 [23,] 1.431015e-01 2.862030e-01 0.8568985073 [24,] 1.237402e-01 2.474804e-01 0.8762598091 [25,] 9.740238e-02 1.948048e-01 0.9025976240 [26,] 8.054786e-02 1.610957e-01 0.9194521398 [27,] 8.210272e-02 1.642054e-01 0.9178972819 [28,] 7.680161e-02 1.536032e-01 0.9231983900 [29,] 8.254177e-02 1.650835e-01 0.9174582262 [30,] 1.195245e-01 2.390490e-01 0.8804754953 [31,] 1.129928e-01 2.259855e-01 0.8870072417 [32,] 9.977385e-02 1.995477e-01 0.9002261525 [33,] 8.394938e-02 1.678988e-01 0.9160506182 [34,] 8.802243e-02 1.760449e-01 0.9119775690 [35,] 1.073298e-01 2.146596e-01 0.8926702154 [36,] 9.996216e-02 1.999243e-01 0.9000378442 [37,] 7.364873e-02 1.472975e-01 0.9263512705 [38,] 5.138125e-02 1.027625e-01 0.9486187548 [39,] 3.330194e-02 6.660387e-02 0.9666980633 [40,] 2.112170e-02 4.224341e-02 0.9788782975 [41,] 1.432179e-02 2.864357e-02 0.9856782144 [42,] 1.019778e-02 2.039555e-02 0.9898022229 [43,] 6.312895e-03 1.262579e-02 0.9936871052 [44,] 3.808068e-03 7.616136e-03 0.9961919321 [45,] 2.780080e-03 5.560160e-03 0.9972199200 [46,] 1.119474e-02 2.238948e-02 0.9888052578 [47,] 1.136874e-01 2.273749e-01 0.8863125559 [48,] 7.637403e-01 4.725194e-01 0.2362597060 [49,] 9.889471e-01 2.210584e-02 0.0110529217 [50,] 9.994103e-01 1.179374e-03 0.0005896872 [51,] 9.978915e-01 4.217026e-03 0.0021085128 > postscript(file="/var/www/html/rcomp/tmp/14q1h1258810777.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/2atpd1258810777.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/3rjas1258810777.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/4puph1258810777.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/5gueo1258810777.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.042215561 0.004036468 0.125655052 0.225655052 0.305048083 0.264845760 7 8 9 10 11 12 0.305048083 0.165857375 0.246262021 -0.193940302 -0.236165855 -0.316570501 13 14 15 16 17 18 -0.176368178 0.164845760 0.325655052 0.485452729 0.645250406 0.745250406 19 20 21 22 23 24 0.825655052 0.906059698 0.606059698 0.006059698 -0.715558886 -1.095963532 25 26 27 28 29 30 -0.915558886 -0.514547271 -0.293940302 -0.193940302 -0.134142625 -0.234142625 31 32 33 34 35 36 -0.434142625 -0.374344948 -0.413535656 -0.612524041 -0.352726364 -0.332119396 37 38 39 40 41 42 -0.371310104 -0.551714750 -0.651714750 -0.391917073 -0.051714750 0.068892219 43 44 45 46 47 48 -0.130096166 -0.309489197 -0.488882228 -0.349691520 0.227678282 0.126666667 49 50 51 52 53 54 -0.112524041 -0.751714750 -0.890905458 -0.611512427 0.087475959 0.647273636 55 56 57 58 59 60 0.927678282 0.928689896 0.829701511 0.889499188 1.067880604 1.007071313 > postscript(file="/var/www/html/rcomp/tmp/69rdw1258810777.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.042215561 NA 1 0.004036468 0.042215561 2 0.125655052 0.004036468 3 0.225655052 0.125655052 4 0.305048083 0.225655052 5 0.264845760 0.305048083 6 0.305048083 0.264845760 7 0.165857375 0.305048083 8 0.246262021 0.165857375 9 -0.193940302 0.246262021 10 -0.236165855 -0.193940302 11 -0.316570501 -0.236165855 12 -0.176368178 -0.316570501 13 0.164845760 -0.176368178 14 0.325655052 0.164845760 15 0.485452729 0.325655052 16 0.645250406 0.485452729 17 0.745250406 0.645250406 18 0.825655052 0.745250406 19 0.906059698 0.825655052 20 0.606059698 0.906059698 21 0.006059698 0.606059698 22 -0.715558886 0.006059698 23 -1.095963532 -0.715558886 24 -0.915558886 -1.095963532 25 -0.514547271 -0.915558886 26 -0.293940302 -0.514547271 27 -0.193940302 -0.293940302 28 -0.134142625 -0.193940302 29 -0.234142625 -0.134142625 30 -0.434142625 -0.234142625 31 -0.374344948 -0.434142625 32 -0.413535656 -0.374344948 33 -0.612524041 -0.413535656 34 -0.352726364 -0.612524041 35 -0.332119396 -0.352726364 36 -0.371310104 -0.332119396 37 -0.551714750 -0.371310104 38 -0.651714750 -0.551714750 39 -0.391917073 -0.651714750 40 -0.051714750 -0.391917073 41 0.068892219 -0.051714750 42 -0.130096166 0.068892219 43 -0.309489197 -0.130096166 44 -0.488882228 -0.309489197 45 -0.349691520 -0.488882228 46 0.227678282 -0.349691520 47 0.126666667 0.227678282 48 -0.112524041 0.126666667 49 -0.751714750 -0.112524041 50 -0.890905458 -0.751714750 51 -0.611512427 -0.890905458 52 0.087475959 -0.611512427 53 0.647273636 0.087475959 54 0.927678282 0.647273636 55 0.928689896 0.927678282 56 0.829701511 0.928689896 57 0.889499188 0.829701511 58 1.067880604 0.889499188 59 1.007071313 1.067880604 60 NA 1.007071313 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.004036468 0.042215561 [2,] 0.125655052 0.004036468 [3,] 0.225655052 0.125655052 [4,] 0.305048083 0.225655052 [5,] 0.264845760 0.305048083 [6,] 0.305048083 0.264845760 [7,] 0.165857375 0.305048083 [8,] 0.246262021 0.165857375 [9,] -0.193940302 0.246262021 [10,] -0.236165855 -0.193940302 [11,] -0.316570501 -0.236165855 [12,] -0.176368178 -0.316570501 [13,] 0.164845760 -0.176368178 [14,] 0.325655052 0.164845760 [15,] 0.485452729 0.325655052 [16,] 0.645250406 0.485452729 [17,] 0.745250406 0.645250406 [18,] 0.825655052 0.745250406 [19,] 0.906059698 0.825655052 [20,] 0.606059698 0.906059698 [21,] 0.006059698 0.606059698 [22,] -0.715558886 0.006059698 [23,] -1.095963532 -0.715558886 [24,] -0.915558886 -1.095963532 [25,] -0.514547271 -0.915558886 [26,] -0.293940302 -0.514547271 [27,] -0.193940302 -0.293940302 [28,] -0.134142625 -0.193940302 [29,] -0.234142625 -0.134142625 [30,] -0.434142625 -0.234142625 [31,] -0.374344948 -0.434142625 [32,] -0.413535656 -0.374344948 [33,] -0.612524041 -0.413535656 [34,] -0.352726364 -0.612524041 [35,] -0.332119396 -0.352726364 [36,] -0.371310104 -0.332119396 [37,] -0.551714750 -0.371310104 [38,] -0.651714750 -0.551714750 [39,] -0.391917073 -0.651714750 [40,] -0.051714750 -0.391917073 [41,] 0.068892219 -0.051714750 [42,] -0.130096166 0.068892219 [43,] -0.309489197 -0.130096166 [44,] -0.488882228 -0.309489197 [45,] -0.349691520 -0.488882228 [46,] 0.227678282 -0.349691520 [47,] 0.126666667 0.227678282 [48,] -0.112524041 0.126666667 [49,] -0.751714750 -0.112524041 [50,] -0.890905458 -0.751714750 [51,] -0.611512427 -0.890905458 [52,] 0.087475959 -0.611512427 [53,] 0.647273636 0.087475959 [54,] 0.927678282 0.647273636 [55,] 0.928689896 0.927678282 [56,] 0.829701511 0.928689896 [57,] 0.889499188 0.829701511 [58,] 1.067880604 0.889499188 [59,] 1.007071313 1.067880604 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.004036468 0.042215561 2 0.125655052 0.004036468 3 0.225655052 0.125655052 4 0.305048083 0.225655052 5 0.264845760 0.305048083 6 0.305048083 0.264845760 7 0.165857375 0.305048083 8 0.246262021 0.165857375 9 -0.193940302 0.246262021 10 -0.236165855 -0.193940302 11 -0.316570501 -0.236165855 12 -0.176368178 -0.316570501 13 0.164845760 -0.176368178 14 0.325655052 0.164845760 15 0.485452729 0.325655052 16 0.645250406 0.485452729 17 0.745250406 0.645250406 18 0.825655052 0.745250406 19 0.906059698 0.825655052 20 0.606059698 0.906059698 21 0.006059698 0.606059698 22 -0.715558886 0.006059698 23 -1.095963532 -0.715558886 24 -0.915558886 -1.095963532 25 -0.514547271 -0.915558886 26 -0.293940302 -0.514547271 27 -0.193940302 -0.293940302 28 -0.134142625 -0.193940302 29 -0.234142625 -0.134142625 30 -0.434142625 -0.234142625 31 -0.374344948 -0.434142625 32 -0.413535656 -0.374344948 33 -0.612524041 -0.413535656 34 -0.352726364 -0.612524041 35 -0.332119396 -0.352726364 36 -0.371310104 -0.332119396 37 -0.551714750 -0.371310104 38 -0.651714750 -0.551714750 39 -0.391917073 -0.651714750 40 -0.051714750 -0.391917073 41 0.068892219 -0.051714750 42 -0.130096166 0.068892219 43 -0.309489197 -0.130096166 44 -0.488882228 -0.309489197 45 -0.349691520 -0.488882228 46 0.227678282 -0.349691520 47 0.126666667 0.227678282 48 -0.112524041 0.126666667 49 -0.751714750 -0.112524041 50 -0.890905458 -0.751714750 51 -0.611512427 -0.890905458 52 0.087475959 -0.611512427 53 0.647273636 0.087475959 54 0.927678282 0.647273636 55 0.928689896 0.927678282 56 0.829701511 0.928689896 57 0.889499188 0.829701511 58 1.067880604 0.889499188 59 1.007071313 1.067880604 > 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/7u7e91258810777.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/8js6u1258810777.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/9qsal1258810777.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/10j65s1258810777.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/1184ny1258810777.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/12b35w1258810777.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/13jexu1258810777.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/14pfsb1258810777.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/152r2n1258810777.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/16gw2b1258810777.tab") + } > > system("convert tmp/14q1h1258810777.ps tmp/14q1h1258810777.png") > system("convert tmp/2atpd1258810777.ps tmp/2atpd1258810777.png") > system("convert tmp/3rjas1258810777.ps tmp/3rjas1258810777.png") > system("convert tmp/4puph1258810777.ps tmp/4puph1258810777.png") > system("convert tmp/5gueo1258810777.ps tmp/5gueo1258810777.png") > system("convert tmp/69rdw1258810777.ps tmp/69rdw1258810777.png") > system("convert tmp/7u7e91258810777.ps tmp/7u7e91258810777.png") > system("convert tmp/8js6u1258810777.ps tmp/8js6u1258810777.png") > system("convert tmp/9qsal1258810777.ps tmp/9qsal1258810777.png") > system("convert tmp/10j65s1258810777.ps tmp/10j65s1258810777.png") > > > proc.time() user system elapsed 2.453 1.559 3.436