R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(99.4,0,97.5,0,94.6,0,92.6,0,92.5,0,89.8,0,88.8,0,87.4,0,85.2,0,83.1,0,84.7,0,84.8,0,85.8,0,86.3,0,89,0,89,0,89.3,0,91.9,0,94.9,0,94.4,0,96.8,0,96.9,0,98,0,97.9,0,100.9,0,103.9,0,103.1,0,102.5,0,104.3,0,102.6,0,101.7,0,102.8,0,105.4,0,110.9,1,113.5,1,116.3,1,124,1,128.8,1,133.5,1,132.6,1,128.4,1,127.3,1,126.7,1,123.3,1,123.2,1,124.4,1,128.2,1,128.7,1,135.7,1,139,1,145.4,1,142.4,1,137.7,1,137,1,137.1,1,139.3,1,139.6,1,140.4,1,142.3,1,148.3,1),dim=c(2,60),dimnames=list(c('Grondstofprijzen','Wet'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Grondstofprijzen','Wet'),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 Grondstofprijzen Wet t 1 99.4 0 1 2 97.5 0 2 3 94.6 0 3 4 92.6 0 4 5 92.5 0 5 6 89.8 0 6 7 88.8 0 7 8 87.4 0 8 9 85.2 0 9 10 83.1 0 10 11 84.7 0 11 12 84.8 0 12 13 85.8 0 13 14 86.3 0 14 15 89.0 0 15 16 89.0 0 16 17 89.3 0 17 18 91.9 0 18 19 94.9 0 19 20 94.4 0 20 21 96.8 0 21 22 96.9 0 22 23 98.0 0 23 24 97.9 0 24 25 100.9 0 25 26 103.9 0 26 27 103.1 0 27 28 102.5 0 28 29 104.3 0 29 30 102.6 0 30 31 101.7 0 31 32 102.8 0 32 33 105.4 0 33 34 110.9 1 34 35 113.5 1 35 36 116.3 1 36 37 124.0 1 37 38 128.8 1 38 39 133.5 1 39 40 132.6 1 40 41 128.4 1 41 42 127.3 1 42 43 126.7 1 43 44 123.3 1 44 45 123.2 1 45 46 124.4 1 46 47 128.2 1 47 48 128.7 1 48 49 135.7 1 49 50 139.0 1 50 51 145.4 1 51 52 142.4 1 52 53 137.7 1 53 54 137.0 1 54 55 137.1 1 55 56 139.3 1 56 57 139.6 1 57 58 140.4 1 58 59 142.3 1 59 60 148.3 1 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Wet t 83.0242 16.9368 0.6738 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -11.9702 -3.6747 -0.4478 2.6193 15.7020 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 83.02417 1.70383 48.728 < 2e-16 *** Wet 16.93680 2.86257 5.917 1.97e-07 *** t 0.67380 0.08223 8.194 3.28e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.595 on 57 degrees of freedom Multiple R-squared: 0.9268, Adjusted R-squared: 0.9242 F-statistic: 360.9 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,] 1.433766e-02 2.867532e-02 0.98566234 [2,] 3.997809e-03 7.995617e-03 0.99600219 [3,] 1.094843e-03 2.189687e-03 0.99890516 [4,] 1.984465e-04 3.968931e-04 0.99980155 [5,] 3.680518e-05 7.361035e-05 0.99996319 [6,] 3.490264e-04 6.980528e-04 0.99965097 [7,] 1.586841e-03 3.173681e-03 0.99841316 [8,] 8.805632e-03 1.761126e-02 0.99119437 [9,] 2.524686e-02 5.049371e-02 0.97475314 [10,] 1.125038e-01 2.250077e-01 0.88749617 [11,] 1.880953e-01 3.761905e-01 0.81190474 [12,] 2.439476e-01 4.878952e-01 0.75605239 [13,] 3.691224e-01 7.382448e-01 0.63087759 [14,] 5.607882e-01 8.784236e-01 0.43921180 [15,] 6.198774e-01 7.602453e-01 0.38012263 [16,] 7.004124e-01 5.991753e-01 0.29958764 [17,] 7.227916e-01 5.544167e-01 0.27720836 [18,] 7.348005e-01 5.303990e-01 0.26519949 [19,] 7.170341e-01 5.659318e-01 0.28296590 [20,] 7.351251e-01 5.297497e-01 0.26487485 [21,] 7.926244e-01 4.147513e-01 0.20737563 [22,] 7.926749e-01 4.146502e-01 0.20732511 [23,] 7.629164e-01 4.741672e-01 0.23708359 [24,] 7.468509e-01 5.062983e-01 0.25314913 [25,] 6.914895e-01 6.170209e-01 0.30851047 [26,] 6.220660e-01 7.558679e-01 0.37793396 [27,] 5.511991e-01 8.976017e-01 0.44880086 [28,] 4.883967e-01 9.767934e-01 0.51160329 [29,] 5.121314e-01 9.757372e-01 0.48786859 [30,] 5.354604e-01 9.290792e-01 0.46453960 [31,] 5.519347e-01 8.961307e-01 0.44806535 [32,] 5.498090e-01 9.003820e-01 0.45019102 [33,] 6.059103e-01 7.881794e-01 0.39408969 [34,] 7.933030e-01 4.133939e-01 0.20669697 [35,] 8.902596e-01 2.194808e-01 0.10974042 [36,] 8.808515e-01 2.382970e-01 0.11914850 [37,] 8.490246e-01 3.019509e-01 0.15097543 [38,] 7.968669e-01 4.062662e-01 0.20313308 [39,] 7.499708e-01 5.000583e-01 0.25002916 [40,] 7.437507e-01 5.124986e-01 0.25624932 [41,] 7.811208e-01 4.377584e-01 0.21887922 [42,] 7.833906e-01 4.332187e-01 0.21660937 [43,] 8.747991e-01 2.504018e-01 0.12520088 [44,] 8.424704e-01 3.150593e-01 0.15752964 [45,] 7.830048e-01 4.339904e-01 0.21699520 [46,] 9.179571e-01 1.640857e-01 0.08204287 [47,] 9.816157e-01 3.676858e-02 0.01838429 [48,] 9.737149e-01 5.257022e-02 0.02628511 [49,] 9.387771e-01 1.224457e-01 0.06122287 > postscript(file="/var/www/html/rcomp/tmp/1yfnn1227470806.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/2emi81227470806.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/3rxjj1227470806.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/48iq51227470806.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/5h4rx1227470806.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 15.7020329 13.1282316 9.5544303 6.8806290 6.1068277 2.7330264 7 8 9 10 11 12 1.0592251 -1.0145762 -3.8883775 -6.6621788 -5.7359801 -6.3097814 13 14 15 16 17 18 -5.9835827 -6.1573840 -4.1311853 -4.8049866 -5.1787879 -3.2525892 19 20 21 22 23 24 -0.9263905 -2.1001918 -0.3739931 -0.9477944 -0.5215957 -1.2953970 25 26 27 28 29 30 1.0308018 3.3570005 1.8831992 0.6093979 1.7355966 -0.6382047 31 32 33 34 35 36 -2.2120060 -1.7858073 0.1403914 -11.9702128 -10.0440141 -7.9178154 37 38 39 40 41 42 -0.8916167 3.2345820 7.2607807 5.6869794 0.8131781 -0.9606232 43 44 45 46 47 48 -2.2344244 -6.3082257 -7.0820270 -6.5558283 -3.4296296 -3.6034309 49 50 51 52 53 54 2.7227678 5.3489665 11.0751652 7.4013639 2.0275626 0.6537613 55 56 57 58 59 60 0.0799600 1.6061587 1.2323574 1.3585561 2.5847548 7.9109535 > postscript(file="/var/www/html/rcomp/tmp/6oktz1227470806.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 15.7020329 NA 1 13.1282316 15.7020329 2 9.5544303 13.1282316 3 6.8806290 9.5544303 4 6.1068277 6.8806290 5 2.7330264 6.1068277 6 1.0592251 2.7330264 7 -1.0145762 1.0592251 8 -3.8883775 -1.0145762 9 -6.6621788 -3.8883775 10 -5.7359801 -6.6621788 11 -6.3097814 -5.7359801 12 -5.9835827 -6.3097814 13 -6.1573840 -5.9835827 14 -4.1311853 -6.1573840 15 -4.8049866 -4.1311853 16 -5.1787879 -4.8049866 17 -3.2525892 -5.1787879 18 -0.9263905 -3.2525892 19 -2.1001918 -0.9263905 20 -0.3739931 -2.1001918 21 -0.9477944 -0.3739931 22 -0.5215957 -0.9477944 23 -1.2953970 -0.5215957 24 1.0308018 -1.2953970 25 3.3570005 1.0308018 26 1.8831992 3.3570005 27 0.6093979 1.8831992 28 1.7355966 0.6093979 29 -0.6382047 1.7355966 30 -2.2120060 -0.6382047 31 -1.7858073 -2.2120060 32 0.1403914 -1.7858073 33 -11.9702128 0.1403914 34 -10.0440141 -11.9702128 35 -7.9178154 -10.0440141 36 -0.8916167 -7.9178154 37 3.2345820 -0.8916167 38 7.2607807 3.2345820 39 5.6869794 7.2607807 40 0.8131781 5.6869794 41 -0.9606232 0.8131781 42 -2.2344244 -0.9606232 43 -6.3082257 -2.2344244 44 -7.0820270 -6.3082257 45 -6.5558283 -7.0820270 46 -3.4296296 -6.5558283 47 -3.6034309 -3.4296296 48 2.7227678 -3.6034309 49 5.3489665 2.7227678 50 11.0751652 5.3489665 51 7.4013639 11.0751652 52 2.0275626 7.4013639 53 0.6537613 2.0275626 54 0.0799600 0.6537613 55 1.6061587 0.0799600 56 1.2323574 1.6061587 57 1.3585561 1.2323574 58 2.5847548 1.3585561 59 7.9109535 2.5847548 60 NA 7.9109535 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 13.1282316 15.7020329 [2,] 9.5544303 13.1282316 [3,] 6.8806290 9.5544303 [4,] 6.1068277 6.8806290 [5,] 2.7330264 6.1068277 [6,] 1.0592251 2.7330264 [7,] -1.0145762 1.0592251 [8,] -3.8883775 -1.0145762 [9,] -6.6621788 -3.8883775 [10,] -5.7359801 -6.6621788 [11,] -6.3097814 -5.7359801 [12,] -5.9835827 -6.3097814 [13,] -6.1573840 -5.9835827 [14,] -4.1311853 -6.1573840 [15,] -4.8049866 -4.1311853 [16,] -5.1787879 -4.8049866 [17,] -3.2525892 -5.1787879 [18,] -0.9263905 -3.2525892 [19,] -2.1001918 -0.9263905 [20,] -0.3739931 -2.1001918 [21,] -0.9477944 -0.3739931 [22,] -0.5215957 -0.9477944 [23,] -1.2953970 -0.5215957 [24,] 1.0308018 -1.2953970 [25,] 3.3570005 1.0308018 [26,] 1.8831992 3.3570005 [27,] 0.6093979 1.8831992 [28,] 1.7355966 0.6093979 [29,] -0.6382047 1.7355966 [30,] -2.2120060 -0.6382047 [31,] -1.7858073 -2.2120060 [32,] 0.1403914 -1.7858073 [33,] -11.9702128 0.1403914 [34,] -10.0440141 -11.9702128 [35,] -7.9178154 -10.0440141 [36,] -0.8916167 -7.9178154 [37,] 3.2345820 -0.8916167 [38,] 7.2607807 3.2345820 [39,] 5.6869794 7.2607807 [40,] 0.8131781 5.6869794 [41,] -0.9606232 0.8131781 [42,] -2.2344244 -0.9606232 [43,] -6.3082257 -2.2344244 [44,] -7.0820270 -6.3082257 [45,] -6.5558283 -7.0820270 [46,] -3.4296296 -6.5558283 [47,] -3.6034309 -3.4296296 [48,] 2.7227678 -3.6034309 [49,] 5.3489665 2.7227678 [50,] 11.0751652 5.3489665 [51,] 7.4013639 11.0751652 [52,] 2.0275626 7.4013639 [53,] 0.6537613 2.0275626 [54,] 0.0799600 0.6537613 [55,] 1.6061587 0.0799600 [56,] 1.2323574 1.6061587 [57,] 1.3585561 1.2323574 [58,] 2.5847548 1.3585561 [59,] 7.9109535 2.5847548 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 13.1282316 15.7020329 2 9.5544303 13.1282316 3 6.8806290 9.5544303 4 6.1068277 6.8806290 5 2.7330264 6.1068277 6 1.0592251 2.7330264 7 -1.0145762 1.0592251 8 -3.8883775 -1.0145762 9 -6.6621788 -3.8883775 10 -5.7359801 -6.6621788 11 -6.3097814 -5.7359801 12 -5.9835827 -6.3097814 13 -6.1573840 -5.9835827 14 -4.1311853 -6.1573840 15 -4.8049866 -4.1311853 16 -5.1787879 -4.8049866 17 -3.2525892 -5.1787879 18 -0.9263905 -3.2525892 19 -2.1001918 -0.9263905 20 -0.3739931 -2.1001918 21 -0.9477944 -0.3739931 22 -0.5215957 -0.9477944 23 -1.2953970 -0.5215957 24 1.0308018 -1.2953970 25 3.3570005 1.0308018 26 1.8831992 3.3570005 27 0.6093979 1.8831992 28 1.7355966 0.6093979 29 -0.6382047 1.7355966 30 -2.2120060 -0.6382047 31 -1.7858073 -2.2120060 32 0.1403914 -1.7858073 33 -11.9702128 0.1403914 34 -10.0440141 -11.9702128 35 -7.9178154 -10.0440141 36 -0.8916167 -7.9178154 37 3.2345820 -0.8916167 38 7.2607807 3.2345820 39 5.6869794 7.2607807 40 0.8131781 5.6869794 41 -0.9606232 0.8131781 42 -2.2344244 -0.9606232 43 -6.3082257 -2.2344244 44 -7.0820270 -6.3082257 45 -6.5558283 -7.0820270 46 -3.4296296 -6.5558283 47 -3.6034309 -3.4296296 48 2.7227678 -3.6034309 49 5.3489665 2.7227678 50 11.0751652 5.3489665 51 7.4013639 11.0751652 52 2.0275626 7.4013639 53 0.6537613 2.0275626 54 0.0799600 0.6537613 55 1.6061587 0.0799600 56 1.2323574 1.6061587 57 1.3585561 1.2323574 58 2.5847548 1.3585561 59 7.9109535 2.5847548 > 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/7hvq81227470806.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/81vut1227470806.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/9g2p71227470806.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/10hzjj1227470806.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/11jgtz1227470806.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/129oto1227470807.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/13vkj31227470807.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/1488721227470807.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/15nvwz1227470807.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/16rbav1227470807.tab") + } > > system("convert tmp/1yfnn1227470806.ps tmp/1yfnn1227470806.png") > system("convert tmp/2emi81227470806.ps tmp/2emi81227470806.png") > system("convert tmp/3rxjj1227470806.ps tmp/3rxjj1227470806.png") > system("convert tmp/48iq51227470806.ps tmp/48iq51227470806.png") > system("convert tmp/5h4rx1227470806.ps tmp/5h4rx1227470806.png") > system("convert tmp/6oktz1227470806.ps tmp/6oktz1227470806.png") > system("convert tmp/7hvq81227470806.ps tmp/7hvq81227470806.png") > system("convert tmp/81vut1227470806.ps tmp/81vut1227470806.png") > system("convert tmp/9g2p71227470806.ps tmp/9g2p71227470806.png") > system("convert tmp/10hzjj1227470806.ps tmp/10hzjj1227470806.png") > > > proc.time() user system elapsed 6.744 4.484 7.269