R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(94.6,116.1,95.9,107.5,104.7,116.7,102.8,112.5,98.1,113,113.9,126.4,80.9,114.1,95.7,112.5,113.2,112.4,105.9,113.1,108.8,116.3,102.3,111.7,99,118.8,100.7,116.5,115.5,125.1,100.7,113.1,109.9,119.6,114.6,114.4,85.4,114,100.5,117.8,114.8,117,116.5,120.9,112.9,115,102,117.3,106,119.4,105.3,114.9,118.8,125.8,106.1,117.6,109.3,117.6,117.2,114.9,92.5,121.9,104.2,117,112.5,106.4,122.4,110.5,113.3,113.6,100,114.2,110.7,125.4,112.8,124.6,109.8,120.2,117.3,120.8,109.1,111.4,115.9,124.1,96,120.2,99.8,125.5,116.8,116,115.7,117,99.4,105.7,94.3,102,91,106.4,93.2,96.9,103.1,107.6,94.1,98.8,91.8,101.1,102.7,105.7,82.6,104.6,89.1,103.2,104.5,101.6,105.1,106.7,95.1,99.5,88.7,101),dim=c(2,60),dimnames=list(c('T.I.P.','I.P.C.N.'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('T.I.P.','I.P.C.N.'),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 = 'Include Monthly 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 > 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 I.P.C.N. T.I.P. M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 116.1 94.6 1 0 0 0 0 0 0 0 0 0 0 1 2 107.5 95.9 0 1 0 0 0 0 0 0 0 0 0 2 3 116.7 104.7 0 0 1 0 0 0 0 0 0 0 0 3 4 112.5 102.8 0 0 0 1 0 0 0 0 0 0 0 4 5 113.0 98.1 0 0 0 0 1 0 0 0 0 0 0 5 6 126.4 113.9 0 0 0 0 0 1 0 0 0 0 0 6 7 114.1 80.9 0 0 0 0 0 0 1 0 0 0 0 7 8 112.5 95.7 0 0 0 0 0 0 0 1 0 0 0 8 9 112.4 113.2 0 0 0 0 0 0 0 0 1 0 0 9 10 113.1 105.9 0 0 0 0 0 0 0 0 0 1 0 10 11 116.3 108.8 0 0 0 0 0 0 0 0 0 0 1 11 12 111.7 102.3 0 0 0 0 0 0 0 0 0 0 0 12 13 118.8 99.0 1 0 0 0 0 0 0 0 0 0 0 13 14 116.5 100.7 0 1 0 0 0 0 0 0 0 0 0 14 15 125.1 115.5 0 0 1 0 0 0 0 0 0 0 0 15 16 113.1 100.7 0 0 0 1 0 0 0 0 0 0 0 16 17 119.6 109.9 0 0 0 0 1 0 0 0 0 0 0 17 18 114.4 114.6 0 0 0 0 0 1 0 0 0 0 0 18 19 114.0 85.4 0 0 0 0 0 0 1 0 0 0 0 19 20 117.8 100.5 0 0 0 0 0 0 0 1 0 0 0 20 21 117.0 114.8 0 0 0 0 0 0 0 0 1 0 0 21 22 120.9 116.5 0 0 0 0 0 0 0 0 0 1 0 22 23 115.0 112.9 0 0 0 0 0 0 0 0 0 0 1 23 24 117.3 102.0 0 0 0 0 0 0 0 0 0 0 0 24 25 119.4 106.0 1 0 0 0 0 0 0 0 0 0 0 25 26 114.9 105.3 0 1 0 0 0 0 0 0 0 0 0 26 27 125.8 118.8 0 0 1 0 0 0 0 0 0 0 0 27 28 117.6 106.1 0 0 0 1 0 0 0 0 0 0 0 28 29 117.6 109.3 0 0 0 0 1 0 0 0 0 0 0 29 30 114.9 117.2 0 0 0 0 0 1 0 0 0 0 0 30 31 121.9 92.5 0 0 0 0 0 0 1 0 0 0 0 31 32 117.0 104.2 0 0 0 0 0 0 0 1 0 0 0 32 33 106.4 112.5 0 0 0 0 0 0 0 0 1 0 0 33 34 110.5 122.4 0 0 0 0 0 0 0 0 0 1 0 34 35 113.6 113.3 0 0 0 0 0 0 0 0 0 0 1 35 36 114.2 100.0 0 0 0 0 0 0 0 0 0 0 0 36 37 125.4 110.7 1 0 0 0 0 0 0 0 0 0 0 37 38 124.6 112.8 0 1 0 0 0 0 0 0 0 0 0 38 39 120.2 109.8 0 0 1 0 0 0 0 0 0 0 0 39 40 120.8 117.3 0 0 0 1 0 0 0 0 0 0 0 40 41 111.4 109.1 0 0 0 0 1 0 0 0 0 0 0 41 42 124.1 115.9 0 0 0 0 0 1 0 0 0 0 0 42 43 120.2 96.0 0 0 0 0 0 0 1 0 0 0 0 43 44 125.5 99.8 0 0 0 0 0 0 0 1 0 0 0 44 45 116.0 116.8 0 0 0 0 0 0 0 0 1 0 0 45 46 117.0 115.7 0 0 0 0 0 0 0 0 0 1 0 46 47 105.7 99.4 0 0 0 0 0 0 0 0 0 0 1 47 48 102.0 94.3 0 0 0 0 0 0 0 0 0 0 0 48 49 106.4 91.0 1 0 0 0 0 0 0 0 0 0 0 49 50 96.9 93.2 0 1 0 0 0 0 0 0 0 0 0 50 51 107.6 103.1 0 0 1 0 0 0 0 0 0 0 0 51 52 98.8 94.1 0 0 0 1 0 0 0 0 0 0 0 52 53 101.1 91.8 0 0 0 0 1 0 0 0 0 0 0 53 54 105.7 102.7 0 0 0 0 0 1 0 0 0 0 0 54 55 104.6 82.6 0 0 0 0 0 0 1 0 0 0 0 55 56 103.2 89.1 0 0 0 0 0 0 0 1 0 0 0 56 57 101.6 104.5 0 0 0 0 0 0 0 0 1 0 0 57 58 106.7 105.1 0 0 0 0 0 0 0 0 0 1 0 58 59 99.5 95.1 0 0 0 0 0 0 0 0 0 0 1 59 60 101.0 88.7 0 0 0 0 0 0 0 0 0 0 0 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) T.I.P. M1 M2 M3 M4 35.3607 0.8025 4.4077 -1.6712 -1.6131 -3.0529 M5 M6 M7 M8 M9 M10 -2.5030 -5.2220 13.1271 5.1571 -10.8794 -8.4088 M11 t -6.1140 -0.1205 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.5876 -2.3758 0.2923 2.3693 10.1887 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 35.36071 8.43955 4.190 0.000125 *** T.I.P. 0.80255 0.08140 9.859 6.38e-13 *** M1 4.40769 2.47930 1.778 0.082048 . M2 -1.67120 2.48515 -0.672 0.504646 M3 -1.61314 2.65794 -0.607 0.546891 M4 -3.05293 2.51327 -1.215 0.230669 M5 -2.50304 2.50343 -1.000 0.322617 M6 -5.22205 2.74159 -1.905 0.063076 . M7 13.12707 2.60007 5.049 7.46e-06 *** M8 5.15710 2.45626 2.100 0.041281 * M9 -10.87936 2.72884 -3.987 0.000237 *** M10 -8.40883 2.75888 -3.048 0.003812 ** M11 -6.11397 2.54605 -2.401 0.020433 * t -0.12047 0.03036 -3.968 0.000252 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.879 on 46 degrees of freedom Multiple R-squared: 0.7907, Adjusted R-squared: 0.7316 F-statistic: 13.37 on 13 and 46 DF, p-value: 1.525e-11 > 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.11791512 0.23583024 0.8820849 [2,] 0.66911990 0.66176020 0.3308801 [3,] 0.53420164 0.93159672 0.4657984 [4,] 0.42609212 0.85218425 0.5739079 [5,] 0.36898804 0.73797608 0.6310120 [6,] 0.28636666 0.57273332 0.7136333 [7,] 0.21954386 0.43908771 0.7804561 [8,] 0.22745523 0.45491046 0.7725448 [9,] 0.18111273 0.36222546 0.8188873 [10,] 0.11998069 0.23996138 0.8800193 [11,] 0.07379944 0.14759888 0.9262006 [12,] 0.06930296 0.13860592 0.9306970 [13,] 0.04676867 0.09353733 0.9532313 [14,] 0.06579192 0.13158384 0.9342081 [15,] 0.07258375 0.14516751 0.9274162 [16,] 0.05430347 0.10860693 0.9456965 [17,] 0.04292491 0.08584982 0.9570751 [18,] 0.45284152 0.90568304 0.5471585 [19,] 0.52008949 0.95982103 0.4799105 [20,] 0.43276117 0.86552234 0.5672388 [21,] 0.35361459 0.70722917 0.6463854 [22,] 0.43191190 0.86382380 0.5680881 [23,] 0.35562174 0.71124347 0.6443783 [24,] 0.24788637 0.49577275 0.7521136 [25,] 0.49875158 0.99750316 0.5012484 [26,] 0.40415173 0.80830346 0.5958483 [27,] 0.27644623 0.55289246 0.7235538 > postscript(file="/var/www/rcomp/tmp/1txk91292669188.ps",horizontal=F,onefile=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/rcomp/tmp/2txk91292669188.ps",horizontal=F,onefile=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/rcomp/tmp/337jb1292669188.ps",horizontal=F,onefile=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/rcomp/tmp/437jb1292669188.ps",horizontal=F,onefile=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/rcomp/tmp/537jb1292669188.ps",horizontal=F,onefile=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.53112001 -2.91282905 -0.71282905 -1.82773061 2.01481436 5.57405448 7 8 9 10 11 12 1.52946333 -3.85779482 -1.84543610 2.36309347 1.06131688 -4.31562448 13 14 15 16 17 18 1.14556107 3.68059317 0.46531061 1.90326656 0.59040692 -5.54208022 19 20 21 22 23 24 -0.73635032 -0.96437260 2.91613682 3.10174255 -2.08347793 2.97078792 25 26 27 28 29 30 -2.42662032 -0.16547519 -0.03744653 3.51516052 0.51758345 -5.68305439 31 32 33 34 35 36 2.91121359 -3.28814858 -4.39235659 -10.58763703 -2.35884849 2.92153038 37 38 39 40 41 42 1.24705661 4.96106988 3.03112559 -0.82771866 -4.07625886 6.00590511 43 44 45 46 47 48 -0.15205297 10.18870691 3.20233918 2.73507677 2.34220438 -3.25830291 49 50 51 52 53 54 -0.49711737 -5.56335881 -2.74616061 -2.76297781 0.95345414 -0.35482498 55 56 57 58 59 60 -3.55227364 -2.07839091 0.11931670 2.38772424 1.03880516 1.68160909 > postscript(file="/var/www/rcomp/tmp/6wy0f1292669188.ps",horizontal=F,onefile=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.53112001 NA 1 -2.91282905 0.53112001 2 -0.71282905 -2.91282905 3 -1.82773061 -0.71282905 4 2.01481436 -1.82773061 5 5.57405448 2.01481436 6 1.52946333 5.57405448 7 -3.85779482 1.52946333 8 -1.84543610 -3.85779482 9 2.36309347 -1.84543610 10 1.06131688 2.36309347 11 -4.31562448 1.06131688 12 1.14556107 -4.31562448 13 3.68059317 1.14556107 14 0.46531061 3.68059317 15 1.90326656 0.46531061 16 0.59040692 1.90326656 17 -5.54208022 0.59040692 18 -0.73635032 -5.54208022 19 -0.96437260 -0.73635032 20 2.91613682 -0.96437260 21 3.10174255 2.91613682 22 -2.08347793 3.10174255 23 2.97078792 -2.08347793 24 -2.42662032 2.97078792 25 -0.16547519 -2.42662032 26 -0.03744653 -0.16547519 27 3.51516052 -0.03744653 28 0.51758345 3.51516052 29 -5.68305439 0.51758345 30 2.91121359 -5.68305439 31 -3.28814858 2.91121359 32 -4.39235659 -3.28814858 33 -10.58763703 -4.39235659 34 -2.35884849 -10.58763703 35 2.92153038 -2.35884849 36 1.24705661 2.92153038 37 4.96106988 1.24705661 38 3.03112559 4.96106988 39 -0.82771866 3.03112559 40 -4.07625886 -0.82771866 41 6.00590511 -4.07625886 42 -0.15205297 6.00590511 43 10.18870691 -0.15205297 44 3.20233918 10.18870691 45 2.73507677 3.20233918 46 2.34220438 2.73507677 47 -3.25830291 2.34220438 48 -0.49711737 -3.25830291 49 -5.56335881 -0.49711737 50 -2.74616061 -5.56335881 51 -2.76297781 -2.74616061 52 0.95345414 -2.76297781 53 -0.35482498 0.95345414 54 -3.55227364 -0.35482498 55 -2.07839091 -3.55227364 56 0.11931670 -2.07839091 57 2.38772424 0.11931670 58 1.03880516 2.38772424 59 1.68160909 1.03880516 60 NA 1.68160909 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.91282905 0.53112001 [2,] -0.71282905 -2.91282905 [3,] -1.82773061 -0.71282905 [4,] 2.01481436 -1.82773061 [5,] 5.57405448 2.01481436 [6,] 1.52946333 5.57405448 [7,] -3.85779482 1.52946333 [8,] -1.84543610 -3.85779482 [9,] 2.36309347 -1.84543610 [10,] 1.06131688 2.36309347 [11,] -4.31562448 1.06131688 [12,] 1.14556107 -4.31562448 [13,] 3.68059317 1.14556107 [14,] 0.46531061 3.68059317 [15,] 1.90326656 0.46531061 [16,] 0.59040692 1.90326656 [17,] -5.54208022 0.59040692 [18,] -0.73635032 -5.54208022 [19,] -0.96437260 -0.73635032 [20,] 2.91613682 -0.96437260 [21,] 3.10174255 2.91613682 [22,] -2.08347793 3.10174255 [23,] 2.97078792 -2.08347793 [24,] -2.42662032 2.97078792 [25,] -0.16547519 -2.42662032 [26,] -0.03744653 -0.16547519 [27,] 3.51516052 -0.03744653 [28,] 0.51758345 3.51516052 [29,] -5.68305439 0.51758345 [30,] 2.91121359 -5.68305439 [31,] -3.28814858 2.91121359 [32,] -4.39235659 -3.28814858 [33,] -10.58763703 -4.39235659 [34,] -2.35884849 -10.58763703 [35,] 2.92153038 -2.35884849 [36,] 1.24705661 2.92153038 [37,] 4.96106988 1.24705661 [38,] 3.03112559 4.96106988 [39,] -0.82771866 3.03112559 [40,] -4.07625886 -0.82771866 [41,] 6.00590511 -4.07625886 [42,] -0.15205297 6.00590511 [43,] 10.18870691 -0.15205297 [44,] 3.20233918 10.18870691 [45,] 2.73507677 3.20233918 [46,] 2.34220438 2.73507677 [47,] -3.25830291 2.34220438 [48,] -0.49711737 -3.25830291 [49,] -5.56335881 -0.49711737 [50,] -2.74616061 -5.56335881 [51,] -2.76297781 -2.74616061 [52,] 0.95345414 -2.76297781 [53,] -0.35482498 0.95345414 [54,] -3.55227364 -0.35482498 [55,] -2.07839091 -3.55227364 [56,] 0.11931670 -2.07839091 [57,] 2.38772424 0.11931670 [58,] 1.03880516 2.38772424 [59,] 1.68160909 1.03880516 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.91282905 0.53112001 2 -0.71282905 -2.91282905 3 -1.82773061 -0.71282905 4 2.01481436 -1.82773061 5 5.57405448 2.01481436 6 1.52946333 5.57405448 7 -3.85779482 1.52946333 8 -1.84543610 -3.85779482 9 2.36309347 -1.84543610 10 1.06131688 2.36309347 11 -4.31562448 1.06131688 12 1.14556107 -4.31562448 13 3.68059317 1.14556107 14 0.46531061 3.68059317 15 1.90326656 0.46531061 16 0.59040692 1.90326656 17 -5.54208022 0.59040692 18 -0.73635032 -5.54208022 19 -0.96437260 -0.73635032 20 2.91613682 -0.96437260 21 3.10174255 2.91613682 22 -2.08347793 3.10174255 23 2.97078792 -2.08347793 24 -2.42662032 2.97078792 25 -0.16547519 -2.42662032 26 -0.03744653 -0.16547519 27 3.51516052 -0.03744653 28 0.51758345 3.51516052 29 -5.68305439 0.51758345 30 2.91121359 -5.68305439 31 -3.28814858 2.91121359 32 -4.39235659 -3.28814858 33 -10.58763703 -4.39235659 34 -2.35884849 -10.58763703 35 2.92153038 -2.35884849 36 1.24705661 2.92153038 37 4.96106988 1.24705661 38 3.03112559 4.96106988 39 -0.82771866 3.03112559 40 -4.07625886 -0.82771866 41 6.00590511 -4.07625886 42 -0.15205297 6.00590511 43 10.18870691 -0.15205297 44 3.20233918 10.18870691 45 2.73507677 3.20233918 46 2.34220438 2.73507677 47 -3.25830291 2.34220438 48 -0.49711737 -3.25830291 49 -5.56335881 -0.49711737 50 -2.74616061 -5.56335881 51 -2.76297781 -2.74616061 52 0.95345414 -2.76297781 53 -0.35482498 0.95345414 54 -3.55227364 -0.35482498 55 -2.07839091 -3.55227364 56 0.11931670 -2.07839091 57 2.38772424 0.11931670 58 1.03880516 2.38772424 59 1.68160909 1.03880516 > 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/rcomp/tmp/77phh1292669188.ps",horizontal=F,onefile=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/rcomp/tmp/87phh1292669188.ps",horizontal=F,onefile=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/rcomp/tmp/97phh1292669188.ps",horizontal=F,onefile=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/rcomp/tmp/10izh21292669188.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/11lhxq1292669188.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/rcomp/tmp/126hwe1292669188.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/rcomp/tmp/1329b51292669188.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/rcomp/tmp/146sat1292669188.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/rcomp/tmp/15raqg1292669188.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/rcomp/tmp/16utpm1292669188.tab") + } > > try(system("convert tmp/1txk91292669188.ps tmp/1txk91292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/2txk91292669188.ps tmp/2txk91292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/337jb1292669188.ps tmp/337jb1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/437jb1292669188.ps tmp/437jb1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/537jb1292669188.ps tmp/537jb1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/6wy0f1292669188.ps tmp/6wy0f1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/77phh1292669188.ps tmp/77phh1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/87phh1292669188.ps tmp/87phh1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/97phh1292669188.ps tmp/97phh1292669188.png",intern=TRUE)) character(0) > try(system("convert tmp/10izh21292669188.ps tmp/10izh21292669188.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.140 1.610 4.731