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(93.3,121.8,97.3,127.6,127,129.9,111.7,128,96.4,123.5,133,124,72.2,127.4,95.8,127.6,124.1,128.4,127.6,131.4,110.7,135.1,104.6,134,112.7,144.5,115.3,147.3,139.4,150.9,119,148.7,97.4,141.4,154,138.9,81.5,139.8,88.8,145.6,127.7,147.9,105.1,148.5,114.9,151.1,106.4,157.5,104.5,167.5,121.6,172.3,141.4,173.5,99,187.5,126.7,205.5,134.1,195.1,81.3,204.5,88.6,204.5,132.7,201.7,132.9,207,134.4,206.6,103.7,210.6,119.7,211.1,115,215,132.9,223.9,108.5,238.2,113.9,238.9,142,229.6,97.7,232.2,92.2,222.1,128.8,221.6,134.9,227.3,128.2,221,114.8,213.6,117.9,243.4,119.1,253.8,120.7,265.3,129.1,268.2,117.6,268.5,129.2,266.9,100,268.4,87,250.8,128,231.2,127.7,192,93.4,171.4,84.1,160,71.7,148.1),dim=c(2,61),dimnames=list(c('IPtran','IGPic'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('IPtran','IGPic'),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 = 'No Linear Trend' > par2 = 'Include Monthly 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 IPtran IGPic M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 93.3 121.8 1 0 0 0 0 0 0 0 0 0 0 2 97.3 127.6 0 1 0 0 0 0 0 0 0 0 0 3 127.0 129.9 0 0 1 0 0 0 0 0 0 0 0 4 111.7 128.0 0 0 0 1 0 0 0 0 0 0 0 5 96.4 123.5 0 0 0 0 1 0 0 0 0 0 0 6 133.0 124.0 0 0 0 0 0 1 0 0 0 0 0 7 72.2 127.4 0 0 0 0 0 0 1 0 0 0 0 8 95.8 127.6 0 0 0 0 0 0 0 1 0 0 0 9 124.1 128.4 0 0 0 0 0 0 0 0 1 0 0 10 127.6 131.4 0 0 0 0 0 0 0 0 0 1 0 11 110.7 135.1 0 0 0 0 0 0 0 0 0 0 1 12 104.6 134.0 0 0 0 0 0 0 0 0 0 0 0 13 112.7 144.5 1 0 0 0 0 0 0 0 0 0 0 14 115.3 147.3 0 1 0 0 0 0 0 0 0 0 0 15 139.4 150.9 0 0 1 0 0 0 0 0 0 0 0 16 119.0 148.7 0 0 0 1 0 0 0 0 0 0 0 17 97.4 141.4 0 0 0 0 1 0 0 0 0 0 0 18 154.0 138.9 0 0 0 0 0 1 0 0 0 0 0 19 81.5 139.8 0 0 0 0 0 0 1 0 0 0 0 20 88.8 145.6 0 0 0 0 0 0 0 1 0 0 0 21 127.7 147.9 0 0 0 0 0 0 0 0 1 0 0 22 105.1 148.5 0 0 0 0 0 0 0 0 0 1 0 23 114.9 151.1 0 0 0 0 0 0 0 0 0 0 1 24 106.4 157.5 0 0 0 0 0 0 0 0 0 0 0 25 104.5 167.5 1 0 0 0 0 0 0 0 0 0 0 26 121.6 172.3 0 1 0 0 0 0 0 0 0 0 0 27 141.4 173.5 0 0 1 0 0 0 0 0 0 0 0 28 99.0 187.5 0 0 0 1 0 0 0 0 0 0 0 29 126.7 205.5 0 0 0 0 1 0 0 0 0 0 0 30 134.1 195.1 0 0 0 0 0 1 0 0 0 0 0 31 81.3 204.5 0 0 0 0 0 0 1 0 0 0 0 32 88.6 204.5 0 0 0 0 0 0 0 1 0 0 0 33 132.7 201.7 0 0 0 0 0 0 0 0 1 0 0 34 132.9 207.0 0 0 0 0 0 0 0 0 0 1 0 35 134.4 206.6 0 0 0 0 0 0 0 0 0 0 1 36 103.7 210.6 0 0 0 0 0 0 0 0 0 0 0 37 119.7 211.1 1 0 0 0 0 0 0 0 0 0 0 38 115.0 215.0 0 1 0 0 0 0 0 0 0 0 0 39 132.9 223.9 0 0 1 0 0 0 0 0 0 0 0 40 108.5 238.2 0 0 0 1 0 0 0 0 0 0 0 41 113.9 238.9 0 0 0 0 1 0 0 0 0 0 0 42 142.0 229.6 0 0 0 0 0 1 0 0 0 0 0 43 97.7 232.2 0 0 0 0 0 0 1 0 0 0 0 44 92.2 222.1 0 0 0 0 0 0 0 1 0 0 0 45 128.8 221.6 0 0 0 0 0 0 0 0 1 0 0 46 134.9 227.3 0 0 0 0 0 0 0 0 0 1 0 47 128.2 221.0 0 0 0 0 0 0 0 0 0 0 1 48 114.8 213.6 0 0 0 0 0 0 0 0 0 0 0 49 117.9 243.4 1 0 0 0 0 0 0 0 0 0 0 50 119.1 253.8 0 1 0 0 0 0 0 0 0 0 0 51 120.7 265.3 0 0 1 0 0 0 0 0 0 0 0 52 129.1 268.2 0 0 0 1 0 0 0 0 0 0 0 53 117.6 268.5 0 0 0 0 1 0 0 0 0 0 0 54 129.2 266.9 0 0 0 0 0 1 0 0 0 0 0 55 100.0 268.4 0 0 0 0 0 0 1 0 0 0 0 56 87.0 250.8 0 0 0 0 0 0 0 1 0 0 0 57 128.0 231.2 0 0 0 0 0 0 0 0 1 0 0 58 127.7 192.0 0 0 0 0 0 0 0 0 0 1 0 59 93.4 171.4 0 0 0 0 0 0 0 0 0 0 1 60 84.1 160.0 0 0 0 0 0 0 0 0 0 0 0 61 71.7 148.1 1 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) IGPic M1 M2 M3 M4 87.40117 0.08747 0.79050 10.23502 28.37396 9.07989 M5 M6 M7 M8 M9 M10 5.89394 34.36153 -17.86985 -13.55024 24.57612 22.38646 M11 13.43381 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -29.4454 -4.7274 0.8202 6.9927 20.0882 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 87.40117 7.24278 12.067 3.81e-16 *** IGPic 0.08747 0.03057 2.861 0.006232 ** M1 0.79050 6.60516 0.120 0.905237 M2 10.23502 6.90284 1.483 0.144683 M3 28.37396 6.91088 4.106 0.000156 *** M4 9.07989 6.92280 1.312 0.195897 M5 5.89394 6.92663 0.851 0.399044 M6 34.36153 6.91524 4.969 8.96e-06 *** M7 -17.86985 6.92368 -2.581 0.012964 * M8 -13.55024 6.91362 -1.960 0.055823 . M9 24.57612 6.90666 3.558 0.000853 *** M10 22.38646 6.90096 3.244 0.002149 ** M11 13.43381 6.89869 1.947 0.057362 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.91 on 48 degrees of freedom Multiple R-squared: 0.7276, Adjusted R-squared: 0.6595 F-statistic: 10.68 on 12 and 48 DF, p-value: 7.285e-10 > 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.04056295 0.08112589 0.9594371 [2,] 0.04573179 0.09146359 0.9542682 [3,] 0.06681798 0.13363596 0.9331820 [4,] 0.02834360 0.05668720 0.9716564 [5,] 0.07534240 0.15068479 0.9246576 [6,] 0.04789303 0.09578607 0.9521070 [7,] 0.26334111 0.52668222 0.7366589 [8,] 0.17984260 0.35968521 0.8201574 [9,] 0.13309911 0.26619821 0.8669009 [10,] 0.10003727 0.20007454 0.8999627 [11,] 0.08004309 0.16008617 0.9199569 [12,] 0.10323604 0.20647208 0.8967640 [13,] 0.23490106 0.46980211 0.7650989 [14,] 0.35641947 0.71283894 0.6435805 [15,] 0.45583925 0.91167851 0.5441607 [16,] 0.37029864 0.74059728 0.6297014 [17,] 0.33580958 0.67161916 0.6641904 [18,] 0.29000365 0.58000729 0.7099964 [19,] 0.23188421 0.46376843 0.7681158 [20,] 0.29587129 0.59174258 0.7041287 [21,] 0.23866851 0.47733703 0.7613315 [22,] 0.28686988 0.57373975 0.7131301 [23,] 0.22627187 0.45254375 0.7737281 [24,] 0.38975404 0.77950808 0.6102460 [25,] 0.33675766 0.67351532 0.6632423 [26,] 0.25595447 0.51190894 0.7440455 [27,] 0.55102082 0.89795835 0.4489792 [28,] 0.59314134 0.81371731 0.4068587 [29,] 0.81322124 0.37355753 0.1867788 [30,] 0.70775349 0.58449302 0.2922465 > postscript(file="/var/www/html/rcomp/tmp/1ktnq1259004889.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/2cvf81259004889.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/3npwv1259004889.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/4lwbq1259004889.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/57d6g1259004889.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 -5.5450538 -11.4968781 -0.1369862 4.0232665 -7.6971841 0.3914902 7 8 9 10 11 12 -8.4745152 10.7883881 0.8920489 6.3193164 -1.9516667 5.4783603 13 14 15 16 17 18 11.8694630 4.7800373 10.4262231 9.5127157 -8.2628295 20.0882435 19 20 21 22 23 24 -0.2590964 2.2139961 2.7864576 -17.6763559 0.8488738 5.2229041 25 26 27 28 29 30 1.6577399 8.8933818 10.4494866 -13.8809736 15.4305858 -4.7273581 31 32 33 34 35 36 -6.1181609 -3.1377643 3.0807749 5.0068702 15.4944985 -2.1215522 37 38 39 40 41 42 13.0442127 -1.4414258 -2.4588110 -8.8155110 -0.2907860 0.1550573 43 44 45 46 47 48 7.8590248 -1.0771697 -2.5598029 5.2313059 8.0349849 8.7160492 49 50 51 52 53 54 8.4190537 -0.7351152 -18.2799125 9.1605024 0.8202139 -15.9074328 55 56 57 58 59 60 6.9927476 -8.7874503 -4.1994786 1.1188635 -22.4266905 -17.2957614 61 -29.4454154 > postscript(file="/var/www/html/rcomp/tmp/6b9s01259004889.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 -5.5450538 NA 1 -11.4968781 -5.5450538 2 -0.1369862 -11.4968781 3 4.0232665 -0.1369862 4 -7.6971841 4.0232665 5 0.3914902 -7.6971841 6 -8.4745152 0.3914902 7 10.7883881 -8.4745152 8 0.8920489 10.7883881 9 6.3193164 0.8920489 10 -1.9516667 6.3193164 11 5.4783603 -1.9516667 12 11.8694630 5.4783603 13 4.7800373 11.8694630 14 10.4262231 4.7800373 15 9.5127157 10.4262231 16 -8.2628295 9.5127157 17 20.0882435 -8.2628295 18 -0.2590964 20.0882435 19 2.2139961 -0.2590964 20 2.7864576 2.2139961 21 -17.6763559 2.7864576 22 0.8488738 -17.6763559 23 5.2229041 0.8488738 24 1.6577399 5.2229041 25 8.8933818 1.6577399 26 10.4494866 8.8933818 27 -13.8809736 10.4494866 28 15.4305858 -13.8809736 29 -4.7273581 15.4305858 30 -6.1181609 -4.7273581 31 -3.1377643 -6.1181609 32 3.0807749 -3.1377643 33 5.0068702 3.0807749 34 15.4944985 5.0068702 35 -2.1215522 15.4944985 36 13.0442127 -2.1215522 37 -1.4414258 13.0442127 38 -2.4588110 -1.4414258 39 -8.8155110 -2.4588110 40 -0.2907860 -8.8155110 41 0.1550573 -0.2907860 42 7.8590248 0.1550573 43 -1.0771697 7.8590248 44 -2.5598029 -1.0771697 45 5.2313059 -2.5598029 46 8.0349849 5.2313059 47 8.7160492 8.0349849 48 8.4190537 8.7160492 49 -0.7351152 8.4190537 50 -18.2799125 -0.7351152 51 9.1605024 -18.2799125 52 0.8202139 9.1605024 53 -15.9074328 0.8202139 54 6.9927476 -15.9074328 55 -8.7874503 6.9927476 56 -4.1994786 -8.7874503 57 1.1188635 -4.1994786 58 -22.4266905 1.1188635 59 -17.2957614 -22.4266905 60 -29.4454154 -17.2957614 61 NA -29.4454154 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -11.4968781 -5.5450538 [2,] -0.1369862 -11.4968781 [3,] 4.0232665 -0.1369862 [4,] -7.6971841 4.0232665 [5,] 0.3914902 -7.6971841 [6,] -8.4745152 0.3914902 [7,] 10.7883881 -8.4745152 [8,] 0.8920489 10.7883881 [9,] 6.3193164 0.8920489 [10,] -1.9516667 6.3193164 [11,] 5.4783603 -1.9516667 [12,] 11.8694630 5.4783603 [13,] 4.7800373 11.8694630 [14,] 10.4262231 4.7800373 [15,] 9.5127157 10.4262231 [16,] -8.2628295 9.5127157 [17,] 20.0882435 -8.2628295 [18,] -0.2590964 20.0882435 [19,] 2.2139961 -0.2590964 [20,] 2.7864576 2.2139961 [21,] -17.6763559 2.7864576 [22,] 0.8488738 -17.6763559 [23,] 5.2229041 0.8488738 [24,] 1.6577399 5.2229041 [25,] 8.8933818 1.6577399 [26,] 10.4494866 8.8933818 [27,] -13.8809736 10.4494866 [28,] 15.4305858 -13.8809736 [29,] -4.7273581 15.4305858 [30,] -6.1181609 -4.7273581 [31,] -3.1377643 -6.1181609 [32,] 3.0807749 -3.1377643 [33,] 5.0068702 3.0807749 [34,] 15.4944985 5.0068702 [35,] -2.1215522 15.4944985 [36,] 13.0442127 -2.1215522 [37,] -1.4414258 13.0442127 [38,] -2.4588110 -1.4414258 [39,] -8.8155110 -2.4588110 [40,] -0.2907860 -8.8155110 [41,] 0.1550573 -0.2907860 [42,] 7.8590248 0.1550573 [43,] -1.0771697 7.8590248 [44,] -2.5598029 -1.0771697 [45,] 5.2313059 -2.5598029 [46,] 8.0349849 5.2313059 [47,] 8.7160492 8.0349849 [48,] 8.4190537 8.7160492 [49,] -0.7351152 8.4190537 [50,] -18.2799125 -0.7351152 [51,] 9.1605024 -18.2799125 [52,] 0.8202139 9.1605024 [53,] -15.9074328 0.8202139 [54,] 6.9927476 -15.9074328 [55,] -8.7874503 6.9927476 [56,] -4.1994786 -8.7874503 [57,] 1.1188635 -4.1994786 [58,] -22.4266905 1.1188635 [59,] -17.2957614 -22.4266905 [60,] -29.4454154 -17.2957614 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -11.4968781 -5.5450538 2 -0.1369862 -11.4968781 3 4.0232665 -0.1369862 4 -7.6971841 4.0232665 5 0.3914902 -7.6971841 6 -8.4745152 0.3914902 7 10.7883881 -8.4745152 8 0.8920489 10.7883881 9 6.3193164 0.8920489 10 -1.9516667 6.3193164 11 5.4783603 -1.9516667 12 11.8694630 5.4783603 13 4.7800373 11.8694630 14 10.4262231 4.7800373 15 9.5127157 10.4262231 16 -8.2628295 9.5127157 17 20.0882435 -8.2628295 18 -0.2590964 20.0882435 19 2.2139961 -0.2590964 20 2.7864576 2.2139961 21 -17.6763559 2.7864576 22 0.8488738 -17.6763559 23 5.2229041 0.8488738 24 1.6577399 5.2229041 25 8.8933818 1.6577399 26 10.4494866 8.8933818 27 -13.8809736 10.4494866 28 15.4305858 -13.8809736 29 -4.7273581 15.4305858 30 -6.1181609 -4.7273581 31 -3.1377643 -6.1181609 32 3.0807749 -3.1377643 33 5.0068702 3.0807749 34 15.4944985 5.0068702 35 -2.1215522 15.4944985 36 13.0442127 -2.1215522 37 -1.4414258 13.0442127 38 -2.4588110 -1.4414258 39 -8.8155110 -2.4588110 40 -0.2907860 -8.8155110 41 0.1550573 -0.2907860 42 7.8590248 0.1550573 43 -1.0771697 7.8590248 44 -2.5598029 -1.0771697 45 5.2313059 -2.5598029 46 8.0349849 5.2313059 47 8.7160492 8.0349849 48 8.4190537 8.7160492 49 -0.7351152 8.4190537 50 -18.2799125 -0.7351152 51 9.1605024 -18.2799125 52 0.8202139 9.1605024 53 -15.9074328 0.8202139 54 6.9927476 -15.9074328 55 -8.7874503 6.9927476 56 -4.1994786 -8.7874503 57 1.1188635 -4.1994786 58 -22.4266905 1.1188635 59 -17.2957614 -22.4266905 60 -29.4454154 -17.2957614 > 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/7nre91259004889.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/8qc5j1259004889.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/9qjgc1259004889.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/10jyrs1259004889.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/11jgbt1259004889.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/12wu6v1259004889.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/13wamw1259004889.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/14wew31259004889.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/15afgq1259004889.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/165o6h1259004889.tab") + } > > system("convert tmp/1ktnq1259004889.ps tmp/1ktnq1259004889.png") > system("convert tmp/2cvf81259004889.ps tmp/2cvf81259004889.png") > system("convert tmp/3npwv1259004889.ps tmp/3npwv1259004889.png") > system("convert tmp/4lwbq1259004889.ps tmp/4lwbq1259004889.png") > system("convert tmp/57d6g1259004889.ps tmp/57d6g1259004889.png") > system("convert tmp/6b9s01259004889.ps tmp/6b9s01259004889.png") > system("convert tmp/7nre91259004889.ps tmp/7nre91259004889.png") > system("convert tmp/8qc5j1259004889.ps tmp/8qc5j1259004889.png") > system("convert tmp/9qjgc1259004889.ps tmp/9qjgc1259004889.png") > system("convert tmp/10jyrs1259004889.ps tmp/10jyrs1259004889.png") > > > proc.time() user system elapsed 2.479 1.579 3.360