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(2.11,0,2.09,0,2.05,0,2.08,0,2.06,0,2.06,0,2.08,0,2.07,0,2.06,0,2.07,0,2.06,0,2.09,0,2.07,0,2.09,0,2.28,0,2.33,0,2.35,0,2.52,0,2.63,0,2.58,0,2.70,0,2.81,0,2.97,0,3.04,0,3.28,0,3.33,0,3.50,0,3.56,0,3.57,0,3.69,0,3.82,0,3.79,0,3.96,0,4.06,0,4.05,0,4.03,0,3.94,0,4.02,0,3.88,0,4.02,0,4.03,0,4.09,0,3.99,0,4.01,0,4.01,0,4.19,0,4.30,0,4.27,0,3.82,0,3.15,1,2.49,1,1.81,1,1.26,1,1.06,1,0.84,1,0.78,1,0.70,1,0.36,1,0.35,1,0.36,1),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 = '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 2.11 0 1 2 2.09 0 2 3 2.05 0 3 4 2.08 0 4 5 2.06 0 5 6 2.06 0 6 7 2.08 0 7 8 2.07 0 8 9 2.06 0 9 10 2.07 0 10 11 2.06 0 11 12 2.09 0 12 13 2.07 0 13 14 2.09 0 14 15 2.28 0 15 16 2.33 0 16 17 2.35 0 17 18 2.52 0 18 19 2.63 0 19 20 2.58 0 20 21 2.70 0 21 22 2.81 0 22 23 2.97 0 23 24 3.04 0 24 25 3.28 0 25 26 3.33 0 26 27 3.50 0 27 28 3.56 0 28 29 3.57 0 29 30 3.69 0 30 31 3.82 0 31 32 3.79 0 32 33 3.96 0 33 34 4.06 0 34 35 4.05 0 35 36 4.03 0 36 37 3.94 0 37 38 4.02 0 38 39 3.88 0 39 40 4.02 0 40 41 4.03 0 41 42 4.09 0 42 43 3.99 0 43 44 4.01 0 44 45 4.01 0 45 46 4.19 0 46 47 4.30 0 47 48 4.27 0 48 49 3.82 0 49 50 3.15 1 50 51 2.49 1 51 52 1.81 1 52 53 1.26 1 53 54 1.06 1 54 55 0.84 1 55 56 0.78 1 56 57 0.70 1 57 58 0.36 1 58 59 0.35 1 59 60 0.36 1 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X t 1.77079 -3.52383 0.05363 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.10449 -0.24361 -0.03336 0.21157 2.22176 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.770788 0.148037 11.96 < 2e-16 *** X -3.523834 0.230361 -15.30 < 2e-16 *** t 0.053626 0.005147 10.42 8.18e-15 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5124 on 57 degrees of freedom Multiple R-squared: 0.8042, Adjusted R-squared: 0.7973 F-statistic: 117 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,] 6.996183e-05 1.399237e-04 0.99993004 [2,] 5.218053e-06 1.043611e-05 0.99999478 [3,] 2.032749e-07 4.065498e-07 0.99999980 [4,] 6.425831e-09 1.285166e-08 0.99999999 [5,] 2.408092e-10 4.816183e-10 1.00000000 [6,] 6.936663e-12 1.387333e-11 1.00000000 [7,] 8.352048e-13 1.670410e-12 1.00000000 [8,] 2.733242e-14 5.466484e-14 1.00000000 [9,] 1.926231e-15 3.852462e-15 1.00000000 [10,] 7.799268e-11 1.559854e-10 1.00000000 [11,] 4.436752e-10 8.873503e-10 1.00000000 [12,] 4.272472e-10 8.544945e-10 1.00000000 [13,] 3.580733e-09 7.161467e-09 1.00000000 [14,] 1.828673e-08 3.657347e-08 0.99999998 [15,] 1.216937e-08 2.433874e-08 0.99999999 [16,] 1.480026e-08 2.960053e-08 0.99999999 [17,] 2.531661e-08 5.063322e-08 0.99999997 [18,] 8.422557e-08 1.684511e-07 0.99999992 [19,] 1.786464e-07 3.572927e-07 0.99999982 [20,] 1.057100e-06 2.114199e-06 0.99999894 [21,] 2.495072e-06 4.990144e-06 0.99999750 [22,] 6.953782e-06 1.390756e-05 0.99999305 [23,] 1.168170e-05 2.336339e-05 0.99998832 [24,] 1.300936e-05 2.601872e-05 0.99998699 [25,] 1.518203e-05 3.036406e-05 0.99998482 [26,] 1.828708e-05 3.657416e-05 0.99998171 [27,] 1.650921e-05 3.301841e-05 0.99998349 [28,] 1.640440e-05 3.280879e-05 0.99998360 [29,] 1.513219e-05 3.026437e-05 0.99998487 [30,] 1.125466e-05 2.250933e-05 0.99998875 [31,] 8.002511e-06 1.600502e-05 0.99999200 [32,] 7.943539e-06 1.588708e-05 0.99999206 [33,] 7.835298e-06 1.567060e-05 0.99999216 [34,] 2.245562e-05 4.491123e-05 0.99997754 [35,] 4.526783e-05 9.053565e-05 0.99995473 [36,] 1.215537e-04 2.431074e-04 0.99987845 [37,] 2.884674e-04 5.769348e-04 0.99971153 [38,] 1.567091e-03 3.134181e-03 0.99843291 [39,] 7.537081e-03 1.507416e-02 0.99246292 [40,] 3.094913e-02 6.189826e-02 0.96905087 [41,] 3.654097e-02 7.308195e-02 0.96345903 [42,] 2.367494e-02 4.734988e-02 0.97632506 [43,] 1.607262e-02 3.214524e-02 0.98392738 [44,] 2.313480e-02 4.626961e-02 0.97686520 [45,] 2.099065e-01 4.198130e-01 0.79009348 [46,] 8.064559e-01 3.870882e-01 0.19354408 [47,] 9.856014e-01 2.879727e-02 0.01439863 [48,] 9.818674e-01 3.626528e-02 0.01813264 [49,] 9.604630e-01 7.907403e-02 0.03953701 > postscript(file="/var/www/html/rcomp/tmp/1fudp1258653125.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/2wbor1258653125.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/3r2nw1258653125.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/4wv2m1258653125.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/5vgod1258653125.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.285586565 0.211960934 0.118335303 0.094709673 0.021084042 -0.032541589 7 8 9 10 11 12 -0.066167219 -0.129792850 -0.193418481 -0.237044111 -0.300669742 -0.324295373 13 14 15 16 17 18 -0.397921003 -0.431546634 -0.295172265 -0.298797895 -0.332423526 -0.216049157 19 20 21 22 23 24 -0.159674787 -0.263300418 -0.196926049 -0.140551679 -0.034177310 -0.017802941 25 26 27 28 29 30 0.168571429 0.164945798 0.281320167 0.287694537 0.244068906 0.310443275 31 32 33 34 35 36 0.386817645 0.303192014 0.419566383 0.465940752 0.402315122 0.328689491 37 38 39 40 41 42 0.185063860 0.211438230 0.017812599 0.104186968 0.060561338 0.066935707 43 44 45 46 47 48 -0.086689924 -0.120315554 -0.173941185 -0.047566816 0.008807554 -0.074818077 49 50 51 52 53 54 -0.578443708 2.221764517 1.508138886 0.774513256 0.170887625 -0.082738006 55 56 57 58 59 60 -0.356363636 -0.469989267 -0.603614898 -0.997240528 -1.060866159 -1.104491790 > postscript(file="/var/www/html/rcomp/tmp/6dhse1258653125.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.285586565 NA 1 0.211960934 0.285586565 2 0.118335303 0.211960934 3 0.094709673 0.118335303 4 0.021084042 0.094709673 5 -0.032541589 0.021084042 6 -0.066167219 -0.032541589 7 -0.129792850 -0.066167219 8 -0.193418481 -0.129792850 9 -0.237044111 -0.193418481 10 -0.300669742 -0.237044111 11 -0.324295373 -0.300669742 12 -0.397921003 -0.324295373 13 -0.431546634 -0.397921003 14 -0.295172265 -0.431546634 15 -0.298797895 -0.295172265 16 -0.332423526 -0.298797895 17 -0.216049157 -0.332423526 18 -0.159674787 -0.216049157 19 -0.263300418 -0.159674787 20 -0.196926049 -0.263300418 21 -0.140551679 -0.196926049 22 -0.034177310 -0.140551679 23 -0.017802941 -0.034177310 24 0.168571429 -0.017802941 25 0.164945798 0.168571429 26 0.281320167 0.164945798 27 0.287694537 0.281320167 28 0.244068906 0.287694537 29 0.310443275 0.244068906 30 0.386817645 0.310443275 31 0.303192014 0.386817645 32 0.419566383 0.303192014 33 0.465940752 0.419566383 34 0.402315122 0.465940752 35 0.328689491 0.402315122 36 0.185063860 0.328689491 37 0.211438230 0.185063860 38 0.017812599 0.211438230 39 0.104186968 0.017812599 40 0.060561338 0.104186968 41 0.066935707 0.060561338 42 -0.086689924 0.066935707 43 -0.120315554 -0.086689924 44 -0.173941185 -0.120315554 45 -0.047566816 -0.173941185 46 0.008807554 -0.047566816 47 -0.074818077 0.008807554 48 -0.578443708 -0.074818077 49 2.221764517 -0.578443708 50 1.508138886 2.221764517 51 0.774513256 1.508138886 52 0.170887625 0.774513256 53 -0.082738006 0.170887625 54 -0.356363636 -0.082738006 55 -0.469989267 -0.356363636 56 -0.603614898 -0.469989267 57 -0.997240528 -0.603614898 58 -1.060866159 -0.997240528 59 -1.104491790 -1.060866159 60 NA -1.104491790 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.211960934 0.285586565 [2,] 0.118335303 0.211960934 [3,] 0.094709673 0.118335303 [4,] 0.021084042 0.094709673 [5,] -0.032541589 0.021084042 [6,] -0.066167219 -0.032541589 [7,] -0.129792850 -0.066167219 [8,] -0.193418481 -0.129792850 [9,] -0.237044111 -0.193418481 [10,] -0.300669742 -0.237044111 [11,] -0.324295373 -0.300669742 [12,] -0.397921003 -0.324295373 [13,] -0.431546634 -0.397921003 [14,] -0.295172265 -0.431546634 [15,] -0.298797895 -0.295172265 [16,] -0.332423526 -0.298797895 [17,] -0.216049157 -0.332423526 [18,] -0.159674787 -0.216049157 [19,] -0.263300418 -0.159674787 [20,] -0.196926049 -0.263300418 [21,] -0.140551679 -0.196926049 [22,] -0.034177310 -0.140551679 [23,] -0.017802941 -0.034177310 [24,] 0.168571429 -0.017802941 [25,] 0.164945798 0.168571429 [26,] 0.281320167 0.164945798 [27,] 0.287694537 0.281320167 [28,] 0.244068906 0.287694537 [29,] 0.310443275 0.244068906 [30,] 0.386817645 0.310443275 [31,] 0.303192014 0.386817645 [32,] 0.419566383 0.303192014 [33,] 0.465940752 0.419566383 [34,] 0.402315122 0.465940752 [35,] 0.328689491 0.402315122 [36,] 0.185063860 0.328689491 [37,] 0.211438230 0.185063860 [38,] 0.017812599 0.211438230 [39,] 0.104186968 0.017812599 [40,] 0.060561338 0.104186968 [41,] 0.066935707 0.060561338 [42,] -0.086689924 0.066935707 [43,] -0.120315554 -0.086689924 [44,] -0.173941185 -0.120315554 [45,] -0.047566816 -0.173941185 [46,] 0.008807554 -0.047566816 [47,] -0.074818077 0.008807554 [48,] -0.578443708 -0.074818077 [49,] 2.221764517 -0.578443708 [50,] 1.508138886 2.221764517 [51,] 0.774513256 1.508138886 [52,] 0.170887625 0.774513256 [53,] -0.082738006 0.170887625 [54,] -0.356363636 -0.082738006 [55,] -0.469989267 -0.356363636 [56,] -0.603614898 -0.469989267 [57,] -0.997240528 -0.603614898 [58,] -1.060866159 -0.997240528 [59,] -1.104491790 -1.060866159 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.211960934 0.285586565 2 0.118335303 0.211960934 3 0.094709673 0.118335303 4 0.021084042 0.094709673 5 -0.032541589 0.021084042 6 -0.066167219 -0.032541589 7 -0.129792850 -0.066167219 8 -0.193418481 -0.129792850 9 -0.237044111 -0.193418481 10 -0.300669742 -0.237044111 11 -0.324295373 -0.300669742 12 -0.397921003 -0.324295373 13 -0.431546634 -0.397921003 14 -0.295172265 -0.431546634 15 -0.298797895 -0.295172265 16 -0.332423526 -0.298797895 17 -0.216049157 -0.332423526 18 -0.159674787 -0.216049157 19 -0.263300418 -0.159674787 20 -0.196926049 -0.263300418 21 -0.140551679 -0.196926049 22 -0.034177310 -0.140551679 23 -0.017802941 -0.034177310 24 0.168571429 -0.017802941 25 0.164945798 0.168571429 26 0.281320167 0.164945798 27 0.287694537 0.281320167 28 0.244068906 0.287694537 29 0.310443275 0.244068906 30 0.386817645 0.310443275 31 0.303192014 0.386817645 32 0.419566383 0.303192014 33 0.465940752 0.419566383 34 0.402315122 0.465940752 35 0.328689491 0.402315122 36 0.185063860 0.328689491 37 0.211438230 0.185063860 38 0.017812599 0.211438230 39 0.104186968 0.017812599 40 0.060561338 0.104186968 41 0.066935707 0.060561338 42 -0.086689924 0.066935707 43 -0.120315554 -0.086689924 44 -0.173941185 -0.120315554 45 -0.047566816 -0.173941185 46 0.008807554 -0.047566816 47 -0.074818077 0.008807554 48 -0.578443708 -0.074818077 49 2.221764517 -0.578443708 50 1.508138886 2.221764517 51 0.774513256 1.508138886 52 0.170887625 0.774513256 53 -0.082738006 0.170887625 54 -0.356363636 -0.082738006 55 -0.469989267 -0.356363636 56 -0.603614898 -0.469989267 57 -0.997240528 -0.603614898 58 -1.060866159 -0.997240528 59 -1.104491790 -1.060866159 > 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/7oj101258653125.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/8crqp1258653125.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/9lfnb1258653125.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/10w0lp1258653125.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/11aokx1258653125.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/122uu51258653126.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/13lto41258653126.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/146hpa1258653126.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/15ydcz1258653126.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/163iqt1258653126.tab") + } > > system("convert tmp/1fudp1258653125.ps tmp/1fudp1258653125.png") > system("convert tmp/2wbor1258653125.ps tmp/2wbor1258653125.png") > system("convert tmp/3r2nw1258653125.ps tmp/3r2nw1258653125.png") > system("convert tmp/4wv2m1258653125.ps tmp/4wv2m1258653125.png") > system("convert tmp/5vgod1258653125.ps tmp/5vgod1258653125.png") > system("convert tmp/6dhse1258653125.ps tmp/6dhse1258653125.png") > system("convert tmp/7oj101258653125.ps tmp/7oj101258653125.png") > system("convert tmp/8crqp1258653125.ps tmp/8crqp1258653125.png") > system("convert tmp/9lfnb1258653125.ps tmp/9lfnb1258653125.png") > system("convert tmp/10w0lp1258653125.ps tmp/10w0lp1258653125.png") > > > proc.time() user system elapsed 2.417 1.513 2.867