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(124,104.89,118.63,105.15,121.86,105.24,119.97,105.57,125.03,105.62,130.09,106.17,126.65,106.27,121.7,106.41,119.24,106.94,122.63,107.16,116.66,107.32,114.12,107.32,113.11,107.35,112.61,107.55,113.4,107.87,115.18,108.37,121.01,108.38,119.44,107.92,116.68,108.03,117.07,108.14,117.41,108.3,119.58,108.64,120.92,108.66,117.09,109.04,116.77,109.03,119.39,109.03,122.49,109.54,124.08,109.75,118.29,109.83,112.94,109.65,113.79,109.82,114.43,109.95,118.7,110.12,120.36,110.15,118.27,110.21,118.34,109.99,117.82,110.14,117.65,110.14,118.18,110.81,121.02,110.97,124.78,110.99,131.16,109.73,130.14,109.81,131.75,110.02,134.73,110.18,135.35,110.21,140.32,110.25,136.35,110.36,131.6,110.51,128.9,110.6,133.89,110.95,138.25,111.18,146.23,111.19,144.76,111.69,149.3,111.7,156.8,111.83,159.08,111.77,165.12,111.73,163.14,112.01,153.43,111.86,151.01,112.04),dim=c(2,61),dimnames=list(c('AKB','AKW'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('AKB','AKW'),1:61)) > 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 = '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 AKB AKW 1 124.00 104.89 2 118.63 105.15 3 121.86 105.24 4 119.97 105.57 5 125.03 105.62 6 130.09 106.17 7 126.65 106.27 8 121.70 106.41 9 119.24 106.94 10 122.63 107.16 11 116.66 107.32 12 114.12 107.32 13 113.11 107.35 14 112.61 107.55 15 113.40 107.87 16 115.18 108.37 17 121.01 108.38 18 119.44 107.92 19 116.68 108.03 20 117.07 108.14 21 117.41 108.30 22 119.58 108.64 23 120.92 108.66 24 117.09 109.04 25 116.77 109.03 26 119.39 109.03 27 122.49 109.54 28 124.08 109.75 29 118.29 109.83 30 112.94 109.65 31 113.79 109.82 32 114.43 109.95 33 118.70 110.12 34 120.36 110.15 35 118.27 110.21 36 118.34 109.99 37 117.82 110.14 38 117.65 110.14 39 118.18 110.81 40 121.02 110.97 41 124.78 110.99 42 131.16 109.73 43 130.14 109.81 44 131.75 110.02 45 134.73 110.18 46 135.35 110.21 47 140.32 110.25 48 136.35 110.36 49 131.60 110.51 50 128.90 110.60 51 133.89 110.95 52 138.25 111.18 53 146.23 111.19 54 144.76 111.69 55 149.30 111.70 56 156.80 111.83 57 159.08 111.77 58 165.12 111.73 59 163.14 112.01 60 153.43 111.86 61 151.01 112.04 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) AKW -324.264 4.131 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -15.791 -8.263 -2.445 8.095 27.796 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -324.2637 80.0443 -4.051 0.000151 *** AKW 4.1313 0.7328 5.638 5.12e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 11 on 59 degrees of freedom Multiple R-squared: 0.3501, Adjusted R-squared: 0.3391 F-statistic: 31.78 on 1 and 59 DF, p-value: 5.119e-07 > 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,] 3.233398e-02 6.466796e-02 0.9676660 [2,] 2.369546e-02 4.739092e-02 0.9763045 [3,] 8.895680e-03 1.779136e-02 0.9911043 [4,] 9.810271e-03 1.962054e-02 0.9901897 [5,] 1.202303e-02 2.404605e-02 0.9879770 [6,] 5.788725e-03 1.157745e-02 0.9942113 [7,] 5.931981e-03 1.186396e-02 0.9940680 [8,] 6.752332e-03 1.350466e-02 0.9932477 [9,] 6.382781e-03 1.276556e-02 0.9936172 [10,] 4.622555e-03 9.245110e-03 0.9953774 [11,] 2.334588e-03 4.669175e-03 0.9976654 [12,] 1.057447e-03 2.114895e-03 0.9989426 [13,] 1.213122e-03 2.426244e-03 0.9987869 [14,] 8.447060e-04 1.689412e-03 0.9991553 [15,] 4.658827e-04 9.317653e-04 0.9995341 [16,] 2.715095e-04 5.430191e-04 0.9997285 [17,] 1.675188e-04 3.350377e-04 0.9998325 [18,] 1.433485e-04 2.866971e-04 0.9998567 [19,] 1.846622e-04 3.693243e-04 0.9998153 [20,] 9.377798e-05 1.875560e-04 0.9999062 [21,] 4.733261e-05 9.466523e-05 0.9999527 [22,] 3.864916e-05 7.729831e-05 0.9999614 [23,] 5.347639e-05 1.069528e-04 0.9999465 [24,] 8.420977e-05 1.684195e-04 0.9999158 [25,] 3.757475e-05 7.514950e-05 0.9999624 [26,] 2.555948e-05 5.111896e-05 0.9999744 [27,] 1.503789e-05 3.007578e-05 0.9999850 [28,] 8.862790e-06 1.772558e-05 0.9999911 [29,] 5.139180e-06 1.027836e-05 0.9999949 [30,] 3.460758e-06 6.921516e-06 0.9999965 [31,] 2.314191e-06 4.628382e-06 0.9999977 [32,] 1.210555e-06 2.421110e-06 0.9999988 [33,] 8.732106e-07 1.746421e-06 0.9999991 [34,] 7.645527e-07 1.529105e-06 0.9999992 [35,] 7.127263e-06 1.425453e-05 0.9999929 [36,] 2.156043e-04 4.312085e-04 0.9997844 [37,] 8.233963e-03 1.646793e-02 0.9917660 [38,] 2.989470e-02 5.978940e-02 0.9701053 [39,] 5.006324e-02 1.001265e-01 0.9499368 [40,] 7.860390e-02 1.572078e-01 0.9213961 [41,] 1.373692e-01 2.747383e-01 0.8626308 [42,] 2.021628e-01 4.043255e-01 0.7978372 [43,] 4.930146e-01 9.860293e-01 0.5069854 [44,] 6.339958e-01 7.320084e-01 0.3660042 [45,] 5.927212e-01 8.145576e-01 0.4072788 [46,] 5.009180e-01 9.981640e-01 0.4990820 [47,] 4.498769e-01 8.997539e-01 0.5501231 [48,] 4.674683e-01 9.349365e-01 0.5325317 [49,] 4.518675e-01 9.037350e-01 0.5481325 [50,] 6.153506e-01 7.692989e-01 0.3846494 [51,] 7.688817e-01 4.622366e-01 0.2311183 [52,] 6.880002e-01 6.239996e-01 0.3119998 > postscript(file="/var/www/html/rcomp/tmp/1s8751258912357.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/2enj21258912357.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/3lmyk1258912357.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/4t83l1258912357.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/532eg1258912357.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 = 61 Frequency = 1 1 2 3 4 5 6 14.9340285 8.4898964 11.3480814 8.0947598 12.9481960 15.7359934 7 8 9 10 11 12 11.8828656 6.3544868 1.7049097 4.1860287 -2.4449757 -4.9849757 13 14 15 16 17 18 -6.1189140 -7.4451695 -7.9771783 -8.2628170 -2.4741298 -2.1437422 19 20 21 22 23 24 -5.3581827 -5.4226232 -5.7436276 -4.9782619 -3.7208875 -9.1207729 25 26 27 28 29 30 -9.3994601 -6.7794601 -5.7864116 -5.0639799 -11.1844821 -15.7908521 31 32 33 34 35 36 -15.6431693 -15.5402354 -11.9725525 -10.4364909 -12.7743675 -11.7954865 37 38 39 40 41 42 -12.9351781 -13.1051781 -15.3431340 -13.1641384 -9.4867639 2.0986457 43 44 45 46 47 48 0.7481435 1.4905752 3.8095708 4.3056325 9.1103814 4.6859409 49 50 51 52 53 54 -0.6837507 -3.7555657 -0.2115128 3.1982934 11.1369806 7.6013419 55 56 57 58 59 60 12.1000291 19.0629630 21.5908397 27.7960908 24.6593331 15.5690247 61 12.4053948 > postscript(file="/var/www/html/rcomp/tmp/62q0u1258912357.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 14.9340285 NA 1 8.4898964 14.9340285 2 11.3480814 8.4898964 3 8.0947598 11.3480814 4 12.9481960 8.0947598 5 15.7359934 12.9481960 6 11.8828656 15.7359934 7 6.3544868 11.8828656 8 1.7049097 6.3544868 9 4.1860287 1.7049097 10 -2.4449757 4.1860287 11 -4.9849757 -2.4449757 12 -6.1189140 -4.9849757 13 -7.4451695 -6.1189140 14 -7.9771783 -7.4451695 15 -8.2628170 -7.9771783 16 -2.4741298 -8.2628170 17 -2.1437422 -2.4741298 18 -5.3581827 -2.1437422 19 -5.4226232 -5.3581827 20 -5.7436276 -5.4226232 21 -4.9782619 -5.7436276 22 -3.7208875 -4.9782619 23 -9.1207729 -3.7208875 24 -9.3994601 -9.1207729 25 -6.7794601 -9.3994601 26 -5.7864116 -6.7794601 27 -5.0639799 -5.7864116 28 -11.1844821 -5.0639799 29 -15.7908521 -11.1844821 30 -15.6431693 -15.7908521 31 -15.5402354 -15.6431693 32 -11.9725525 -15.5402354 33 -10.4364909 -11.9725525 34 -12.7743675 -10.4364909 35 -11.7954865 -12.7743675 36 -12.9351781 -11.7954865 37 -13.1051781 -12.9351781 38 -15.3431340 -13.1051781 39 -13.1641384 -15.3431340 40 -9.4867639 -13.1641384 41 2.0986457 -9.4867639 42 0.7481435 2.0986457 43 1.4905752 0.7481435 44 3.8095708 1.4905752 45 4.3056325 3.8095708 46 9.1103814 4.3056325 47 4.6859409 9.1103814 48 -0.6837507 4.6859409 49 -3.7555657 -0.6837507 50 -0.2115128 -3.7555657 51 3.1982934 -0.2115128 52 11.1369806 3.1982934 53 7.6013419 11.1369806 54 12.1000291 7.6013419 55 19.0629630 12.1000291 56 21.5908397 19.0629630 57 27.7960908 21.5908397 58 24.6593331 27.7960908 59 15.5690247 24.6593331 60 12.4053948 15.5690247 61 NA 12.4053948 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 8.4898964 14.9340285 [2,] 11.3480814 8.4898964 [3,] 8.0947598 11.3480814 [4,] 12.9481960 8.0947598 [5,] 15.7359934 12.9481960 [6,] 11.8828656 15.7359934 [7,] 6.3544868 11.8828656 [8,] 1.7049097 6.3544868 [9,] 4.1860287 1.7049097 [10,] -2.4449757 4.1860287 [11,] -4.9849757 -2.4449757 [12,] -6.1189140 -4.9849757 [13,] -7.4451695 -6.1189140 [14,] -7.9771783 -7.4451695 [15,] -8.2628170 -7.9771783 [16,] -2.4741298 -8.2628170 [17,] -2.1437422 -2.4741298 [18,] -5.3581827 -2.1437422 [19,] -5.4226232 -5.3581827 [20,] -5.7436276 -5.4226232 [21,] -4.9782619 -5.7436276 [22,] -3.7208875 -4.9782619 [23,] -9.1207729 -3.7208875 [24,] -9.3994601 -9.1207729 [25,] -6.7794601 -9.3994601 [26,] -5.7864116 -6.7794601 [27,] -5.0639799 -5.7864116 [28,] -11.1844821 -5.0639799 [29,] -15.7908521 -11.1844821 [30,] -15.6431693 -15.7908521 [31,] -15.5402354 -15.6431693 [32,] -11.9725525 -15.5402354 [33,] -10.4364909 -11.9725525 [34,] -12.7743675 -10.4364909 [35,] -11.7954865 -12.7743675 [36,] -12.9351781 -11.7954865 [37,] -13.1051781 -12.9351781 [38,] -15.3431340 -13.1051781 [39,] -13.1641384 -15.3431340 [40,] -9.4867639 -13.1641384 [41,] 2.0986457 -9.4867639 [42,] 0.7481435 2.0986457 [43,] 1.4905752 0.7481435 [44,] 3.8095708 1.4905752 [45,] 4.3056325 3.8095708 [46,] 9.1103814 4.3056325 [47,] 4.6859409 9.1103814 [48,] -0.6837507 4.6859409 [49,] -3.7555657 -0.6837507 [50,] -0.2115128 -3.7555657 [51,] 3.1982934 -0.2115128 [52,] 11.1369806 3.1982934 [53,] 7.6013419 11.1369806 [54,] 12.1000291 7.6013419 [55,] 19.0629630 12.1000291 [56,] 21.5908397 19.0629630 [57,] 27.7960908 21.5908397 [58,] 24.6593331 27.7960908 [59,] 15.5690247 24.6593331 [60,] 12.4053948 15.5690247 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 8.4898964 14.9340285 2 11.3480814 8.4898964 3 8.0947598 11.3480814 4 12.9481960 8.0947598 5 15.7359934 12.9481960 6 11.8828656 15.7359934 7 6.3544868 11.8828656 8 1.7049097 6.3544868 9 4.1860287 1.7049097 10 -2.4449757 4.1860287 11 -4.9849757 -2.4449757 12 -6.1189140 -4.9849757 13 -7.4451695 -6.1189140 14 -7.9771783 -7.4451695 15 -8.2628170 -7.9771783 16 -2.4741298 -8.2628170 17 -2.1437422 -2.4741298 18 -5.3581827 -2.1437422 19 -5.4226232 -5.3581827 20 -5.7436276 -5.4226232 21 -4.9782619 -5.7436276 22 -3.7208875 -4.9782619 23 -9.1207729 -3.7208875 24 -9.3994601 -9.1207729 25 -6.7794601 -9.3994601 26 -5.7864116 -6.7794601 27 -5.0639799 -5.7864116 28 -11.1844821 -5.0639799 29 -15.7908521 -11.1844821 30 -15.6431693 -15.7908521 31 -15.5402354 -15.6431693 32 -11.9725525 -15.5402354 33 -10.4364909 -11.9725525 34 -12.7743675 -10.4364909 35 -11.7954865 -12.7743675 36 -12.9351781 -11.7954865 37 -13.1051781 -12.9351781 38 -15.3431340 -13.1051781 39 -13.1641384 -15.3431340 40 -9.4867639 -13.1641384 41 2.0986457 -9.4867639 42 0.7481435 2.0986457 43 1.4905752 0.7481435 44 3.8095708 1.4905752 45 4.3056325 3.8095708 46 9.1103814 4.3056325 47 4.6859409 9.1103814 48 -0.6837507 4.6859409 49 -3.7555657 -0.6837507 50 -0.2115128 -3.7555657 51 3.1982934 -0.2115128 52 11.1369806 3.1982934 53 7.6013419 11.1369806 54 12.1000291 7.6013419 55 19.0629630 12.1000291 56 21.5908397 19.0629630 57 27.7960908 21.5908397 58 24.6593331 27.7960908 59 15.5690247 24.6593331 60 12.4053948 15.5690247 > 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/7k0de1258912357.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/8ausy1258912357.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/9e8yq1258912357.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/10095y1258912357.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/112dnb1258912358.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/12p5zl1258912358.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/13djhm1258912358.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/1479221258912358.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/154s081258912358.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/16yy651258912358.tab") + } > > system("convert tmp/1s8751258912357.ps tmp/1s8751258912357.png") > system("convert tmp/2enj21258912357.ps tmp/2enj21258912357.png") > system("convert tmp/3lmyk1258912357.ps tmp/3lmyk1258912357.png") > system("convert tmp/4t83l1258912357.ps tmp/4t83l1258912357.png") > system("convert tmp/532eg1258912357.ps tmp/532eg1258912357.png") > system("convert tmp/62q0u1258912357.ps tmp/62q0u1258912357.png") > system("convert tmp/7k0de1258912357.ps tmp/7k0de1258912357.png") > system("convert tmp/8ausy1258912357.ps tmp/8ausy1258912357.png") > system("convert tmp/9e8yq1258912357.ps tmp/9e8yq1258912357.png") > system("convert tmp/10095y1258912357.ps tmp/10095y1258912357.png") > > > proc.time() user system elapsed 2.430 1.509 3.333