R version 2.7.0 (2008-04-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(0,0,9,0,1,0,4,0,6,0,21,0,24,0,23,0,22,0,21,0,20,0,16,0,18,0,18,0,24,0,16,0,15,0,24,0,18,0,15,0,4,0,3,0,6,0,5,0,12,0,12,0,12,0,14,0,12,0,17,0,12,0,20,0,21,0,15,0,22,0,19,0,19,0,26,0,25,0,19,0,20,0,30,0,31,0,35,0,33,0,26,0,25,0,17,0,14,0,8,0,12,0,7,0,4,0,10,0,8,0,16,1,14,1,20,1,9,1,10,1),dim=c(2,60),dimnames=list(c('Y','D'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','D'),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 = 'Include Monthly 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 Y D M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 0 0 1 0 0 0 0 0 0 0 0 0 0 2 9 0 0 1 0 0 0 0 0 0 0 0 0 3 1 0 0 0 1 0 0 0 0 0 0 0 0 4 4 0 0 0 0 1 0 0 0 0 0 0 0 5 6 0 0 0 0 0 1 0 0 0 0 0 0 6 21 0 0 0 0 0 0 1 0 0 0 0 0 7 24 0 0 0 0 0 0 0 1 0 0 0 0 8 23 0 0 0 0 0 0 0 0 1 0 0 0 9 22 0 0 0 0 0 0 0 0 0 1 0 0 10 21 0 0 0 0 0 0 0 0 0 0 1 0 11 20 0 0 0 0 0 0 0 0 0 0 0 1 12 16 0 0 0 0 0 0 0 0 0 0 0 0 13 18 0 1 0 0 0 0 0 0 0 0 0 0 14 18 0 0 1 0 0 0 0 0 0 0 0 0 15 24 0 0 0 1 0 0 0 0 0 0 0 0 16 16 0 0 0 0 1 0 0 0 0 0 0 0 17 15 0 0 0 0 0 1 0 0 0 0 0 0 18 24 0 0 0 0 0 0 1 0 0 0 0 0 19 18 0 0 0 0 0 0 0 1 0 0 0 0 20 15 0 0 0 0 0 0 0 0 1 0 0 0 21 4 0 0 0 0 0 0 0 0 0 1 0 0 22 3 0 0 0 0 0 0 0 0 0 0 1 0 23 6 0 0 0 0 0 0 0 0 0 0 0 1 24 5 0 0 0 0 0 0 0 0 0 0 0 0 25 12 0 1 0 0 0 0 0 0 0 0 0 0 26 12 0 0 1 0 0 0 0 0 0 0 0 0 27 12 0 0 0 1 0 0 0 0 0 0 0 0 28 14 0 0 0 0 1 0 0 0 0 0 0 0 29 12 0 0 0 0 0 1 0 0 0 0 0 0 30 17 0 0 0 0 0 0 1 0 0 0 0 0 31 12 0 0 0 0 0 0 0 1 0 0 0 0 32 20 0 0 0 0 0 0 0 0 1 0 0 0 33 21 0 0 0 0 0 0 0 0 0 1 0 0 34 15 0 0 0 0 0 0 0 0 0 0 1 0 35 22 0 0 0 0 0 0 0 0 0 0 0 1 36 19 0 0 0 0 0 0 0 0 0 0 0 0 37 19 0 1 0 0 0 0 0 0 0 0 0 0 38 26 0 0 1 0 0 0 0 0 0 0 0 0 39 25 0 0 0 1 0 0 0 0 0 0 0 0 40 19 0 0 0 0 1 0 0 0 0 0 0 0 41 20 0 0 0 0 0 1 0 0 0 0 0 0 42 30 0 0 0 0 0 0 1 0 0 0 0 0 43 31 0 0 0 0 0 0 0 1 0 0 0 0 44 35 0 0 0 0 0 0 0 0 1 0 0 0 45 33 0 0 0 0 0 0 0 0 0 1 0 0 46 26 0 0 0 0 0 0 0 0 0 0 1 0 47 25 0 0 0 0 0 0 0 0 0 0 0 1 48 17 0 0 0 0 0 0 0 0 0 0 0 0 49 14 0 1 0 0 0 0 0 0 0 0 0 0 50 8 0 0 1 0 0 0 0 0 0 0 0 0 51 12 0 0 0 1 0 0 0 0 0 0 0 0 52 7 0 0 0 0 1 0 0 0 0 0 0 0 53 4 0 0 0 0 0 1 0 0 0 0 0 0 54 10 0 0 0 0 0 0 1 0 0 0 0 0 55 8 0 0 0 0 0 0 0 1 0 0 0 0 56 16 1 0 0 0 0 0 0 0 1 0 0 0 57 14 1 0 0 0 0 0 0 0 0 1 0 0 58 20 1 0 0 0 0 0 0 0 0 0 1 0 59 9 1 0 0 0 0 0 0 0 0 0 0 1 60 10 1 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D M1 M2 M3 M4 14.32 -4.60 -1.72 0.28 0.48 -2.32 M5 M6 M7 M8 M9 M10 -2.92 6.08 4.28 8.40 5.40 3.60 M11 3.00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -15.72 -5.10 0.60 4.86 13.28 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.320 3.719 3.850 0.000356 *** D -4.600 4.058 -1.134 0.262749 M1 -1.720 5.197 -0.331 0.742147 M2 0.280 5.197 0.054 0.957262 M3 0.480 5.197 0.092 0.926804 M4 -2.320 5.197 -0.446 0.657352 M5 -2.920 5.197 -0.562 0.576881 M6 6.080 5.197 1.170 0.247940 M7 4.280 5.197 0.824 0.414356 M8 8.400 5.133 1.636 0.108438 M9 5.400 5.133 1.052 0.298195 M10 3.600 5.133 0.701 0.486568 M11 3.000 5.133 0.584 0.561730 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 8.116 on 47 degrees of freedom Multiple R-squared: 0.1893, Adjusted R-squared: -0.01772 F-statistic: 0.9144 on 12 and 47 DF, p-value: 0.5402 > 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.9081239 0.1837522 0.09187612 [2,] 0.8522064 0.2955873 0.14779363 [3,] 0.7611671 0.4776659 0.23883294 [4,] 0.6633074 0.6733853 0.33669264 [5,] 0.5953486 0.8093027 0.40465137 [6,] 0.7234300 0.5531401 0.27657003 [7,] 0.8286909 0.3426183 0.17130914 [8,] 0.8604431 0.2791139 0.13955694 [9,] 0.8674353 0.2651294 0.13256470 [10,] 0.8124462 0.3751076 0.18755381 [11,] 0.7452779 0.5094441 0.25472205 [12,] 0.6738771 0.6522458 0.32612292 [13,] 0.5870969 0.8258061 0.41290306 [14,] 0.4893321 0.9786642 0.51066789 [15,] 0.4088483 0.8176967 0.59115167 [16,] 0.3718955 0.7437910 0.62810449 [17,] 0.3255419 0.6510838 0.67445812 [18,] 0.2883884 0.5767769 0.71161155 [19,] 0.2906099 0.5812198 0.70939011 [20,] 0.2358051 0.4716102 0.76419489 [21,] 0.1825856 0.3651712 0.81741440 [22,] 0.1449041 0.2898081 0.85509595 [23,] 0.2054120 0.4108239 0.79458803 [24,] 0.2218769 0.4437538 0.77812308 [25,] 0.2030155 0.4060309 0.79698454 [26,] 0.2353691 0.4707382 0.76463089 [27,] 0.3847444 0.7694888 0.61525559 [28,] 0.8656797 0.2686406 0.13432028 [29,] 0.8232106 0.3535787 0.17678937 > postscript(file="/var/www/html/rcomp/tmp/1chf91228772020.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/2v8c51228772020.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/3yxac1228772020.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/4u9891228772020.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/5c99w1228772020.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 7 8 9 10 11 -12.60 -5.60 -13.80 -8.00 -5.40 0.60 5.40 0.28 2.28 3.08 2.68 12 13 14 15 16 17 18 19 20 21 22 1.68 5.40 3.40 9.20 4.00 3.60 3.60 -0.60 -7.72 -15.72 -14.92 23 24 25 26 27 28 29 30 31 32 33 -11.32 -9.32 -0.60 -2.60 -2.80 2.00 0.60 -3.40 -6.60 -2.72 1.28 34 35 36 37 38 39 40 41 42 43 44 -2.92 4.68 4.68 6.40 11.40 10.20 7.00 8.60 9.60 12.40 12.28 45 46 47 48 49 50 51 52 53 54 55 13.28 8.08 7.68 2.68 1.40 -6.60 -2.80 -5.00 -7.40 -10.40 -10.60 56 57 58 59 60 -2.12 -1.12 6.68 -3.72 0.28 > postscript(file="/var/www/html/rcomp/tmp/6nuhr1228772020.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 -12.60 NA 1 -5.60 -12.60 2 -13.80 -5.60 3 -8.00 -13.80 4 -5.40 -8.00 5 0.60 -5.40 6 5.40 0.60 7 0.28 5.40 8 2.28 0.28 9 3.08 2.28 10 2.68 3.08 11 1.68 2.68 12 5.40 1.68 13 3.40 5.40 14 9.20 3.40 15 4.00 9.20 16 3.60 4.00 17 3.60 3.60 18 -0.60 3.60 19 -7.72 -0.60 20 -15.72 -7.72 21 -14.92 -15.72 22 -11.32 -14.92 23 -9.32 -11.32 24 -0.60 -9.32 25 -2.60 -0.60 26 -2.80 -2.60 27 2.00 -2.80 28 0.60 2.00 29 -3.40 0.60 30 -6.60 -3.40 31 -2.72 -6.60 32 1.28 -2.72 33 -2.92 1.28 34 4.68 -2.92 35 4.68 4.68 36 6.40 4.68 37 11.40 6.40 38 10.20 11.40 39 7.00 10.20 40 8.60 7.00 41 9.60 8.60 42 12.40 9.60 43 12.28 12.40 44 13.28 12.28 45 8.08 13.28 46 7.68 8.08 47 2.68 7.68 48 1.40 2.68 49 -6.60 1.40 50 -2.80 -6.60 51 -5.00 -2.80 52 -7.40 -5.00 53 -10.40 -7.40 54 -10.60 -10.40 55 -2.12 -10.60 56 -1.12 -2.12 57 6.68 -1.12 58 -3.72 6.68 59 0.28 -3.72 60 NA 0.28 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5.60 -12.60 [2,] -13.80 -5.60 [3,] -8.00 -13.80 [4,] -5.40 -8.00 [5,] 0.60 -5.40 [6,] 5.40 0.60 [7,] 0.28 5.40 [8,] 2.28 0.28 [9,] 3.08 2.28 [10,] 2.68 3.08 [11,] 1.68 2.68 [12,] 5.40 1.68 [13,] 3.40 5.40 [14,] 9.20 3.40 [15,] 4.00 9.20 [16,] 3.60 4.00 [17,] 3.60 3.60 [18,] -0.60 3.60 [19,] -7.72 -0.60 [20,] -15.72 -7.72 [21,] -14.92 -15.72 [22,] -11.32 -14.92 [23,] -9.32 -11.32 [24,] -0.60 -9.32 [25,] -2.60 -0.60 [26,] -2.80 -2.60 [27,] 2.00 -2.80 [28,] 0.60 2.00 [29,] -3.40 0.60 [30,] -6.60 -3.40 [31,] -2.72 -6.60 [32,] 1.28 -2.72 [33,] -2.92 1.28 [34,] 4.68 -2.92 [35,] 4.68 4.68 [36,] 6.40 4.68 [37,] 11.40 6.40 [38,] 10.20 11.40 [39,] 7.00 10.20 [40,] 8.60 7.00 [41,] 9.60 8.60 [42,] 12.40 9.60 [43,] 12.28 12.40 [44,] 13.28 12.28 [45,] 8.08 13.28 [46,] 7.68 8.08 [47,] 2.68 7.68 [48,] 1.40 2.68 [49,] -6.60 1.40 [50,] -2.80 -6.60 [51,] -5.00 -2.80 [52,] -7.40 -5.00 [53,] -10.40 -7.40 [54,] -10.60 -10.40 [55,] -2.12 -10.60 [56,] -1.12 -2.12 [57,] 6.68 -1.12 [58,] -3.72 6.68 [59,] 0.28 -3.72 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5.60 -12.60 2 -13.80 -5.60 3 -8.00 -13.80 4 -5.40 -8.00 5 0.60 -5.40 6 5.40 0.60 7 0.28 5.40 8 2.28 0.28 9 3.08 2.28 10 2.68 3.08 11 1.68 2.68 12 5.40 1.68 13 3.40 5.40 14 9.20 3.40 15 4.00 9.20 16 3.60 4.00 17 3.60 3.60 18 -0.60 3.60 19 -7.72 -0.60 20 -15.72 -7.72 21 -14.92 -15.72 22 -11.32 -14.92 23 -9.32 -11.32 24 -0.60 -9.32 25 -2.60 -0.60 26 -2.80 -2.60 27 2.00 -2.80 28 0.60 2.00 29 -3.40 0.60 30 -6.60 -3.40 31 -2.72 -6.60 32 1.28 -2.72 33 -2.92 1.28 34 4.68 -2.92 35 4.68 4.68 36 6.40 4.68 37 11.40 6.40 38 10.20 11.40 39 7.00 10.20 40 8.60 7.00 41 9.60 8.60 42 12.40 9.60 43 12.28 12.40 44 13.28 12.28 45 8.08 13.28 46 7.68 8.08 47 2.68 7.68 48 1.40 2.68 49 -6.60 1.40 50 -2.80 -6.60 51 -5.00 -2.80 52 -7.40 -5.00 53 -10.40 -7.40 54 -10.60 -10.40 55 -2.12 -10.60 56 -1.12 -2.12 57 6.68 -1.12 58 -3.72 6.68 59 0.28 -3.72 > 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/7rrsv1228772020.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/8q3qm1228772020.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/93kch1228772020.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/10hgpg1228772020.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/11a9mz1228772020.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/12owol1228772020.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/13anzk1228772020.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/14jgzy1228772020.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/15vszo1228772020.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/16smto1228772020.tab") + } > > system("convert tmp/1chf91228772020.ps tmp/1chf91228772020.png") > system("convert tmp/2v8c51228772020.ps tmp/2v8c51228772020.png") > system("convert tmp/3yxac1228772020.ps tmp/3yxac1228772020.png") > system("convert tmp/4u9891228772020.ps tmp/4u9891228772020.png") > system("convert tmp/5c99w1228772020.ps tmp/5c99w1228772020.png") > system("convert tmp/6nuhr1228772020.ps tmp/6nuhr1228772020.png") > system("convert tmp/7rrsv1228772020.ps tmp/7rrsv1228772020.png") > system("convert tmp/8q3qm1228772020.ps tmp/8q3qm1228772020.png") > system("convert tmp/93kch1228772020.ps tmp/93kch1228772020.png") > system("convert tmp/10hgpg1228772020.ps tmp/10hgpg1228772020.png") > > > proc.time() user system elapsed 4.966 2.733 5.341