R version 2.8.0 (2008-10-20) 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(101.1,103,100.7,102.4,100,102,100,101.8,100.8,101.6,101.9,101.4,102.7,101.3,103.1,101.4,103.5,101.7,103.9,102.4,104.4,103.1,105.2,103.8,106,104.4,107,105,108.2,105.7,109,106.4,109.1,107.1,109.3,107.9,110.1,108.8,110.7,109.6,110.8,110.3,110.7,110.8,110.9,111.2,111.3,111.7,111.6,112.3,111.8,112.8,112.1,113.1,112.3,113.1,112.5,113.1,113,113.2,113.6,113.1,114.4,112.8,114.9,112.5,115.2,112.3,116,112.5,117,112.9,118,113.5,119.4,114.1,121.1,114.6,123.1,114.9,125,115.4,126.3,115.7,127.4,116.1,129,116.5,131,117.1,133.3,117.5,135.9,117.7,138.4,117.7,140.3,117.7,141.7,117.6,143.1,117.5,144.5,117.6,146,117.9,147.7,118.2,149,118.5,149.7,118.7,150.2,118.8,150.5,118.9,150.7,119,150.9,119),dim=c(2,60),dimnames=list(c('Machines','Transportmiddelen'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Machines','Transportmiddelen'),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 = '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 Transportmiddelen Machines t 1 103.0 101.1 1 2 102.4 100.7 2 3 102.0 100.0 3 4 101.8 100.0 4 5 101.6 100.8 5 6 101.4 101.9 6 7 101.3 102.7 7 8 101.4 103.1 8 9 101.7 103.5 9 10 102.4 103.9 10 11 103.1 104.4 11 12 103.8 105.2 12 13 104.4 106.0 13 14 105.0 107.0 14 15 105.7 108.2 15 16 106.4 109.0 16 17 107.1 109.1 17 18 107.9 109.3 18 19 108.8 110.1 19 20 109.6 110.7 20 21 110.3 110.8 21 22 110.8 110.7 22 23 111.2 110.9 23 24 111.7 111.3 24 25 112.3 111.6 25 26 112.8 111.8 26 27 113.1 112.1 27 28 113.1 112.3 28 29 113.1 112.5 29 30 113.2 113.0 30 31 113.1 113.6 31 32 112.8 114.4 32 33 112.5 114.9 33 34 112.3 115.2 34 35 112.5 116.0 35 36 112.9 117.0 36 37 113.5 118.0 37 38 114.1 119.4 38 39 114.6 121.1 39 40 114.9 123.1 40 41 115.4 125.0 41 42 115.7 126.3 42 43 116.1 127.4 43 44 116.5 129.0 44 45 117.1 131.0 45 46 117.5 133.3 46 47 117.7 135.9 47 48 117.7 138.4 48 49 117.7 140.3 49 50 117.6 141.7 50 51 117.5 143.1 51 52 117.6 144.5 52 53 117.9 146.0 53 54 118.2 147.7 54 55 118.5 149.0 55 56 118.7 149.7 56 57 118.8 150.2 57 58 118.9 150.5 58 59 119.0 150.7 59 60 119.0 150.9 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Machines t 117.1732 -0.1698 0.4812 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.22558 -0.98474 0.01052 0.85577 2.51673 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 117.17323 3.15398 37.15 < 2e-16 *** Machines -0.16984 0.03383 -5.02 5.39e-06 *** t 0.48124 0.03162 15.22 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.255 on 57 degrees of freedom Multiple R-squared: 0.9569, Adjusted R-squared: 0.9554 F-statistic: 633.1 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,] 7.919554e-04 1.583911e-03 9.992080e-01 [2,] 5.924439e-05 1.184888e-04 9.999408e-01 [3,] 6.944579e-05 1.388916e-04 9.999306e-01 [4,] 5.001057e-04 1.000211e-03 9.994999e-01 [5,] 9.102769e-03 1.820554e-02 9.908972e-01 [6,] 5.447442e-02 1.089488e-01 9.455256e-01 [7,] 1.424356e-01 2.848711e-01 8.575644e-01 [8,] 2.359382e-01 4.718764e-01 7.640618e-01 [9,] 2.987263e-01 5.974527e-01 7.012737e-01 [10,] 3.307271e-01 6.614543e-01 6.692729e-01 [11,] 3.863972e-01 7.727945e-01 6.136028e-01 [12,] 5.948463e-01 8.103075e-01 4.051537e-01 [13,] 8.732782e-01 2.534436e-01 1.267218e-01 [14,] 9.665937e-01 6.681252e-02 3.340626e-02 [15,] 9.919353e-01 1.612938e-02 8.064689e-03 [16,] 9.988853e-01 2.229405e-03 1.114703e-03 [17,] 9.998747e-01 2.506298e-04 1.253149e-04 [18,] 9.999689e-01 6.212498e-05 3.106249e-05 [19,] 9.999826e-01 3.472024e-05 1.736012e-05 [20,] 9.999819e-01 3.614415e-05 1.807207e-05 [21,] 9.999732e-01 5.357927e-05 2.678964e-05 [22,] 9.999539e-01 9.229438e-05 4.614719e-05 [23,] 9.999095e-01 1.809798e-04 9.048991e-05 [24,] 9.998269e-01 3.461371e-04 1.730685e-04 [25,] 9.997071e-01 5.858537e-04 2.929268e-04 [26,] 9.995259e-01 9.482256e-04 4.741128e-04 [27,] 9.994022e-01 1.195509e-03 5.977547e-04 [28,] 9.996025e-01 7.950824e-04 3.975412e-04 [29,] 9.998966e-01 2.068385e-04 1.034192e-04 [30,] 9.999855e-01 2.891226e-05 1.445613e-05 [31,] 9.999986e-01 2.874414e-06 1.437207e-06 [32,] 9.999997e-01 5.591486e-07 2.795743e-07 [33,] 9.999999e-01 2.392185e-07 1.196093e-07 [34,] 9.999999e-01 1.690621e-07 8.453104e-08 [35,] 1.000000e+00 7.415906e-08 3.707953e-08 [36,] 1.000000e+00 6.023389e-08 3.011694e-08 [37,] 1.000000e+00 3.462362e-08 1.731181e-08 [38,] 1.000000e+00 2.144657e-08 1.072328e-08 [39,] 1.000000e+00 1.069362e-08 5.346808e-09 [40,] 1.000000e+00 4.031621e-08 2.015810e-08 [41,] 9.999999e-01 2.612685e-07 1.306342e-07 [42,] 9.999996e-01 7.095302e-07 3.547651e-07 [43,] 9.999996e-01 8.143825e-07 4.071912e-07 [44,] 9.999999e-01 2.035360e-07 1.017680e-07 [45,] 1.000000e+00 5.374182e-09 2.687091e-09 [46,] 1.000000e+00 1.266555e-09 6.332777e-10 [47,] 1.000000e+00 4.625544e-08 2.312772e-08 [48,] 9.999997e-01 5.955213e-07 2.977606e-07 [49,] 9.999846e-01 3.081565e-05 1.540782e-05 > postscript(file="/var/www/html/freestat/rcomp/tmp/1o33z1229979252.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/freestat/rcomp/tmp/218mq1229979252.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/freestat/rcomp/tmp/34grb1229979252.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/freestat/rcomp/tmp/4aofw1229979252.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/freestat/rcomp/tmp/5u0iq1229979252.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 2.516726139 1.367547581 0.367415927 -0.313825169 -0.859191342 -1.353604420 7 8 9 10 11 12 -1.798970593 -2.112274228 -2.225577863 -1.938881498 -1.635200767 -1.280566941 13 14 15 16 17 18 -1.025933114 -0.737330557 -0.314759269 0.039874557 0.275617826 0.628345461 19 20 21 22 23 24 1.182979287 1.603644383 1.839387652 1.841162191 1.793889825 1.880586190 25 26 27 28 29 30 2.050298190 2.103025824 1.972737824 1.525465459 1.078193093 0.781873823 31 32 33 34 35 36 0.302538919 -0.342827254 -1.039146524 -1.669434524 -1.814800697 -1.726198140 37 38 39 40 41 42 -1.437595583 -1.081055564 -0.773562450 -0.615116239 -0.273654394 -0.234098741 43 44 45 46 47 48 -0.128511818 0.061996931 0.520443142 0.829842448 0.990194851 0.933562888 49 50 51 52 53 54 0.775024733 0.431564752 0.088104771 -0.055355211 0.018169173 0.125662288 55 56 57 58 59 60 0.165217941 0.002867402 -0.293451868 -0.623739868 -0.971012233 -1.418284599 > postscript(file="/var/www/html/freestat/rcomp/tmp/60e6z1229979252.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 2.516726139 NA 1 1.367547581 2.516726139 2 0.367415927 1.367547581 3 -0.313825169 0.367415927 4 -0.859191342 -0.313825169 5 -1.353604420 -0.859191342 6 -1.798970593 -1.353604420 7 -2.112274228 -1.798970593 8 -2.225577863 -2.112274228 9 -1.938881498 -2.225577863 10 -1.635200767 -1.938881498 11 -1.280566941 -1.635200767 12 -1.025933114 -1.280566941 13 -0.737330557 -1.025933114 14 -0.314759269 -0.737330557 15 0.039874557 -0.314759269 16 0.275617826 0.039874557 17 0.628345461 0.275617826 18 1.182979287 0.628345461 19 1.603644383 1.182979287 20 1.839387652 1.603644383 21 1.841162191 1.839387652 22 1.793889825 1.841162191 23 1.880586190 1.793889825 24 2.050298190 1.880586190 25 2.103025824 2.050298190 26 1.972737824 2.103025824 27 1.525465459 1.972737824 28 1.078193093 1.525465459 29 0.781873823 1.078193093 30 0.302538919 0.781873823 31 -0.342827254 0.302538919 32 -1.039146524 -0.342827254 33 -1.669434524 -1.039146524 34 -1.814800697 -1.669434524 35 -1.726198140 -1.814800697 36 -1.437595583 -1.726198140 37 -1.081055564 -1.437595583 38 -0.773562450 -1.081055564 39 -0.615116239 -0.773562450 40 -0.273654394 -0.615116239 41 -0.234098741 -0.273654394 42 -0.128511818 -0.234098741 43 0.061996931 -0.128511818 44 0.520443142 0.061996931 45 0.829842448 0.520443142 46 0.990194851 0.829842448 47 0.933562888 0.990194851 48 0.775024733 0.933562888 49 0.431564752 0.775024733 50 0.088104771 0.431564752 51 -0.055355211 0.088104771 52 0.018169173 -0.055355211 53 0.125662288 0.018169173 54 0.165217941 0.125662288 55 0.002867402 0.165217941 56 -0.293451868 0.002867402 57 -0.623739868 -0.293451868 58 -0.971012233 -0.623739868 59 -1.418284599 -0.971012233 60 NA -1.418284599 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.367547581 2.516726139 [2,] 0.367415927 1.367547581 [3,] -0.313825169 0.367415927 [4,] -0.859191342 -0.313825169 [5,] -1.353604420 -0.859191342 [6,] -1.798970593 -1.353604420 [7,] -2.112274228 -1.798970593 [8,] -2.225577863 -2.112274228 [9,] -1.938881498 -2.225577863 [10,] -1.635200767 -1.938881498 [11,] -1.280566941 -1.635200767 [12,] -1.025933114 -1.280566941 [13,] -0.737330557 -1.025933114 [14,] -0.314759269 -0.737330557 [15,] 0.039874557 -0.314759269 [16,] 0.275617826 0.039874557 [17,] 0.628345461 0.275617826 [18,] 1.182979287 0.628345461 [19,] 1.603644383 1.182979287 [20,] 1.839387652 1.603644383 [21,] 1.841162191 1.839387652 [22,] 1.793889825 1.841162191 [23,] 1.880586190 1.793889825 [24,] 2.050298190 1.880586190 [25,] 2.103025824 2.050298190 [26,] 1.972737824 2.103025824 [27,] 1.525465459 1.972737824 [28,] 1.078193093 1.525465459 [29,] 0.781873823 1.078193093 [30,] 0.302538919 0.781873823 [31,] -0.342827254 0.302538919 [32,] -1.039146524 -0.342827254 [33,] -1.669434524 -1.039146524 [34,] -1.814800697 -1.669434524 [35,] -1.726198140 -1.814800697 [36,] -1.437595583 -1.726198140 [37,] -1.081055564 -1.437595583 [38,] -0.773562450 -1.081055564 [39,] -0.615116239 -0.773562450 [40,] -0.273654394 -0.615116239 [41,] -0.234098741 -0.273654394 [42,] -0.128511818 -0.234098741 [43,] 0.061996931 -0.128511818 [44,] 0.520443142 0.061996931 [45,] 0.829842448 0.520443142 [46,] 0.990194851 0.829842448 [47,] 0.933562888 0.990194851 [48,] 0.775024733 0.933562888 [49,] 0.431564752 0.775024733 [50,] 0.088104771 0.431564752 [51,] -0.055355211 0.088104771 [52,] 0.018169173 -0.055355211 [53,] 0.125662288 0.018169173 [54,] 0.165217941 0.125662288 [55,] 0.002867402 0.165217941 [56,] -0.293451868 0.002867402 [57,] -0.623739868 -0.293451868 [58,] -0.971012233 -0.623739868 [59,] -1.418284599 -0.971012233 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.367547581 2.516726139 2 0.367415927 1.367547581 3 -0.313825169 0.367415927 4 -0.859191342 -0.313825169 5 -1.353604420 -0.859191342 6 -1.798970593 -1.353604420 7 -2.112274228 -1.798970593 8 -2.225577863 -2.112274228 9 -1.938881498 -2.225577863 10 -1.635200767 -1.938881498 11 -1.280566941 -1.635200767 12 -1.025933114 -1.280566941 13 -0.737330557 -1.025933114 14 -0.314759269 -0.737330557 15 0.039874557 -0.314759269 16 0.275617826 0.039874557 17 0.628345461 0.275617826 18 1.182979287 0.628345461 19 1.603644383 1.182979287 20 1.839387652 1.603644383 21 1.841162191 1.839387652 22 1.793889825 1.841162191 23 1.880586190 1.793889825 24 2.050298190 1.880586190 25 2.103025824 2.050298190 26 1.972737824 2.103025824 27 1.525465459 1.972737824 28 1.078193093 1.525465459 29 0.781873823 1.078193093 30 0.302538919 0.781873823 31 -0.342827254 0.302538919 32 -1.039146524 -0.342827254 33 -1.669434524 -1.039146524 34 -1.814800697 -1.669434524 35 -1.726198140 -1.814800697 36 -1.437595583 -1.726198140 37 -1.081055564 -1.437595583 38 -0.773562450 -1.081055564 39 -0.615116239 -0.773562450 40 -0.273654394 -0.615116239 41 -0.234098741 -0.273654394 42 -0.128511818 -0.234098741 43 0.061996931 -0.128511818 44 0.520443142 0.061996931 45 0.829842448 0.520443142 46 0.990194851 0.829842448 47 0.933562888 0.990194851 48 0.775024733 0.933562888 49 0.431564752 0.775024733 50 0.088104771 0.431564752 51 -0.055355211 0.088104771 52 0.018169173 -0.055355211 53 0.125662288 0.018169173 54 0.165217941 0.125662288 55 0.002867402 0.165217941 56 -0.293451868 0.002867402 57 -0.623739868 -0.293451868 58 -0.971012233 -0.623739868 59 -1.418284599 -0.971012233 > 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/freestat/rcomp/tmp/7kgeb1229979252.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/freestat/rcomp/tmp/80udk1229979252.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/freestat/rcomp/tmp/9scb41229979252.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/freestat/rcomp/tmp/10c1di1229979252.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11yg0g1229979252.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/freestat/rcomp/tmp/128i8w1229979252.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/freestat/rcomp/tmp/13zdx11229979252.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/freestat/rcomp/tmp/14u8tr1229979253.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/freestat/rcomp/tmp/15fisi1229979253.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/freestat/rcomp/tmp/16oqa81229979253.tab") + } > > system("convert tmp/1o33z1229979252.ps tmp/1o33z1229979252.png") > system("convert tmp/218mq1229979252.ps tmp/218mq1229979252.png") > system("convert tmp/34grb1229979252.ps tmp/34grb1229979252.png") > system("convert tmp/4aofw1229979252.ps tmp/4aofw1229979252.png") > system("convert tmp/5u0iq1229979252.ps tmp/5u0iq1229979252.png") > system("convert tmp/60e6z1229979252.ps tmp/60e6z1229979252.png") > system("convert tmp/7kgeb1229979252.ps tmp/7kgeb1229979252.png") > system("convert tmp/80udk1229979252.ps tmp/80udk1229979252.png") > system("convert tmp/9scb41229979252.ps tmp/9scb41229979252.png") > system("convert tmp/10c1di1229979252.ps tmp/10c1di1229979252.png") > > > proc.time() user system elapsed 3.606 2.432 4.065