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(19,75.8,18,72.6,19,71.9,19,74.8,22,72.9,23,72.9,20,79.9,14,74,14,76,14,69.6,15,77.3,11,75.2,17,75.8,16,77.6,20,76.7,24,77,23,77.9,20,76.7,21,71.9,19,73.4,23,72.5,23,73.7,23,69.5,23,74.7,27,72.5,26,72.1,17,70.7,24,71.4,26,69.5,24,73.5,27,72.4,27,74.5,26,72.2,24,73,23,73.3,23,71.3,24,73.6,17,71.3,21,71.2,19,81.4,22,76.1,22,71.1,18,75.7,16,70,14,68.5,12,56.7,14,57.9,16,58.8,8,59.3,3,61.3,0,62.9,5,61.4,1,64.5,1,63.8,3,61.6,6,64.7),dim=c(2,56),dimnames=list(c('indcvtr','dzcg '),1:56)) > y <- array(NA,dim=c(2,56),dimnames=list(c('indcvtr','dzcg '),1:56)) > 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 = 'Include Monthly 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 dzcg\r indcvtr M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 75.8 19 1 0 0 0 0 0 0 0 0 0 0 1 2 72.6 18 0 1 0 0 0 0 0 0 0 0 0 2 3 71.9 19 0 0 1 0 0 0 0 0 0 0 0 3 4 74.8 19 0 0 0 1 0 0 0 0 0 0 0 4 5 72.9 22 0 0 0 0 1 0 0 0 0 0 0 5 6 72.9 23 0 0 0 0 0 1 0 0 0 0 0 6 7 79.9 20 0 0 0 0 0 0 1 0 0 0 0 7 8 74.0 14 0 0 0 0 0 0 0 1 0 0 0 8 9 76.0 14 0 0 0 0 0 0 0 0 1 0 0 9 10 69.6 14 0 0 0 0 0 0 0 0 0 1 0 10 11 77.3 15 0 0 0 0 0 0 0 0 0 0 1 11 12 75.2 11 0 0 0 0 0 0 0 0 0 0 0 12 13 75.8 17 1 0 0 0 0 0 0 0 0 0 0 13 14 77.6 16 0 1 0 0 0 0 0 0 0 0 0 14 15 76.7 20 0 0 1 0 0 0 0 0 0 0 0 15 16 77.0 24 0 0 0 1 0 0 0 0 0 0 0 16 17 77.9 23 0 0 0 0 1 0 0 0 0 0 0 17 18 76.7 20 0 0 0 0 0 1 0 0 0 0 0 18 19 71.9 21 0 0 0 0 0 0 1 0 0 0 0 19 20 73.4 19 0 0 0 0 0 0 0 1 0 0 0 20 21 72.5 23 0 0 0 0 0 0 0 0 1 0 0 21 22 73.7 23 0 0 0 0 0 0 0 0 0 1 0 22 23 69.5 23 0 0 0 0 0 0 0 0 0 0 1 23 24 74.7 23 0 0 0 0 0 0 0 0 0 0 0 24 25 72.5 27 1 0 0 0 0 0 0 0 0 0 0 25 26 72.1 26 0 1 0 0 0 0 0 0 0 0 0 26 27 70.7 17 0 0 1 0 0 0 0 0 0 0 0 27 28 71.4 24 0 0 0 1 0 0 0 0 0 0 0 28 29 69.5 26 0 0 0 0 1 0 0 0 0 0 0 29 30 73.5 24 0 0 0 0 0 1 0 0 0 0 0 30 31 72.4 27 0 0 0 0 0 0 1 0 0 0 0 31 32 74.5 27 0 0 0 0 0 0 0 1 0 0 0 32 33 72.2 26 0 0 0 0 0 0 0 0 1 0 0 33 34 73.0 24 0 0 0 0 0 0 0 0 0 1 0 34 35 73.3 23 0 0 0 0 0 0 0 0 0 0 1 35 36 71.3 23 0 0 0 0 0 0 0 0 0 0 0 36 37 73.6 24 1 0 0 0 0 0 0 0 0 0 0 37 38 71.3 17 0 1 0 0 0 0 0 0 0 0 0 38 39 71.2 21 0 0 1 0 0 0 0 0 0 0 0 39 40 81.4 19 0 0 0 1 0 0 0 0 0 0 0 40 41 76.1 22 0 0 0 0 1 0 0 0 0 0 0 41 42 71.1 22 0 0 0 0 0 1 0 0 0 0 0 42 43 75.7 18 0 0 0 0 0 0 1 0 0 0 0 43 44 70.0 16 0 0 0 0 0 0 0 1 0 0 0 44 45 68.5 14 0 0 0 0 0 0 0 0 1 0 0 45 46 56.7 12 0 0 0 0 0 0 0 0 0 1 0 46 47 57.9 14 0 0 0 0 0 0 0 0 0 0 1 47 48 58.8 16 0 0 0 0 0 0 0 0 0 0 0 48 49 59.3 8 1 0 0 0 0 0 0 0 0 0 0 49 50 61.3 3 0 1 0 0 0 0 0 0 0 0 0 50 51 62.9 0 0 0 1 0 0 0 0 0 0 0 0 51 52 61.4 5 0 0 0 1 0 0 0 0 0 0 0 52 53 64.5 1 0 0 0 0 1 0 0 0 0 0 0 53 54 63.8 1 0 0 0 0 0 1 0 0 0 0 0 54 55 61.6 3 0 0 0 0 0 0 1 0 0 0 0 55 56 64.7 6 0 0 0 0 0 0 0 1 0 0 0 56 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) indcvtr M1 M2 M3 M4 69.7953 0.3061 0.2734 0.9512 1.0142 2.8565 M5 M6 M7 M8 M9 M10 1.8322 1.6765 2.6171 2.2451 1.4557 -2.1088 M11 t -0.8324 -0.1794 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.28216 -2.46205 0.07895 2.29497 10.10784 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 69.79533 3.06501 22.772 < 2e-16 *** indcvtr 0.30611 0.08601 3.559 0.00094 *** M1 0.27345 2.67611 0.102 0.91910 M2 0.95117 2.68726 0.354 0.72514 M3 1.01423 2.68936 0.377 0.70798 M4 2.85652 2.67197 1.069 0.29114 M5 1.83225 2.67121 0.686 0.49653 M6 1.67653 2.67093 0.628 0.53360 M7 2.61714 2.67113 0.980 0.33280 M8 2.24509 2.67451 0.839 0.40598 M9 1.45571 2.81726 0.517 0.60807 M10 -2.10879 2.81632 -0.749 0.45817 M11 -0.83245 2.81562 -0.296 0.76895 t -0.17939 0.03771 -4.757 2.33e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.981 on 42 degrees of freedom Multiple R-squared: 0.6319, Adjusted R-squared: 0.5179 F-statistic: 5.545 on 13 and 42 DF, p-value: 1.017e-05 > 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.09876638 0.19753275 0.9012336 [2,] 0.03452854 0.06905708 0.9654715 [3,] 0.37509555 0.75019110 0.6249044 [4,] 0.24833998 0.49667997 0.7516600 [5,] 0.15901637 0.31803274 0.8409836 [6,] 0.15259732 0.30519463 0.8474027 [7,] 0.17319139 0.34638278 0.8268086 [8,] 0.14493674 0.28987349 0.8550633 [9,] 0.09727372 0.19454743 0.9027263 [10,] 0.06171025 0.12342051 0.9382897 [11,] 0.05755888 0.11511777 0.9424411 [12,] 0.05553101 0.11106202 0.9444690 [13,] 0.10118253 0.20236506 0.8988175 [14,] 0.07425135 0.14850270 0.9257486 [15,] 0.12668572 0.25337144 0.8733143 [16,] 0.26271648 0.52543297 0.7372835 [17,] 0.38897238 0.77794476 0.6110276 [18,] 0.35209484 0.70418969 0.6479052 [19,] 0.27455164 0.54910327 0.7254484 [20,] 0.18558911 0.37117822 0.8144109 [21,] 0.13019164 0.26038328 0.8698084 [22,] 0.07439077 0.14878154 0.9256092 [23,] 0.03969392 0.07938785 0.9603061 > postscript(file="/var/www/html/rcomp/tmp/1nzgh1260733210.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/248oa1260733210.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/35wwo1260733210.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/43ctx1260733210.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/506hj1260733210.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 = 56 Frequency = 1 1 2 3 4 5 6 0.09454415 -3.29767351 -4.18744764 -2.95034292 -4.56500411 -4.53600000 7 8 9 10 11 12 2.62110472 -0.89079466 2.07797947 -0.57812936 5.71881622 4.19019713 13 14 15 16 17 18 2.85948973 4.46727207 2.45917146 -0.12815914 2.28161499 2.33505441 19 20 21 22 23 24 -3.53227618 -0.86861088 -2.02427207 2.91961910 -2.37732649 2.16961910 25 26 27 28 29 30 -1.34887064 -1.94108830 -0.46977413 -3.57543121 -4.88398357 0.06334702 31 32 33 34 35 36 -2.71620123 -0.06475359 -1.08987064 4.06623819 3.57540144 0.92234702 37 38 39 40 41 42 2.82218378 2.16661910 0.95851848 10.10784086 5.09317967 0.42829261 43 44 45 46 47 48 5.49150616 0.95517146 1.03616324 -6.40772793 -6.91689117 -7.28216324 49 50 51 52 53 54 -4.42734702 -1.39512936 1.23953183 -3.45390760 2.07419302 1.70930595 55 56 -1.86413347 0.86898768 > postscript(file="/var/www/html/rcomp/tmp/6shz41260733211.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 = 56 Frequency = 1 lag(myerror, k = 1) myerror 0 0.09454415 NA 1 -3.29767351 0.09454415 2 -4.18744764 -3.29767351 3 -2.95034292 -4.18744764 4 -4.56500411 -2.95034292 5 -4.53600000 -4.56500411 6 2.62110472 -4.53600000 7 -0.89079466 2.62110472 8 2.07797947 -0.89079466 9 -0.57812936 2.07797947 10 5.71881622 -0.57812936 11 4.19019713 5.71881622 12 2.85948973 4.19019713 13 4.46727207 2.85948973 14 2.45917146 4.46727207 15 -0.12815914 2.45917146 16 2.28161499 -0.12815914 17 2.33505441 2.28161499 18 -3.53227618 2.33505441 19 -0.86861088 -3.53227618 20 -2.02427207 -0.86861088 21 2.91961910 -2.02427207 22 -2.37732649 2.91961910 23 2.16961910 -2.37732649 24 -1.34887064 2.16961910 25 -1.94108830 -1.34887064 26 -0.46977413 -1.94108830 27 -3.57543121 -0.46977413 28 -4.88398357 -3.57543121 29 0.06334702 -4.88398357 30 -2.71620123 0.06334702 31 -0.06475359 -2.71620123 32 -1.08987064 -0.06475359 33 4.06623819 -1.08987064 34 3.57540144 4.06623819 35 0.92234702 3.57540144 36 2.82218378 0.92234702 37 2.16661910 2.82218378 38 0.95851848 2.16661910 39 10.10784086 0.95851848 40 5.09317967 10.10784086 41 0.42829261 5.09317967 42 5.49150616 0.42829261 43 0.95517146 5.49150616 44 1.03616324 0.95517146 45 -6.40772793 1.03616324 46 -6.91689117 -6.40772793 47 -7.28216324 -6.91689117 48 -4.42734702 -7.28216324 49 -1.39512936 -4.42734702 50 1.23953183 -1.39512936 51 -3.45390760 1.23953183 52 2.07419302 -3.45390760 53 1.70930595 2.07419302 54 -1.86413347 1.70930595 55 0.86898768 -1.86413347 56 NA 0.86898768 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.29767351 0.09454415 [2,] -4.18744764 -3.29767351 [3,] -2.95034292 -4.18744764 [4,] -4.56500411 -2.95034292 [5,] -4.53600000 -4.56500411 [6,] 2.62110472 -4.53600000 [7,] -0.89079466 2.62110472 [8,] 2.07797947 -0.89079466 [9,] -0.57812936 2.07797947 [10,] 5.71881622 -0.57812936 [11,] 4.19019713 5.71881622 [12,] 2.85948973 4.19019713 [13,] 4.46727207 2.85948973 [14,] 2.45917146 4.46727207 [15,] -0.12815914 2.45917146 [16,] 2.28161499 -0.12815914 [17,] 2.33505441 2.28161499 [18,] -3.53227618 2.33505441 [19,] -0.86861088 -3.53227618 [20,] -2.02427207 -0.86861088 [21,] 2.91961910 -2.02427207 [22,] -2.37732649 2.91961910 [23,] 2.16961910 -2.37732649 [24,] -1.34887064 2.16961910 [25,] -1.94108830 -1.34887064 [26,] -0.46977413 -1.94108830 [27,] -3.57543121 -0.46977413 [28,] -4.88398357 -3.57543121 [29,] 0.06334702 -4.88398357 [30,] -2.71620123 0.06334702 [31,] -0.06475359 -2.71620123 [32,] -1.08987064 -0.06475359 [33,] 4.06623819 -1.08987064 [34,] 3.57540144 4.06623819 [35,] 0.92234702 3.57540144 [36,] 2.82218378 0.92234702 [37,] 2.16661910 2.82218378 [38,] 0.95851848 2.16661910 [39,] 10.10784086 0.95851848 [40,] 5.09317967 10.10784086 [41,] 0.42829261 5.09317967 [42,] 5.49150616 0.42829261 [43,] 0.95517146 5.49150616 [44,] 1.03616324 0.95517146 [45,] -6.40772793 1.03616324 [46,] -6.91689117 -6.40772793 [47,] -7.28216324 -6.91689117 [48,] -4.42734702 -7.28216324 [49,] -1.39512936 -4.42734702 [50,] 1.23953183 -1.39512936 [51,] -3.45390760 1.23953183 [52,] 2.07419302 -3.45390760 [53,] 1.70930595 2.07419302 [54,] -1.86413347 1.70930595 [55,] 0.86898768 -1.86413347 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.29767351 0.09454415 2 -4.18744764 -3.29767351 3 -2.95034292 -4.18744764 4 -4.56500411 -2.95034292 5 -4.53600000 -4.56500411 6 2.62110472 -4.53600000 7 -0.89079466 2.62110472 8 2.07797947 -0.89079466 9 -0.57812936 2.07797947 10 5.71881622 -0.57812936 11 4.19019713 5.71881622 12 2.85948973 4.19019713 13 4.46727207 2.85948973 14 2.45917146 4.46727207 15 -0.12815914 2.45917146 16 2.28161499 -0.12815914 17 2.33505441 2.28161499 18 -3.53227618 2.33505441 19 -0.86861088 -3.53227618 20 -2.02427207 -0.86861088 21 2.91961910 -2.02427207 22 -2.37732649 2.91961910 23 2.16961910 -2.37732649 24 -1.34887064 2.16961910 25 -1.94108830 -1.34887064 26 -0.46977413 -1.94108830 27 -3.57543121 -0.46977413 28 -4.88398357 -3.57543121 29 0.06334702 -4.88398357 30 -2.71620123 0.06334702 31 -0.06475359 -2.71620123 32 -1.08987064 -0.06475359 33 4.06623819 -1.08987064 34 3.57540144 4.06623819 35 0.92234702 3.57540144 36 2.82218378 0.92234702 37 2.16661910 2.82218378 38 0.95851848 2.16661910 39 10.10784086 0.95851848 40 5.09317967 10.10784086 41 0.42829261 5.09317967 42 5.49150616 0.42829261 43 0.95517146 5.49150616 44 1.03616324 0.95517146 45 -6.40772793 1.03616324 46 -6.91689117 -6.40772793 47 -7.28216324 -6.91689117 48 -4.42734702 -7.28216324 49 -1.39512936 -4.42734702 50 1.23953183 -1.39512936 51 -3.45390760 1.23953183 52 2.07419302 -3.45390760 53 1.70930595 2.07419302 54 -1.86413347 1.70930595 55 0.86898768 -1.86413347 > 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/7kvb61260733211.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/8stor1260733211.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/9xac91260733211.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/10w3081260733211.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/114crz1260733211.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/12l1cg1260733211.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/13tg7s1260733211.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/14fsny1260733211.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/15aryl1260733211.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/16m0gf1260733211.tab") + } > > try(system("convert tmp/1nzgh1260733210.ps tmp/1nzgh1260733210.png",intern=TRUE)) character(0) > try(system("convert tmp/248oa1260733210.ps tmp/248oa1260733210.png",intern=TRUE)) character(0) > try(system("convert tmp/35wwo1260733210.ps tmp/35wwo1260733210.png",intern=TRUE)) character(0) > try(system("convert tmp/43ctx1260733210.ps tmp/43ctx1260733210.png",intern=TRUE)) character(0) > try(system("convert tmp/506hj1260733210.ps tmp/506hj1260733210.png",intern=TRUE)) character(0) > try(system("convert tmp/6shz41260733211.ps tmp/6shz41260733211.png",intern=TRUE)) character(0) > try(system("convert tmp/7kvb61260733211.ps tmp/7kvb61260733211.png",intern=TRUE)) character(0) > try(system("convert tmp/8stor1260733211.ps tmp/8stor1260733211.png",intern=TRUE)) character(0) > try(system("convert tmp/9xac91260733211.ps tmp/9xac91260733211.png",intern=TRUE)) character(0) > try(system("convert tmp/10w3081260733211.ps tmp/10w3081260733211.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.334 1.527 2.764