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(83.4,108.8,113.6,128.4,112.9,121.1,104,119.5,109.9,128.7,99,108.7,106.3,105.5,128.9,119.8,111.1,111.3,102.9,110.6,130,120.1,87,97.5,87.5,107.7,117.6,127.3,103.4,117.2,110.8,119.8,112.6,116.2,102.5,111,112.4,112.4,135.6,130.6,105.1,109.1,127.7,118.8,137,123.9,91,101.6,90.5,112.8,122.4,128,123.3,129.6,124.3,125.8,120,119.5,118.1,115.7,119,113.6,142.7,129.7,123.6,112,129.6,116.8,151.6,127,110.4,112.1,99.2,114.2,130.5,121.1,136.2,131.6,129.7,125,128,120.4,121.6,117.7,135.8,117.5,143.8,120.6,147.5,127.5,136.2,112.3,156.6,124.5,123.3,115.2,104.5,104.7,139.8,130.9,136.5,129.2,112.1,113.5,118.5,125.6,94.4,107.6,102.3,107,111.4,121.6,99.2,110.7,87.8,106.3,115.8,118.6,79.7,104.6),dim=c(2,60),dimnames=list(c('inv','cons'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('inv','cons'),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 = '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 inv cons 1 83.4 108.8 2 113.6 128.4 3 112.9 121.1 4 104.0 119.5 5 109.9 128.7 6 99.0 108.7 7 106.3 105.5 8 128.9 119.8 9 111.1 111.3 10 102.9 110.6 11 130.0 120.1 12 87.0 97.5 13 87.5 107.7 14 117.6 127.3 15 103.4 117.2 16 110.8 119.8 17 112.6 116.2 18 102.5 111.0 19 112.4 112.4 20 135.6 130.6 21 105.1 109.1 22 127.7 118.8 23 137.0 123.9 24 91.0 101.6 25 90.5 112.8 26 122.4 128.0 27 123.3 129.6 28 124.3 125.8 29 120.0 119.5 30 118.1 115.7 31 119.0 113.6 32 142.7 129.7 33 123.6 112.0 34 129.6 116.8 35 151.6 127.0 36 110.4 112.1 37 99.2 114.2 38 130.5 121.1 39 136.2 131.6 40 129.7 125.0 41 128.0 120.4 42 121.6 117.7 43 135.8 117.5 44 143.8 120.6 45 147.5 127.5 46 136.2 112.3 47 156.6 124.5 48 123.3 115.2 49 104.5 104.7 50 139.8 130.9 51 136.5 129.2 52 112.1 113.5 53 118.5 125.6 54 94.4 107.6 55 102.3 107.0 56 111.4 121.6 57 99.2 110.7 58 87.8 106.3 59 115.8 118.6 60 79.7 104.6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) cons -68.971 1.580 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -24.539 -9.913 1.189 8.161 28.799 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -68.9709 22.0857 -3.123 0.00279 ** cons 1.5805 0.1876 8.425 1.19e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 12.06 on 58 degrees of freedom Multiple R-squared: 0.5503, Adjusted R-squared: 0.5426 F-statistic: 70.98 on 1 and 58 DF, p-value: 1.193e-11 > 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.18831369 0.37662738 0.81168631 [2,] 0.18439245 0.36878490 0.81560755 [3,] 0.29829892 0.59659784 0.70170108 [4,] 0.61703498 0.76593004 0.38296502 [5,] 0.54900733 0.90198534 0.45099267 [6,] 0.43450508 0.86901016 0.56549492 [7,] 0.57701384 0.84597232 0.42298616 [8,] 0.49008741 0.98017482 0.50991259 [9,] 0.50457594 0.99084812 0.49542406 [10,] 0.45259477 0.90518954 0.54740523 [11,] 0.40779205 0.81558411 0.59220795 [12,] 0.34357291 0.68714582 0.65642709 [13,] 0.28140242 0.56280483 0.71859758 [14,] 0.21598584 0.43197168 0.78401416 [15,] 0.18493454 0.36986908 0.81506546 [16,] 0.18739684 0.37479368 0.81260316 [17,] 0.14157858 0.28315715 0.85842142 [18,] 0.17058337 0.34116674 0.82941663 [19,] 0.22162437 0.44324874 0.77837563 [20,] 0.16731638 0.33463277 0.83268362 [21,] 0.24388372 0.48776744 0.75611628 [22,] 0.22589459 0.45178917 0.77410541 [23,] 0.23313696 0.46627391 0.76686304 [24,] 0.20588601 0.41177202 0.79411399 [25,] 0.16871988 0.33743975 0.83128012 [26,] 0.14085583 0.28171166 0.85914417 [27,] 0.13194935 0.26389870 0.86805065 [28,] 0.13376276 0.26752552 0.86623724 [29,] 0.17844854 0.35689708 0.82155146 [30,] 0.20669001 0.41338002 0.79330999 [31,] 0.31956056 0.63912113 0.68043944 [32,] 0.25573028 0.51146056 0.74426972 [33,] 0.26811231 0.53622461 0.73188769 [34,] 0.23121688 0.46243376 0.76878312 [35,] 0.20291248 0.40582496 0.79708752 [36,] 0.16102552 0.32205104 0.83897448 [37,] 0.12578925 0.25157851 0.87421075 [38,] 0.09175747 0.18351493 0.90824253 [39,] 0.12873179 0.25746359 0.87126821 [40,] 0.21121073 0.42242146 0.78878927 [41,] 0.20757312 0.41514623 0.79242688 [42,] 0.54643377 0.90713245 0.45356623 [43,] 0.92888624 0.14222752 0.07111376 [44,] 0.95299314 0.09401372 0.04700686 [45,] 0.97940100 0.04119800 0.02059900 [46,] 0.96395228 0.07209544 0.03604772 [47,] 0.94871244 0.10257513 0.05128756 [48,] 0.94935295 0.10129409 0.05064705 [49,] 0.90657235 0.18685530 0.09342765 [50,] 0.81925982 0.36148037 0.18074018 [51,] 0.90458101 0.19083798 0.09541899 > postscript(file="/var/www/html/rcomp/tmp/1qm3x1258787360.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/2szbb1258787360.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/3h8ei1258787360.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/4bm9v1258787360.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/5rvw21258787360.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 -19.5873946 -20.3651671 -9.5275274 -15.8987296 -24.5393167 -3.8293448 7 8 9 10 11 12 8.5282507 8.5271208 4.1613589 -2.9322921 9.1529712 1.8722395 13 14 15 16 17 18 -13.7488462 -14.6266186 -12.8635828 -9.5728792 -2.0830842 -3.9644915 19 20 21 22 23 24 3.7228104 -1.8422640 1.6384558 8.9076194 10.1470766 -0.6078047 25 26 27 28 29 30 -18.8093890 -10.9329677 -12.5617654 -5.5558707 0.1012704 4.2071651 31 32 33 34 35 36 8.4262121 6.6801847 15.5550099 13.9686166 19.8475309 2.1969600 37 38 39 40 41 42 -12.3220870 8.0724726 -2.8227626 1.1085281 6.6788217 4.5461679 43 44 45 46 47 48 19.0622676 22.1627219 14.9572816 27.6808603 28.7987774 10.1974144 49 50 51 52 53 54 7.9926496 1.8835864 1.2704340 1.6842620 -11.0397710 -6.6907963 55 56 57 58 59 60 2.1575028 -11.8177766 -6.7903420 -11.2361481 -2.6762809 -16.6493005 > postscript(file="/var/www/html/rcomp/tmp/6jm1k1258787360.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 -19.5873946 NA 1 -20.3651671 -19.5873946 2 -9.5275274 -20.3651671 3 -15.8987296 -9.5275274 4 -24.5393167 -15.8987296 5 -3.8293448 -24.5393167 6 8.5282507 -3.8293448 7 8.5271208 8.5282507 8 4.1613589 8.5271208 9 -2.9322921 4.1613589 10 9.1529712 -2.9322921 11 1.8722395 9.1529712 12 -13.7488462 1.8722395 13 -14.6266186 -13.7488462 14 -12.8635828 -14.6266186 15 -9.5728792 -12.8635828 16 -2.0830842 -9.5728792 17 -3.9644915 -2.0830842 18 3.7228104 -3.9644915 19 -1.8422640 3.7228104 20 1.6384558 -1.8422640 21 8.9076194 1.6384558 22 10.1470766 8.9076194 23 -0.6078047 10.1470766 24 -18.8093890 -0.6078047 25 -10.9329677 -18.8093890 26 -12.5617654 -10.9329677 27 -5.5558707 -12.5617654 28 0.1012704 -5.5558707 29 4.2071651 0.1012704 30 8.4262121 4.2071651 31 6.6801847 8.4262121 32 15.5550099 6.6801847 33 13.9686166 15.5550099 34 19.8475309 13.9686166 35 2.1969600 19.8475309 36 -12.3220870 2.1969600 37 8.0724726 -12.3220870 38 -2.8227626 8.0724726 39 1.1085281 -2.8227626 40 6.6788217 1.1085281 41 4.5461679 6.6788217 42 19.0622676 4.5461679 43 22.1627219 19.0622676 44 14.9572816 22.1627219 45 27.6808603 14.9572816 46 28.7987774 27.6808603 47 10.1974144 28.7987774 48 7.9926496 10.1974144 49 1.8835864 7.9926496 50 1.2704340 1.8835864 51 1.6842620 1.2704340 52 -11.0397710 1.6842620 53 -6.6907963 -11.0397710 54 2.1575028 -6.6907963 55 -11.8177766 2.1575028 56 -6.7903420 -11.8177766 57 -11.2361481 -6.7903420 58 -2.6762809 -11.2361481 59 -16.6493005 -2.6762809 60 NA -16.6493005 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -20.3651671 -19.5873946 [2,] -9.5275274 -20.3651671 [3,] -15.8987296 -9.5275274 [4,] -24.5393167 -15.8987296 [5,] -3.8293448 -24.5393167 [6,] 8.5282507 -3.8293448 [7,] 8.5271208 8.5282507 [8,] 4.1613589 8.5271208 [9,] -2.9322921 4.1613589 [10,] 9.1529712 -2.9322921 [11,] 1.8722395 9.1529712 [12,] -13.7488462 1.8722395 [13,] -14.6266186 -13.7488462 [14,] -12.8635828 -14.6266186 [15,] -9.5728792 -12.8635828 [16,] -2.0830842 -9.5728792 [17,] -3.9644915 -2.0830842 [18,] 3.7228104 -3.9644915 [19,] -1.8422640 3.7228104 [20,] 1.6384558 -1.8422640 [21,] 8.9076194 1.6384558 [22,] 10.1470766 8.9076194 [23,] -0.6078047 10.1470766 [24,] -18.8093890 -0.6078047 [25,] -10.9329677 -18.8093890 [26,] -12.5617654 -10.9329677 [27,] -5.5558707 -12.5617654 [28,] 0.1012704 -5.5558707 [29,] 4.2071651 0.1012704 [30,] 8.4262121 4.2071651 [31,] 6.6801847 8.4262121 [32,] 15.5550099 6.6801847 [33,] 13.9686166 15.5550099 [34,] 19.8475309 13.9686166 [35,] 2.1969600 19.8475309 [36,] -12.3220870 2.1969600 [37,] 8.0724726 -12.3220870 [38,] -2.8227626 8.0724726 [39,] 1.1085281 -2.8227626 [40,] 6.6788217 1.1085281 [41,] 4.5461679 6.6788217 [42,] 19.0622676 4.5461679 [43,] 22.1627219 19.0622676 [44,] 14.9572816 22.1627219 [45,] 27.6808603 14.9572816 [46,] 28.7987774 27.6808603 [47,] 10.1974144 28.7987774 [48,] 7.9926496 10.1974144 [49,] 1.8835864 7.9926496 [50,] 1.2704340 1.8835864 [51,] 1.6842620 1.2704340 [52,] -11.0397710 1.6842620 [53,] -6.6907963 -11.0397710 [54,] 2.1575028 -6.6907963 [55,] -11.8177766 2.1575028 [56,] -6.7903420 -11.8177766 [57,] -11.2361481 -6.7903420 [58,] -2.6762809 -11.2361481 [59,] -16.6493005 -2.6762809 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -20.3651671 -19.5873946 2 -9.5275274 -20.3651671 3 -15.8987296 -9.5275274 4 -24.5393167 -15.8987296 5 -3.8293448 -24.5393167 6 8.5282507 -3.8293448 7 8.5271208 8.5282507 8 4.1613589 8.5271208 9 -2.9322921 4.1613589 10 9.1529712 -2.9322921 11 1.8722395 9.1529712 12 -13.7488462 1.8722395 13 -14.6266186 -13.7488462 14 -12.8635828 -14.6266186 15 -9.5728792 -12.8635828 16 -2.0830842 -9.5728792 17 -3.9644915 -2.0830842 18 3.7228104 -3.9644915 19 -1.8422640 3.7228104 20 1.6384558 -1.8422640 21 8.9076194 1.6384558 22 10.1470766 8.9076194 23 -0.6078047 10.1470766 24 -18.8093890 -0.6078047 25 -10.9329677 -18.8093890 26 -12.5617654 -10.9329677 27 -5.5558707 -12.5617654 28 0.1012704 -5.5558707 29 4.2071651 0.1012704 30 8.4262121 4.2071651 31 6.6801847 8.4262121 32 15.5550099 6.6801847 33 13.9686166 15.5550099 34 19.8475309 13.9686166 35 2.1969600 19.8475309 36 -12.3220870 2.1969600 37 8.0724726 -12.3220870 38 -2.8227626 8.0724726 39 1.1085281 -2.8227626 40 6.6788217 1.1085281 41 4.5461679 6.6788217 42 19.0622676 4.5461679 43 22.1627219 19.0622676 44 14.9572816 22.1627219 45 27.6808603 14.9572816 46 28.7987774 27.6808603 47 10.1974144 28.7987774 48 7.9926496 10.1974144 49 1.8835864 7.9926496 50 1.2704340 1.8835864 51 1.6842620 1.2704340 52 -11.0397710 1.6842620 53 -6.6907963 -11.0397710 54 2.1575028 -6.6907963 55 -11.8177766 2.1575028 56 -6.7903420 -11.8177766 57 -11.2361481 -6.7903420 58 -2.6762809 -11.2361481 59 -16.6493005 -2.6762809 > 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/72f5o1258787360.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/86xmy1258787360.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/9wwq41258787360.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/10593c1258787360.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/11moy71258787361.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/12er421258787361.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/1306ky1258787361.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/14gtpf1258787361.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/15n4e71258787361.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/162bjh1258787361.tab") + } > > system("convert tmp/1qm3x1258787360.ps tmp/1qm3x1258787360.png") > system("convert tmp/2szbb1258787360.ps tmp/2szbb1258787360.png") > system("convert tmp/3h8ei1258787360.ps tmp/3h8ei1258787360.png") > system("convert tmp/4bm9v1258787360.ps tmp/4bm9v1258787360.png") > system("convert tmp/5rvw21258787360.ps tmp/5rvw21258787360.png") > system("convert tmp/6jm1k1258787360.ps tmp/6jm1k1258787360.png") > system("convert tmp/72f5o1258787360.ps tmp/72f5o1258787360.png") > system("convert tmp/86xmy1258787360.ps tmp/86xmy1258787360.png") > system("convert tmp/9wwq41258787360.ps tmp/9wwq41258787360.png") > system("convert tmp/10593c1258787360.ps tmp/10593c1258787360.png") > > > proc.time() user system elapsed 2.474 1.583 6.752