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(9.9,8.2,9.8,8,9.3,7.5,8.3,6.8,8,6.5,8.5,6.6,10.4,7.6,11.1,8,10.9,8.1,10,7.7,9.2,7.5,9.2,7.6,9.5,7.8,9.6,7.8,9.5,7.8,9.1,7.5,8.9,7.5,9,7.1,10.1,7.5,10.3,7.5,10.2,7.6,9.6,7.7,9.2,7.7,9.3,7.9,9.4,8.1,9.4,8.2,9.2,8.2,9,8.2,9,7.9,9,7.3,9.8,6.9,10,6.6,9.8,6.7,9.3,6.9,9,7,9,7.1,9.1,7.2,9.1,7.1,9.1,6.9,9.2,7,8.8,6.8,8.3,6.4,8.4,6.7,8.1,6.6,7.7,6.4,7.9,6.3,7.9,6.2,8,6.5,7.9,6.8,7.6,6.8,7.1,6.4,6.8,6.1,6.5,5.8,6.9,6.1,8.2,7.2,8.7,7.3,8.3,6.9,7.9,6.1,7.5,5.8,7.8,6.2),dim=c(2,60),dimnames=list(c('WLVrouw','WLMan'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('WLVrouw','WLMan'),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 = 'Do not include Seasonal 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 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 WLMan WLVrouw 1 8.2 9.9 2 8.0 9.8 3 7.5 9.3 4 6.8 8.3 5 6.5 8.0 6 6.6 8.5 7 7.6 10.4 8 8.0 11.1 9 8.1 10.9 10 7.7 10.0 11 7.5 9.2 12 7.6 9.2 13 7.8 9.5 14 7.8 9.6 15 7.8 9.5 16 7.5 9.1 17 7.5 8.9 18 7.1 9.0 19 7.5 10.1 20 7.5 10.3 21 7.6 10.2 22 7.7 9.6 23 7.7 9.2 24 7.9 9.3 25 8.1 9.4 26 8.2 9.4 27 8.2 9.2 28 8.2 9.0 29 7.9 9.0 30 7.3 9.0 31 6.9 9.8 32 6.6 10.0 33 6.7 9.8 34 6.9 9.3 35 7.0 9.0 36 7.1 9.0 37 7.2 9.1 38 7.1 9.1 39 6.9 9.1 40 7.0 9.2 41 6.8 8.8 42 6.4 8.3 43 6.7 8.4 44 6.6 8.1 45 6.4 7.7 46 6.3 7.9 47 6.2 7.9 48 6.5 8.0 49 6.8 7.9 50 6.8 7.6 51 6.4 7.1 52 6.1 6.8 53 5.8 6.5 54 6.1 6.9 55 7.2 8.2 56 7.3 8.7 57 6.9 8.3 58 6.1 7.9 59 5.8 7.5 60 6.2 7.8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) WLVrouw 2.4612 0.5257 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.11847 -0.29705 -0.06187 0.29439 1.00726 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.46122 0.50497 4.874 8.85e-06 *** WLVrouw 0.52572 0.05644 9.315 4.03e-13 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4275 on 58 degrees of freedom Multiple R-squared: 0.5993, Adjusted R-squared: 0.5924 F-statistic: 86.76 on 1 and 58 DF, p-value: 4.028e-13 > 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.009649902 0.019299805 0.990350098 [2,] 0.030743342 0.061486684 0.969256658 [3,] 0.315793841 0.631587682 0.684206159 [4,] 0.325157403 0.650314805 0.674842597 [5,] 0.222110580 0.444221161 0.777889420 [6,] 0.140750102 0.281500203 0.859249898 [7,] 0.099506592 0.199013185 0.900493408 [8,] 0.080158473 0.160316946 0.919841527 [9,] 0.068075402 0.136150805 0.931924598 [10,] 0.050345346 0.100690692 0.949654654 [11,] 0.040080105 0.080160210 0.959919895 [12,] 0.026184277 0.052368555 0.973815723 [13,] 0.019888461 0.039776922 0.980111539 [14,] 0.013249309 0.026498618 0.986750691 [15,] 0.011705572 0.023411143 0.988294428 [16,] 0.012465050 0.024930100 0.987534950 [17,] 0.008530844 0.017061688 0.991469156 [18,] 0.005205515 0.010411029 0.994794485 [19,] 0.004673224 0.009346447 0.995326776 [20,] 0.006977506 0.013955013 0.993022494 [21,] 0.018267727 0.036535454 0.981732273 [22,] 0.060941704 0.121883409 0.939058296 [23,] 0.216471048 0.432942096 0.783528952 [24,] 0.635637128 0.728725744 0.364362872 [25,] 0.861483903 0.277032193 0.138516097 [26,] 0.865893135 0.268213729 0.134106865 [27,] 0.918047101 0.163905798 0.081952899 [28,] 0.989385898 0.021228204 0.010614102 [29,] 0.998046608 0.003906785 0.001953392 [30,] 0.998006080 0.003987840 0.001993920 [31,] 0.996759607 0.006480787 0.003240393 [32,] 0.994569601 0.010860798 0.005430399 [33,] 0.991313372 0.017373255 0.008686628 [34,] 0.985996396 0.028007208 0.014003604 [35,] 0.981013141 0.037973718 0.018986859 [36,] 0.972583706 0.054832589 0.027416294 [37,] 0.962961390 0.074077220 0.037038610 [38,] 0.965287787 0.069424425 0.034712213 [39,] 0.948518809 0.102962382 0.051481191 [40,] 0.922052090 0.155895819 0.077947910 [41,] 0.884530722 0.230938556 0.115469278 [42,] 0.862395795 0.275208409 0.137604205 [43,] 0.867195977 0.265608047 0.132804023 [44,] 0.818589222 0.362821557 0.181410778 [45,] 0.752482650 0.495034701 0.247517350 [46,] 0.734719016 0.530561968 0.265280984 [47,] 0.687863341 0.624273318 0.312136659 [48,] 0.614655927 0.770688147 0.385344073 [49,] 0.551146586 0.897706829 0.448853414 [50,] 0.824095727 0.351808545 0.175904273 [51,] 0.967679830 0.064640341 0.032320170 > postscript(file="/var/www/html/rcomp/tmp/1m1l31258731470.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/2hf721258731470.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/3bppn1258731470.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/4ewu61258731470.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/53p3d1258731470.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 0.53410406 0.38667650 0.14953873 -0.02473683 -0.16701950 -0.32988172 7 8 9 10 11 12 -0.32875816 -0.29676527 -0.09162038 -0.01846838 0.20211117 0.30211117 13 14 15 16 17 18 0.34439384 0.29182139 0.34439384 0.25468361 0.35982850 -0.09274394 19 20 21 22 23 24 -0.27104083 -0.37618572 -0.22361327 0.19182139 0.40211117 0.54953873 25 26 27 28 29 30 0.69696628 0.79696628 0.90211117 1.00725606 0.70725606 0.10725606 31 32 33 34 35 36 -0.71332350 -1.11846838 -0.91332350 -0.45046127 -0.19274394 -0.09274394 37 38 39 40 41 42 -0.04531639 -0.14531639 -0.34531639 -0.29788883 -0.28759905 -0.42473683 43 44 45 46 47 48 -0.17730927 -0.11959194 -0.10930216 -0.31444705 -0.41444705 -0.16701950 49 50 51 52 53 54 0.18555295 0.34327028 0.20613250 0.06384984 -0.07843283 0.01127739 55 56 57 58 59 60 0.42783561 0.26497339 0.07526317 -0.51444705 -0.60415727 -0.36187461 > postscript(file="/var/www/html/rcomp/tmp/6e3z31258731470.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.53410406 NA 1 0.38667650 0.53410406 2 0.14953873 0.38667650 3 -0.02473683 0.14953873 4 -0.16701950 -0.02473683 5 -0.32988172 -0.16701950 6 -0.32875816 -0.32988172 7 -0.29676527 -0.32875816 8 -0.09162038 -0.29676527 9 -0.01846838 -0.09162038 10 0.20211117 -0.01846838 11 0.30211117 0.20211117 12 0.34439384 0.30211117 13 0.29182139 0.34439384 14 0.34439384 0.29182139 15 0.25468361 0.34439384 16 0.35982850 0.25468361 17 -0.09274394 0.35982850 18 -0.27104083 -0.09274394 19 -0.37618572 -0.27104083 20 -0.22361327 -0.37618572 21 0.19182139 -0.22361327 22 0.40211117 0.19182139 23 0.54953873 0.40211117 24 0.69696628 0.54953873 25 0.79696628 0.69696628 26 0.90211117 0.79696628 27 1.00725606 0.90211117 28 0.70725606 1.00725606 29 0.10725606 0.70725606 30 -0.71332350 0.10725606 31 -1.11846838 -0.71332350 32 -0.91332350 -1.11846838 33 -0.45046127 -0.91332350 34 -0.19274394 -0.45046127 35 -0.09274394 -0.19274394 36 -0.04531639 -0.09274394 37 -0.14531639 -0.04531639 38 -0.34531639 -0.14531639 39 -0.29788883 -0.34531639 40 -0.28759905 -0.29788883 41 -0.42473683 -0.28759905 42 -0.17730927 -0.42473683 43 -0.11959194 -0.17730927 44 -0.10930216 -0.11959194 45 -0.31444705 -0.10930216 46 -0.41444705 -0.31444705 47 -0.16701950 -0.41444705 48 0.18555295 -0.16701950 49 0.34327028 0.18555295 50 0.20613250 0.34327028 51 0.06384984 0.20613250 52 -0.07843283 0.06384984 53 0.01127739 -0.07843283 54 0.42783561 0.01127739 55 0.26497339 0.42783561 56 0.07526317 0.26497339 57 -0.51444705 0.07526317 58 -0.60415727 -0.51444705 59 -0.36187461 -0.60415727 60 NA -0.36187461 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.38667650 0.53410406 [2,] 0.14953873 0.38667650 [3,] -0.02473683 0.14953873 [4,] -0.16701950 -0.02473683 [5,] -0.32988172 -0.16701950 [6,] -0.32875816 -0.32988172 [7,] -0.29676527 -0.32875816 [8,] -0.09162038 -0.29676527 [9,] -0.01846838 -0.09162038 [10,] 0.20211117 -0.01846838 [11,] 0.30211117 0.20211117 [12,] 0.34439384 0.30211117 [13,] 0.29182139 0.34439384 [14,] 0.34439384 0.29182139 [15,] 0.25468361 0.34439384 [16,] 0.35982850 0.25468361 [17,] -0.09274394 0.35982850 [18,] -0.27104083 -0.09274394 [19,] -0.37618572 -0.27104083 [20,] -0.22361327 -0.37618572 [21,] 0.19182139 -0.22361327 [22,] 0.40211117 0.19182139 [23,] 0.54953873 0.40211117 [24,] 0.69696628 0.54953873 [25,] 0.79696628 0.69696628 [26,] 0.90211117 0.79696628 [27,] 1.00725606 0.90211117 [28,] 0.70725606 1.00725606 [29,] 0.10725606 0.70725606 [30,] -0.71332350 0.10725606 [31,] -1.11846838 -0.71332350 [32,] -0.91332350 -1.11846838 [33,] -0.45046127 -0.91332350 [34,] -0.19274394 -0.45046127 [35,] -0.09274394 -0.19274394 [36,] -0.04531639 -0.09274394 [37,] -0.14531639 -0.04531639 [38,] -0.34531639 -0.14531639 [39,] -0.29788883 -0.34531639 [40,] -0.28759905 -0.29788883 [41,] -0.42473683 -0.28759905 [42,] -0.17730927 -0.42473683 [43,] -0.11959194 -0.17730927 [44,] -0.10930216 -0.11959194 [45,] -0.31444705 -0.10930216 [46,] -0.41444705 -0.31444705 [47,] -0.16701950 -0.41444705 [48,] 0.18555295 -0.16701950 [49,] 0.34327028 0.18555295 [50,] 0.20613250 0.34327028 [51,] 0.06384984 0.20613250 [52,] -0.07843283 0.06384984 [53,] 0.01127739 -0.07843283 [54,] 0.42783561 0.01127739 [55,] 0.26497339 0.42783561 [56,] 0.07526317 0.26497339 [57,] -0.51444705 0.07526317 [58,] -0.60415727 -0.51444705 [59,] -0.36187461 -0.60415727 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.38667650 0.53410406 2 0.14953873 0.38667650 3 -0.02473683 0.14953873 4 -0.16701950 -0.02473683 5 -0.32988172 -0.16701950 6 -0.32875816 -0.32988172 7 -0.29676527 -0.32875816 8 -0.09162038 -0.29676527 9 -0.01846838 -0.09162038 10 0.20211117 -0.01846838 11 0.30211117 0.20211117 12 0.34439384 0.30211117 13 0.29182139 0.34439384 14 0.34439384 0.29182139 15 0.25468361 0.34439384 16 0.35982850 0.25468361 17 -0.09274394 0.35982850 18 -0.27104083 -0.09274394 19 -0.37618572 -0.27104083 20 -0.22361327 -0.37618572 21 0.19182139 -0.22361327 22 0.40211117 0.19182139 23 0.54953873 0.40211117 24 0.69696628 0.54953873 25 0.79696628 0.69696628 26 0.90211117 0.79696628 27 1.00725606 0.90211117 28 0.70725606 1.00725606 29 0.10725606 0.70725606 30 -0.71332350 0.10725606 31 -1.11846838 -0.71332350 32 -0.91332350 -1.11846838 33 -0.45046127 -0.91332350 34 -0.19274394 -0.45046127 35 -0.09274394 -0.19274394 36 -0.04531639 -0.09274394 37 -0.14531639 -0.04531639 38 -0.34531639 -0.14531639 39 -0.29788883 -0.34531639 40 -0.28759905 -0.29788883 41 -0.42473683 -0.28759905 42 -0.17730927 -0.42473683 43 -0.11959194 -0.17730927 44 -0.10930216 -0.11959194 45 -0.31444705 -0.10930216 46 -0.41444705 -0.31444705 47 -0.16701950 -0.41444705 48 0.18555295 -0.16701950 49 0.34327028 0.18555295 50 0.20613250 0.34327028 51 0.06384984 0.20613250 52 -0.07843283 0.06384984 53 0.01127739 -0.07843283 54 0.42783561 0.01127739 55 0.26497339 0.42783561 56 0.07526317 0.26497339 57 -0.51444705 0.07526317 58 -0.60415727 -0.51444705 59 -0.36187461 -0.60415727 > 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/779la1258731470.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/8t04f1258731470.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/9p0tn1258731470.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/10w4kz1258731470.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/11qldt1258731470.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/12sjrt1258731470.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/131sf11258731470.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/147wq41258731470.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/15wsrw1258731470.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/16iy9o1258731470.tab") + } > > system("convert tmp/1m1l31258731470.ps tmp/1m1l31258731470.png") > system("convert tmp/2hf721258731470.ps tmp/2hf721258731470.png") > system("convert tmp/3bppn1258731470.ps tmp/3bppn1258731470.png") > system("convert tmp/4ewu61258731470.ps tmp/4ewu61258731470.png") > system("convert tmp/53p3d1258731470.ps tmp/53p3d1258731470.png") > system("convert tmp/6e3z31258731470.ps tmp/6e3z31258731470.png") > system("convert tmp/779la1258731470.ps tmp/779la1258731470.png") > system("convert tmp/8t04f1258731470.ps tmp/8t04f1258731470.png") > system("convert tmp/9p0tn1258731470.ps tmp/9p0tn1258731470.png") > system("convert tmp/10w4kz1258731470.ps tmp/10w4kz1258731470.png") > > > proc.time() user system elapsed 2.476 1.578 2.861