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(29.837,0,29.571,0,30.167,0,30.524,0,30.996,0,31.033,0,31.198,0,30.937,0,31.649,0,33.115,0,34.106,0,33.926,0,33.382,0,32.851,0,32.948,0,36.112,0,36.113,0,35.210,0,35.193,0,34.383,0,35.349,0,37.058,0,38.076,0,36.630,0,36.045,0,35.638,0,35.114,0,35.465,0,35.254,0,35.299,0,35.916,0,36.683,0,37.288,0,38.536,0,38.977,0,36.407,0,34.955,0,34.951,0,32.680,0,34.791,0,34.178,0,35.213,0,34.871,0,35.299,0,35.443,0,37.108,0,36.419,0,34.471,0,33.868,0,34.385,0,33.643,0,34.627,0,32.919,0,35.500,0,36.110,0,37.086,1,37.711,1,40.427,1,39.884,1,38.512,1,38.767,1),dim=c(2,61),dimnames=list(c('saldo_zichtrek','crisis'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('saldo_zichtrek','crisis'),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 saldo_zichtrek crisis 1 29.837 0 2 29.571 0 3 30.167 0 4 30.524 0 5 30.996 0 6 31.033 0 7 31.198 0 8 30.937 0 9 31.649 0 10 33.115 0 11 34.106 0 12 33.926 0 13 33.382 0 14 32.851 0 15 32.948 0 16 36.112 0 17 36.113 0 18 35.210 0 19 35.193 0 20 34.383 0 21 35.349 0 22 37.058 0 23 38.076 0 24 36.630 0 25 36.045 0 26 35.638 0 27 35.114 0 28 35.465 0 29 35.254 0 30 35.299 0 31 35.916 0 32 36.683 0 33 37.288 0 34 38.536 0 35 38.977 0 36 36.407 0 37 34.955 0 38 34.951 0 39 32.680 0 40 34.791 0 41 34.178 0 42 35.213 0 43 34.871 0 44 35.299 0 45 35.443 0 46 37.108 0 47 36.419 0 48 34.471 0 49 33.868 0 50 34.385 0 51 33.643 0 52 34.627 0 53 32.919 0 54 35.500 0 55 36.110 0 56 37.086 1 57 37.711 1 58 40.427 1 59 39.884 1 60 38.512 1 61 38.767 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) crisis 34.517 4.214 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.9457 -1.1347 0.4343 1.3993 4.4603 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 34.5167 0.2878 119.943 < 2e-16 *** crisis 4.2145 0.9176 4.593 2.34e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.134 on 59 degrees of freedom Multiple R-squared: 0.2634, Adjusted R-squared: 0.2509 F-statistic: 21.1 on 1 and 59 DF, p-value: 2.344e-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.06268292 1.253658e-01 9.373171e-01 [2,] 0.04254760 8.509521e-02 9.574524e-01 [3,] 0.03357111 6.714222e-02 9.664289e-01 [4,] 0.02141920 4.283840e-02 9.785808e-01 [5,] 0.03144674 6.289349e-02 9.685533e-01 [6,] 0.19592931 3.918586e-01 8.040707e-01 [7,] 0.54822754 9.035449e-01 4.517725e-01 [8,] 0.70579985 5.884003e-01 2.942002e-01 [9,] 0.74966147 5.006771e-01 2.503385e-01 [10,] 0.76600703 4.679859e-01 2.339930e-01 [11,] 0.78813235 4.237353e-01 2.118677e-01 [12,] 0.95230326 9.539348e-02 4.769674e-02 [13,] 0.98486863 3.026273e-02 1.513137e-02 [14,] 0.98842429 2.315142e-02 1.157571e-02 [15,] 0.98979121 2.041758e-02 1.020879e-02 [16,] 0.98827765 2.344469e-02 1.172235e-02 [17,] 0.98863466 2.273067e-02 1.136534e-02 [18,] 0.99562199 8.756019e-03 4.378010e-03 [19,] 0.99934115 1.317700e-03 6.588500e-04 [20,] 0.99948844 1.023118e-03 5.115591e-04 [21,] 0.99937897 1.242061e-03 6.210306e-04 [22,] 0.99908199 1.836013e-03 9.180065e-04 [23,] 0.99848833 3.023339e-03 1.511670e-03 [24,] 0.99764864 4.702718e-03 2.351359e-03 [25,] 0.99624128 7.517448e-03 3.758724e-03 [26,] 0.99408822 1.182356e-02 5.911778e-03 [27,] 0.99180825 1.638350e-02 8.191752e-03 [28,] 0.99145043 1.709914e-02 8.549572e-03 [29,] 0.99366828 1.266344e-02 6.331719e-03 [30,] 0.99877361 2.452781e-03 1.226391e-03 [31,] 0.99995833 8.334090e-05 4.167045e-05 [32,] 0.99995640 8.719317e-05 4.359658e-05 [33,] 0.99989789 2.042128e-04 1.021064e-04 [34,] 0.99976854 4.629282e-04 2.314641e-04 [35,] 0.99986817 2.636694e-04 1.318347e-04 [36,] 0.99969404 6.119111e-04 3.059555e-04 [37,] 0.99941321 1.173572e-03 5.867859e-04 [38,] 0.99874592 2.508159e-03 1.254079e-03 [39,] 0.99735302 5.293965e-03 2.646983e-03 [40,] 0.99479858 1.040284e-02 5.201421e-03 [41,] 0.99045595 1.908810e-02 9.544049e-03 [42,] 0.99501773 9.964542e-03 4.982271e-03 [43,] 0.99615164 7.696718e-03 3.848359e-03 [44,] 0.99150164 1.699673e-02 8.498363e-03 [45,] 0.98381410 3.237181e-02 1.618590e-02 [46,] 0.96744925 6.510150e-02 3.255075e-02 [47,] 0.94979858 1.004028e-01 5.020142e-02 [48,] 0.90658244 1.868351e-01 9.341756e-02 [49,] 0.94812711 1.037458e-01 5.187289e-02 [50,] 0.89729437 2.054113e-01 1.027056e-01 [51,] 0.80304828 3.939034e-01 1.969517e-01 [52,] 0.80497968 3.900406e-01 1.950203e-01 > postscript(file="/var/www/html/rcomp/tmp/1m50l1258735481.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/2y9zv1258735481.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/3ee5l1258735481.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/4bqcg1258735481.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/5sfo91258735481.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 -4.67967273 -4.94567273 -4.34967273 -3.99267273 -3.52067273 -3.48367273 7 8 9 10 11 12 -3.31867273 -3.57967273 -2.86767273 -1.40167273 -0.41067273 -0.59067273 13 14 15 16 17 18 -1.13467273 -1.66567273 -1.56867273 1.59532727 1.59632727 0.69332727 19 20 21 22 23 24 0.67632727 -0.13367273 0.83232727 2.54132727 3.55932727 2.11332727 25 26 27 28 29 30 1.52832727 1.12132727 0.59732727 0.94832727 0.73732727 0.78232727 31 32 33 34 35 36 1.39932727 2.16632727 2.77132727 4.01932727 4.46032727 1.89032727 37 38 39 40 41 42 0.43832727 0.43432727 -1.83667273 0.27432727 -0.33867273 0.69632727 43 44 45 46 47 48 0.35432727 0.78232727 0.92632727 2.59132727 1.90232727 -0.04567273 49 50 51 52 53 54 -0.64867273 -0.13167273 -0.87367273 0.11032727 -1.59767273 0.98332727 55 56 57 58 59 60 1.59332727 -1.64516667 -1.02016667 1.69583333 1.15283333 -0.21916667 61 0.03583333 > postscript(file="/var/www/html/rcomp/tmp/6x6y31258735481.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 -4.67967273 NA 1 -4.94567273 -4.67967273 2 -4.34967273 -4.94567273 3 -3.99267273 -4.34967273 4 -3.52067273 -3.99267273 5 -3.48367273 -3.52067273 6 -3.31867273 -3.48367273 7 -3.57967273 -3.31867273 8 -2.86767273 -3.57967273 9 -1.40167273 -2.86767273 10 -0.41067273 -1.40167273 11 -0.59067273 -0.41067273 12 -1.13467273 -0.59067273 13 -1.66567273 -1.13467273 14 -1.56867273 -1.66567273 15 1.59532727 -1.56867273 16 1.59632727 1.59532727 17 0.69332727 1.59632727 18 0.67632727 0.69332727 19 -0.13367273 0.67632727 20 0.83232727 -0.13367273 21 2.54132727 0.83232727 22 3.55932727 2.54132727 23 2.11332727 3.55932727 24 1.52832727 2.11332727 25 1.12132727 1.52832727 26 0.59732727 1.12132727 27 0.94832727 0.59732727 28 0.73732727 0.94832727 29 0.78232727 0.73732727 30 1.39932727 0.78232727 31 2.16632727 1.39932727 32 2.77132727 2.16632727 33 4.01932727 2.77132727 34 4.46032727 4.01932727 35 1.89032727 4.46032727 36 0.43832727 1.89032727 37 0.43432727 0.43832727 38 -1.83667273 0.43432727 39 0.27432727 -1.83667273 40 -0.33867273 0.27432727 41 0.69632727 -0.33867273 42 0.35432727 0.69632727 43 0.78232727 0.35432727 44 0.92632727 0.78232727 45 2.59132727 0.92632727 46 1.90232727 2.59132727 47 -0.04567273 1.90232727 48 -0.64867273 -0.04567273 49 -0.13167273 -0.64867273 50 -0.87367273 -0.13167273 51 0.11032727 -0.87367273 52 -1.59767273 0.11032727 53 0.98332727 -1.59767273 54 1.59332727 0.98332727 55 -1.64516667 1.59332727 56 -1.02016667 -1.64516667 57 1.69583333 -1.02016667 58 1.15283333 1.69583333 59 -0.21916667 1.15283333 60 0.03583333 -0.21916667 61 NA 0.03583333 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -4.94567273 -4.67967273 [2,] -4.34967273 -4.94567273 [3,] -3.99267273 -4.34967273 [4,] -3.52067273 -3.99267273 [5,] -3.48367273 -3.52067273 [6,] -3.31867273 -3.48367273 [7,] -3.57967273 -3.31867273 [8,] -2.86767273 -3.57967273 [9,] -1.40167273 -2.86767273 [10,] -0.41067273 -1.40167273 [11,] -0.59067273 -0.41067273 [12,] -1.13467273 -0.59067273 [13,] -1.66567273 -1.13467273 [14,] -1.56867273 -1.66567273 [15,] 1.59532727 -1.56867273 [16,] 1.59632727 1.59532727 [17,] 0.69332727 1.59632727 [18,] 0.67632727 0.69332727 [19,] -0.13367273 0.67632727 [20,] 0.83232727 -0.13367273 [21,] 2.54132727 0.83232727 [22,] 3.55932727 2.54132727 [23,] 2.11332727 3.55932727 [24,] 1.52832727 2.11332727 [25,] 1.12132727 1.52832727 [26,] 0.59732727 1.12132727 [27,] 0.94832727 0.59732727 [28,] 0.73732727 0.94832727 [29,] 0.78232727 0.73732727 [30,] 1.39932727 0.78232727 [31,] 2.16632727 1.39932727 [32,] 2.77132727 2.16632727 [33,] 4.01932727 2.77132727 [34,] 4.46032727 4.01932727 [35,] 1.89032727 4.46032727 [36,] 0.43832727 1.89032727 [37,] 0.43432727 0.43832727 [38,] -1.83667273 0.43432727 [39,] 0.27432727 -1.83667273 [40,] -0.33867273 0.27432727 [41,] 0.69632727 -0.33867273 [42,] 0.35432727 0.69632727 [43,] 0.78232727 0.35432727 [44,] 0.92632727 0.78232727 [45,] 2.59132727 0.92632727 [46,] 1.90232727 2.59132727 [47,] -0.04567273 1.90232727 [48,] -0.64867273 -0.04567273 [49,] -0.13167273 -0.64867273 [50,] -0.87367273 -0.13167273 [51,] 0.11032727 -0.87367273 [52,] -1.59767273 0.11032727 [53,] 0.98332727 -1.59767273 [54,] 1.59332727 0.98332727 [55,] -1.64516667 1.59332727 [56,] -1.02016667 -1.64516667 [57,] 1.69583333 -1.02016667 [58,] 1.15283333 1.69583333 [59,] -0.21916667 1.15283333 [60,] 0.03583333 -0.21916667 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -4.94567273 -4.67967273 2 -4.34967273 -4.94567273 3 -3.99267273 -4.34967273 4 -3.52067273 -3.99267273 5 -3.48367273 -3.52067273 6 -3.31867273 -3.48367273 7 -3.57967273 -3.31867273 8 -2.86767273 -3.57967273 9 -1.40167273 -2.86767273 10 -0.41067273 -1.40167273 11 -0.59067273 -0.41067273 12 -1.13467273 -0.59067273 13 -1.66567273 -1.13467273 14 -1.56867273 -1.66567273 15 1.59532727 -1.56867273 16 1.59632727 1.59532727 17 0.69332727 1.59632727 18 0.67632727 0.69332727 19 -0.13367273 0.67632727 20 0.83232727 -0.13367273 21 2.54132727 0.83232727 22 3.55932727 2.54132727 23 2.11332727 3.55932727 24 1.52832727 2.11332727 25 1.12132727 1.52832727 26 0.59732727 1.12132727 27 0.94832727 0.59732727 28 0.73732727 0.94832727 29 0.78232727 0.73732727 30 1.39932727 0.78232727 31 2.16632727 1.39932727 32 2.77132727 2.16632727 33 4.01932727 2.77132727 34 4.46032727 4.01932727 35 1.89032727 4.46032727 36 0.43832727 1.89032727 37 0.43432727 0.43832727 38 -1.83667273 0.43432727 39 0.27432727 -1.83667273 40 -0.33867273 0.27432727 41 0.69632727 -0.33867273 42 0.35432727 0.69632727 43 0.78232727 0.35432727 44 0.92632727 0.78232727 45 2.59132727 0.92632727 46 1.90232727 2.59132727 47 -0.04567273 1.90232727 48 -0.64867273 -0.04567273 49 -0.13167273 -0.64867273 50 -0.87367273 -0.13167273 51 0.11032727 -0.87367273 52 -1.59767273 0.11032727 53 0.98332727 -1.59767273 54 1.59332727 0.98332727 55 -1.64516667 1.59332727 56 -1.02016667 -1.64516667 57 1.69583333 -1.02016667 58 1.15283333 1.69583333 59 -0.21916667 1.15283333 60 0.03583333 -0.21916667 > 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/73o1h1258735481.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/8glph1258735481.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/9czr01258735482.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/10mt691258735482.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/116r9w1258735482.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/12rnhh1258735482.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/13tm7m1258735482.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/14wrqn1258735482.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/15qvvw1258735482.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/165to61258735482.tab") + } > > system("convert tmp/1m50l1258735481.ps tmp/1m50l1258735481.png") > system("convert tmp/2y9zv1258735481.ps tmp/2y9zv1258735481.png") > system("convert tmp/3ee5l1258735481.ps tmp/3ee5l1258735481.png") > system("convert tmp/4bqcg1258735481.ps tmp/4bqcg1258735481.png") > system("convert tmp/5sfo91258735481.ps tmp/5sfo91258735481.png") > system("convert tmp/6x6y31258735481.ps tmp/6x6y31258735481.png") > system("convert tmp/73o1h1258735481.ps tmp/73o1h1258735481.png") > system("convert tmp/8glph1258735481.ps tmp/8glph1258735481.png") > system("convert tmp/9czr01258735482.ps tmp/9czr01258735482.png") > system("convert tmp/10mt691258735482.ps tmp/10mt691258735482.png") > > > proc.time() user system elapsed 2.534 1.573 5.966