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(0.6348,1.5291,0.634,1.5358,0.62915,1.5355,0.62168,1.5287,0.61328,1.5334,0.6089,1.5225,0.60857,1.5135,0.62672,1.5144,0.62291,1.4913,0.62393,1.4793,0.61838,1.4663,0.62012,1.4749,0.61659,1.4745,0.6116,1.4775,0.61573,1.4678,0.61407,1.4658,0.62823,1.4572,0.64405,1.4721,0.6387,1.4624,0.63633,1.4636,0.63059,1.4649,0.62994,1.465,0.63709,1.4673,0.64217,1.4679,0.65711,1.4621,0.66977,1.4674,0.68255,1.4695,0.68902,1.4964,0.71322,1.5155,0.70224,1.5411,0.70045,1.5476,0.69919,1.54,0.69693,1.5474,0.69763,1.5485,0.69278,1.559,0.70196,1.5544,0.69215,1.5657,0.6769,1.5734,0.67124,1.567,0.66532,1.5547,0.67157,1.54,0.66428,1.5192,0.66576,1.527,0.66942,1.5387,0.6813,1.5431,0.69144,1.5426,0.69862,1.5216,0.695,1.5364,0.69867,1.5469,0.68968,1.5501,0.69233,1.5494,0.68293,1.5475,0.68399,1.5448,0.66895,1.5391,0.68756,1.5578,0.68527,1.5528,0.6776,1.5496,0.68137,1.549,0.67933,1.5449,0.67922,1.5479),dim=c(2,60),dimnames=list(c('Britse_pond','Zwitserse_frank'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Britse_pond','Zwitserse_frank'),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 = '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 Britse_pond Zwitserse_frank M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 0.63480 1.5291 1 0 0 0 0 0 0 0 0 0 0 2 0.63400 1.5358 0 1 0 0 0 0 0 0 0 0 0 3 0.62915 1.5355 0 0 1 0 0 0 0 0 0 0 0 4 0.62168 1.5287 0 0 0 1 0 0 0 0 0 0 0 5 0.61328 1.5334 0 0 0 0 1 0 0 0 0 0 0 6 0.60890 1.5225 0 0 0 0 0 1 0 0 0 0 0 7 0.60857 1.5135 0 0 0 0 0 0 1 0 0 0 0 8 0.62672 1.5144 0 0 0 0 0 0 0 1 0 0 0 9 0.62291 1.4913 0 0 0 0 0 0 0 0 1 0 0 10 0.62393 1.4793 0 0 0 0 0 0 0 0 0 1 0 11 0.61838 1.4663 0 0 0 0 0 0 0 0 0 0 1 12 0.62012 1.4749 0 0 0 0 0 0 0 0 0 0 0 13 0.61659 1.4745 1 0 0 0 0 0 0 0 0 0 0 14 0.61160 1.4775 0 1 0 0 0 0 0 0 0 0 0 15 0.61573 1.4678 0 0 1 0 0 0 0 0 0 0 0 16 0.61407 1.4658 0 0 0 1 0 0 0 0 0 0 0 17 0.62823 1.4572 0 0 0 0 1 0 0 0 0 0 0 18 0.64405 1.4721 0 0 0 0 0 1 0 0 0 0 0 19 0.63870 1.4624 0 0 0 0 0 0 1 0 0 0 0 20 0.63633 1.4636 0 0 0 0 0 0 0 1 0 0 0 21 0.63059 1.4649 0 0 0 0 0 0 0 0 1 0 0 22 0.62994 1.4650 0 0 0 0 0 0 0 0 0 1 0 23 0.63709 1.4673 0 0 0 0 0 0 0 0 0 0 1 24 0.64217 1.4679 0 0 0 0 0 0 0 0 0 0 0 25 0.65711 1.4621 1 0 0 0 0 0 0 0 0 0 0 26 0.66977 1.4674 0 1 0 0 0 0 0 0 0 0 0 27 0.68255 1.4695 0 0 1 0 0 0 0 0 0 0 0 28 0.68902 1.4964 0 0 0 1 0 0 0 0 0 0 0 29 0.71322 1.5155 0 0 0 0 1 0 0 0 0 0 0 30 0.70224 1.5411 0 0 0 0 0 1 0 0 0 0 0 31 0.70045 1.5476 0 0 0 0 0 0 1 0 0 0 0 32 0.69919 1.5400 0 0 0 0 0 0 0 1 0 0 0 33 0.69693 1.5474 0 0 0 0 0 0 0 0 1 0 0 34 0.69763 1.5485 0 0 0 0 0 0 0 0 0 1 0 35 0.69278 1.5590 0 0 0 0 0 0 0 0 0 0 1 36 0.70196 1.5544 0 0 0 0 0 0 0 0 0 0 0 37 0.69215 1.5657 1 0 0 0 0 0 0 0 0 0 0 38 0.67690 1.5734 0 1 0 0 0 0 0 0 0 0 0 39 0.67124 1.5670 0 0 1 0 0 0 0 0 0 0 0 40 0.66532 1.5547 0 0 0 1 0 0 0 0 0 0 0 41 0.67157 1.5400 0 0 0 0 1 0 0 0 0 0 0 42 0.66428 1.5192 0 0 0 0 0 1 0 0 0 0 0 43 0.66576 1.5270 0 0 0 0 0 0 1 0 0 0 0 44 0.66942 1.5387 0 0 0 0 0 0 0 1 0 0 0 45 0.68130 1.5431 0 0 0 0 0 0 0 0 1 0 0 46 0.69144 1.5426 0 0 0 0 0 0 0 0 0 1 0 47 0.69862 1.5216 0 0 0 0 0 0 0 0 0 0 1 48 0.69500 1.5364 0 0 0 0 0 0 0 0 0 0 0 49 0.69867 1.5469 1 0 0 0 0 0 0 0 0 0 0 50 0.68968 1.5501 0 1 0 0 0 0 0 0 0 0 0 51 0.69233 1.5494 0 0 1 0 0 0 0 0 0 0 0 52 0.68293 1.5475 0 0 0 1 0 0 0 0 0 0 0 53 0.68399 1.5448 0 0 0 0 1 0 0 0 0 0 0 54 0.66895 1.5391 0 0 0 0 0 1 0 0 0 0 0 55 0.68756 1.5578 0 0 0 0 0 0 1 0 0 0 0 56 0.68527 1.5528 0 0 0 0 0 0 0 1 0 0 0 57 0.67760 1.5496 0 0 0 0 0 0 0 0 1 0 0 58 0.68137 1.5490 0 0 0 0 0 0 0 0 0 1 0 59 0.67933 1.5449 0 0 0 0 0 0 0 0 0 0 1 60 0.67922 1.5479 0 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) Zwitserse_frank M1 M2 -1.931e-01 5.677e-01 -7.467e-03 -1.388e-02 M3 M4 M5 M6 -1.037e-02 -1.441e-02 -6.703e-03 -1.143e-02 M7 M8 M9 M10 -1.053e-02 -7.487e-03 -7.508e-03 -3.161e-03 M11 8.932e-05 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.0574185 -0.0142636 0.0007732 0.0133627 0.0526835 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.931e-01 1.476e-01 -1.308 0.197 Zwitserse_frank 5.677e-01 9.703e-02 5.851 4.52e-07 *** M1 -7.467e-03 1.702e-02 -0.439 0.663 M2 -1.388e-02 1.703e-02 -0.815 0.419 M3 -1.037e-02 1.702e-02 -0.609 0.545 M4 -1.441e-02 1.702e-02 -0.846 0.402 M5 -6.703e-03 1.702e-02 -0.394 0.696 M6 -1.143e-02 1.702e-02 -0.671 0.505 M7 -1.053e-02 1.703e-02 -0.618 0.539 M8 -7.487e-03 1.703e-02 -0.440 0.662 M9 -7.508e-03 1.702e-02 -0.441 0.661 M10 -3.161e-03 1.702e-02 -0.186 0.853 M11 8.932e-05 1.703e-02 0.005 0.996 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02691 on 47 degrees of freedom Multiple R-squared: 0.4296, Adjusted R-squared: 0.2839 F-statistic: 2.95 on 12 and 47 DF, p-value: 0.003944 > 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.03249482 6.498964e-02 9.675052e-01 [2,] 0.19657592 3.931518e-01 8.034241e-01 [3,] 0.44440975 8.888195e-01 5.555902e-01 [4,] 0.48815956 9.763191e-01 5.118404e-01 [5,] 0.38498680 7.699736e-01 6.150132e-01 [6,] 0.31114542 6.222908e-01 6.888546e-01 [7,] 0.28313073 5.662615e-01 7.168693e-01 [8,] 0.32733494 6.546699e-01 6.726651e-01 [9,] 0.43503044 8.700609e-01 5.649696e-01 [10,] 0.61507719 7.698456e-01 3.849228e-01 [11,] 0.80046104 3.990779e-01 1.995390e-01 [12,] 0.92625787 1.474843e-01 7.374213e-02 [13,] 0.98319540 3.360920e-02 1.680460e-02 [14,] 0.99945036 1.099271e-03 5.496353e-04 [15,] 0.99995787 8.426270e-05 4.213135e-05 [16,] 0.99998717 2.565235e-05 1.282618e-05 [17,] 0.99999208 1.583993e-05 7.919967e-06 [18,] 0.99999151 1.697855e-05 8.489275e-06 [19,] 0.99998289 3.421084e-05 1.710542e-05 [20,] 0.99994720 1.056009e-04 5.280047e-05 [21,] 0.99991505 1.698945e-04 8.494727e-05 [22,] 0.99971612 5.677539e-04 2.838769e-04 [23,] 0.99920216 1.595685e-03 7.978424e-04 [24,] 0.99879872 2.402561e-03 1.201280e-03 [25,] 0.99784851 4.302971e-03 2.151486e-03 [26,] 0.99438740 1.122519e-02 5.612597e-03 [27,] 0.98228739 3.542522e-02 1.771261e-02 [28,] 0.98505562 2.988877e-02 1.494438e-02 [29,] 0.99878973 2.420533e-03 1.210267e-03 > postscript(file="/var/www/html/rcomp/tmp/18qt11258651479.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/2fzda1258651479.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/33zth1258651479.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/4sp771258651479.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/5eurl1258651479.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 -0.0326939655 -0.0308828782 -0.0390756838 -0.0386464741 -0.0574184817 6 7 8 9 10 -0.0508845113 -0.0470055210 -0.0324082068 -0.0230829468 -0.0195976174 11 12 13 14 15 -0.0210180336 -0.0240709813 -0.0199072307 -0.0201856322 -0.0140620035 16 17 18 19 20 -0.0105477815 0.0007906975 0.0128778592 0.0121342436 0.0060412461 21 22 23 24 25 -0.0004155146 -0.0054694249 -0.0028757394 0.0019529590 0.0276523208 26 27 28 29 30 0.0437181961 0.0517928967 0.0470304221 0.0526834514 0.0318961614 31 32 33 34 35 0.0255157125 0.0255285257 0.0190887598 0.0148171437 0.0007556420 36 37 38 39 40 0.0126364104 0.0038780035 -0.0093286150 -0.0148684154 -0.0097668240 41 42 43 44 45 -0.0028753398 0.0063689177 0.0025204512 -0.0035034568 0.0058998946 46 47 48 49 50 0.0119766077 0.0278278376 0.0158951141 0.0210708719 0.0166789293 51 52 53 54 55 0.0162132061 0.0119306575 0.0068196725 -0.0002584270 0.0068351137 56 57 58 59 60 0.0043418919 -0.0014901929 -0.0017267092 -0.0046897067 -0.0064135022 > postscript(file="/var/www/html/rcomp/tmp/6k0cg1258651479.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.0326939655 NA 1 -0.0308828782 -0.0326939655 2 -0.0390756838 -0.0308828782 3 -0.0386464741 -0.0390756838 4 -0.0574184817 -0.0386464741 5 -0.0508845113 -0.0574184817 6 -0.0470055210 -0.0508845113 7 -0.0324082068 -0.0470055210 8 -0.0230829468 -0.0324082068 9 -0.0195976174 -0.0230829468 10 -0.0210180336 -0.0195976174 11 -0.0240709813 -0.0210180336 12 -0.0199072307 -0.0240709813 13 -0.0201856322 -0.0199072307 14 -0.0140620035 -0.0201856322 15 -0.0105477815 -0.0140620035 16 0.0007906975 -0.0105477815 17 0.0128778592 0.0007906975 18 0.0121342436 0.0128778592 19 0.0060412461 0.0121342436 20 -0.0004155146 0.0060412461 21 -0.0054694249 -0.0004155146 22 -0.0028757394 -0.0054694249 23 0.0019529590 -0.0028757394 24 0.0276523208 0.0019529590 25 0.0437181961 0.0276523208 26 0.0517928967 0.0437181961 27 0.0470304221 0.0517928967 28 0.0526834514 0.0470304221 29 0.0318961614 0.0526834514 30 0.0255157125 0.0318961614 31 0.0255285257 0.0255157125 32 0.0190887598 0.0255285257 33 0.0148171437 0.0190887598 34 0.0007556420 0.0148171437 35 0.0126364104 0.0007556420 36 0.0038780035 0.0126364104 37 -0.0093286150 0.0038780035 38 -0.0148684154 -0.0093286150 39 -0.0097668240 -0.0148684154 40 -0.0028753398 -0.0097668240 41 0.0063689177 -0.0028753398 42 0.0025204512 0.0063689177 43 -0.0035034568 0.0025204512 44 0.0058998946 -0.0035034568 45 0.0119766077 0.0058998946 46 0.0278278376 0.0119766077 47 0.0158951141 0.0278278376 48 0.0210708719 0.0158951141 49 0.0166789293 0.0210708719 50 0.0162132061 0.0166789293 51 0.0119306575 0.0162132061 52 0.0068196725 0.0119306575 53 -0.0002584270 0.0068196725 54 0.0068351137 -0.0002584270 55 0.0043418919 0.0068351137 56 -0.0014901929 0.0043418919 57 -0.0017267092 -0.0014901929 58 -0.0046897067 -0.0017267092 59 -0.0064135022 -0.0046897067 60 NA -0.0064135022 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.0308828782 -0.0326939655 [2,] -0.0390756838 -0.0308828782 [3,] -0.0386464741 -0.0390756838 [4,] -0.0574184817 -0.0386464741 [5,] -0.0508845113 -0.0574184817 [6,] -0.0470055210 -0.0508845113 [7,] -0.0324082068 -0.0470055210 [8,] -0.0230829468 -0.0324082068 [9,] -0.0195976174 -0.0230829468 [10,] -0.0210180336 -0.0195976174 [11,] -0.0240709813 -0.0210180336 [12,] -0.0199072307 -0.0240709813 [13,] -0.0201856322 -0.0199072307 [14,] -0.0140620035 -0.0201856322 [15,] -0.0105477815 -0.0140620035 [16,] 0.0007906975 -0.0105477815 [17,] 0.0128778592 0.0007906975 [18,] 0.0121342436 0.0128778592 [19,] 0.0060412461 0.0121342436 [20,] -0.0004155146 0.0060412461 [21,] -0.0054694249 -0.0004155146 [22,] -0.0028757394 -0.0054694249 [23,] 0.0019529590 -0.0028757394 [24,] 0.0276523208 0.0019529590 [25,] 0.0437181961 0.0276523208 [26,] 0.0517928967 0.0437181961 [27,] 0.0470304221 0.0517928967 [28,] 0.0526834514 0.0470304221 [29,] 0.0318961614 0.0526834514 [30,] 0.0255157125 0.0318961614 [31,] 0.0255285257 0.0255157125 [32,] 0.0190887598 0.0255285257 [33,] 0.0148171437 0.0190887598 [34,] 0.0007556420 0.0148171437 [35,] 0.0126364104 0.0007556420 [36,] 0.0038780035 0.0126364104 [37,] -0.0093286150 0.0038780035 [38,] -0.0148684154 -0.0093286150 [39,] -0.0097668240 -0.0148684154 [40,] -0.0028753398 -0.0097668240 [41,] 0.0063689177 -0.0028753398 [42,] 0.0025204512 0.0063689177 [43,] -0.0035034568 0.0025204512 [44,] 0.0058998946 -0.0035034568 [45,] 0.0119766077 0.0058998946 [46,] 0.0278278376 0.0119766077 [47,] 0.0158951141 0.0278278376 [48,] 0.0210708719 0.0158951141 [49,] 0.0166789293 0.0210708719 [50,] 0.0162132061 0.0166789293 [51,] 0.0119306575 0.0162132061 [52,] 0.0068196725 0.0119306575 [53,] -0.0002584270 0.0068196725 [54,] 0.0068351137 -0.0002584270 [55,] 0.0043418919 0.0068351137 [56,] -0.0014901929 0.0043418919 [57,] -0.0017267092 -0.0014901929 [58,] -0.0046897067 -0.0017267092 [59,] -0.0064135022 -0.0046897067 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.0308828782 -0.0326939655 2 -0.0390756838 -0.0308828782 3 -0.0386464741 -0.0390756838 4 -0.0574184817 -0.0386464741 5 -0.0508845113 -0.0574184817 6 -0.0470055210 -0.0508845113 7 -0.0324082068 -0.0470055210 8 -0.0230829468 -0.0324082068 9 -0.0195976174 -0.0230829468 10 -0.0210180336 -0.0195976174 11 -0.0240709813 -0.0210180336 12 -0.0199072307 -0.0240709813 13 -0.0201856322 -0.0199072307 14 -0.0140620035 -0.0201856322 15 -0.0105477815 -0.0140620035 16 0.0007906975 -0.0105477815 17 0.0128778592 0.0007906975 18 0.0121342436 0.0128778592 19 0.0060412461 0.0121342436 20 -0.0004155146 0.0060412461 21 -0.0054694249 -0.0004155146 22 -0.0028757394 -0.0054694249 23 0.0019529590 -0.0028757394 24 0.0276523208 0.0019529590 25 0.0437181961 0.0276523208 26 0.0517928967 0.0437181961 27 0.0470304221 0.0517928967 28 0.0526834514 0.0470304221 29 0.0318961614 0.0526834514 30 0.0255157125 0.0318961614 31 0.0255285257 0.0255157125 32 0.0190887598 0.0255285257 33 0.0148171437 0.0190887598 34 0.0007556420 0.0148171437 35 0.0126364104 0.0007556420 36 0.0038780035 0.0126364104 37 -0.0093286150 0.0038780035 38 -0.0148684154 -0.0093286150 39 -0.0097668240 -0.0148684154 40 -0.0028753398 -0.0097668240 41 0.0063689177 -0.0028753398 42 0.0025204512 0.0063689177 43 -0.0035034568 0.0025204512 44 0.0058998946 -0.0035034568 45 0.0119766077 0.0058998946 46 0.0278278376 0.0119766077 47 0.0158951141 0.0278278376 48 0.0210708719 0.0158951141 49 0.0166789293 0.0210708719 50 0.0162132061 0.0166789293 51 0.0119306575 0.0162132061 52 0.0068196725 0.0119306575 53 -0.0002584270 0.0068196725 54 0.0068351137 -0.0002584270 55 0.0043418919 0.0068351137 56 -0.0014901929 0.0043418919 57 -0.0017267092 -0.0014901929 58 -0.0046897067 -0.0017267092 59 -0.0064135022 -0.0046897067 > 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/7au6y1258651479.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/8lyv51258651479.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/96vx81258651479.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/10l1ni1258651479.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/11htzi1258651479.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/12yu7l1258651480.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/13cuo41258651480.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/144i871258651480.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/156u1l1258651480.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/16xazh1258651480.tab") + } > > system("convert tmp/18qt11258651479.ps tmp/18qt11258651479.png") > system("convert tmp/2fzda1258651479.ps tmp/2fzda1258651479.png") > system("convert tmp/33zth1258651479.ps tmp/33zth1258651479.png") > system("convert tmp/4sp771258651479.ps tmp/4sp771258651479.png") > system("convert tmp/5eurl1258651479.ps tmp/5eurl1258651479.png") > system("convert tmp/6k0cg1258651479.ps tmp/6k0cg1258651479.png") > system("convert tmp/7au6y1258651479.ps tmp/7au6y1258651479.png") > system("convert tmp/8lyv51258651479.ps tmp/8lyv51258651479.png") > system("convert tmp/96vx81258651479.ps tmp/96vx81258651479.png") > system("convert tmp/10l1ni1258651479.ps tmp/10l1ni1258651479.png") > > > proc.time() user system elapsed 2.407 1.557 2.803