R version 2.8.0 (2008-10-20) 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. Natural language support but running in an English locale 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(16198.9 + ,16896.2 + ,0 + ,0 + ,16554.2 + ,16698.00 + ,0 + ,0 + ,19554.2 + ,19691.6 + ,0 + ,0 + ,15903.8 + ,15930.7 + ,0 + ,0 + ,18003.8 + ,17444.6 + ,0 + ,0 + ,18329.6 + ,17699.4 + ,0 + ,0 + ,16260.7 + ,15189.8 + ,0 + ,0 + ,14851.9 + ,15672.7 + ,0 + ,0 + ,18174.1 + ,17180.8 + ,0 + ,0 + ,18406.6 + ,17664.9 + ,0 + ,0 + ,18466.5 + ,17862.9 + ,0 + ,0 + ,16016.5 + ,16162.3 + ,0 + ,0 + ,17428.5 + ,17463.6 + ,0 + ,0 + ,17167.2 + ,16772.1 + ,0 + ,0 + ,19630.00 + ,19106.9 + ,0 + ,0 + ,17183.6 + ,16721.3 + ,0 + ,0 + ,18344.7 + ,18161.3 + ,0 + ,0 + ,19301.4 + ,18509.9 + ,0 + ,0 + ,18147.5 + ,17802.7 + ,0 + ,0 + ,16192.9 + ,16409.9 + ,0 + ,0 + ,18374.4 + ,17967.7 + ,0 + ,0 + ,20515.2 + ,20286.6 + ,0 + ,0 + ,18957.2 + ,19537.3 + ,0 + ,0 + ,16471.5 + ,18021.9 + ,0 + ,0 + ,18746.8 + ,20194.3 + ,0 + ,0 + ,19009.5 + ,19049.6 + ,0 + ,0 + ,19211.2 + ,20244.7 + ,0 + ,0 + ,20547.7 + ,21473.3 + ,0 + ,0 + ,19325.8 + ,19673.6 + ,0 + ,0 + ,20605.5 + ,21053.2 + ,0 + ,0 + ,20056.9 + ,20159.5 + ,0 + ,0 + ,16141.4 + ,18203.6 + ,0 + ,0 + ,20359.8 + ,21289.5 + ,0 + ,0 + ,19711.6 + ,20432.3 + ,1 + ,20432.3 + ,15638.6 + ,17180.4 + ,1 + ,17180.4 + ,14384.5 + ,15816.8 + ,1 + ,15816.8 + ,13855.6 + ,15071.8 + ,1 + ,15071.8 + ,14308.3 + ,14521.1 + ,1 + ,14521.1 + ,15290.6 + ,15668.8 + ,1 + ,15668.8 + ,14423.8 + ,14346.9 + ,1 + ,14346.9 + ,13779.7 + ,13881.00 + ,1 + ,13881.00 + ,15686.3 + ,15465.9 + ,1 + ,15465.9 + ,14733.8 + ,14238.2 + ,1 + ,14238.2 + ,12522.5 + ,13557.7 + ,1 + ,13557.7 + ,16189.4 + ,16127.6 + ,1 + ,16127.6 + ,16059.1 + ,16793.9 + ,1 + ,16793.9 + ,16007.1 + ,16014.00 + ,1 + ,16014.00 + ,15806.8 + ,16867.9 + ,1 + ,16867.9 + ,15160.00 + ,16014.6 + ,0 + ,0 + ,15692.1 + ,15878.6 + ,0 + ,0 + ,18908.9 + ,18664.9 + ,0 + ,0 + ,16969.9 + ,17962.5 + ,0 + ,0 + ,16997.5 + ,17332.7 + ,0 + ,0 + ,19858.9 + ,19542.1 + ,0 + ,0 + ,17681.2 + ,17203.6 + ,0 + ,0) + ,dim=c(4 + ,55) + ,dimnames=list(c('uitvoer' + ,'invoer' + ,'crisis' + ,'invoerXcrisis') + ,1:55)) > y <- array(NA,dim=c(4,55),dimnames=list(c('uitvoer','invoer','crisis','invoerXcrisis'),1:55)) > 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 uitvoer invoer crisis invoerXcrisis 1 16198.9 16896.2 0 0.0 2 16554.2 16698.0 0 0.0 3 19554.2 19691.6 0 0.0 4 15903.8 15930.7 0 0.0 5 18003.8 17444.6 0 0.0 6 18329.6 17699.4 0 0.0 7 16260.7 15189.8 0 0.0 8 14851.9 15672.7 0 0.0 9 18174.1 17180.8 0 0.0 10 18406.6 17664.9 0 0.0 11 18466.5 17862.9 0 0.0 12 16016.5 16162.3 0 0.0 13 17428.5 17463.6 0 0.0 14 17167.2 16772.1 0 0.0 15 19630.0 19106.9 0 0.0 16 17183.6 16721.3 0 0.0 17 18344.7 18161.3 0 0.0 18 19301.4 18509.9 0 0.0 19 18147.5 17802.7 0 0.0 20 16192.9 16409.9 0 0.0 21 18374.4 17967.7 0 0.0 22 20515.2 20286.6 0 0.0 23 18957.2 19537.3 0 0.0 24 16471.5 18021.9 0 0.0 25 18746.8 20194.3 0 0.0 26 19009.5 19049.6 0 0.0 27 19211.2 20244.7 0 0.0 28 20547.7 21473.3 0 0.0 29 19325.8 19673.6 0 0.0 30 20605.5 21053.2 0 0.0 31 20056.9 20159.5 0 0.0 32 16141.4 18203.6 0 0.0 33 20359.8 21289.5 0 0.0 34 19711.6 20432.3 1 20432.3 35 15638.6 17180.4 1 17180.4 36 14384.5 15816.8 1 15816.8 37 13855.6 15071.8 1 15071.8 38 14308.3 14521.1 1 14521.1 39 15290.6 15668.8 1 15668.8 40 14423.8 14346.9 1 14346.9 41 13779.7 13881.0 1 13881.0 42 15686.3 15465.9 1 15465.9 43 14733.8 14238.2 1 14238.2 44 12522.5 13557.7 1 13557.7 45 16189.4 16127.6 1 16127.6 46 16059.1 16793.9 1 16793.9 47 16007.1 16014.0 1 16014.0 48 15806.8 16867.9 1 16867.9 49 15160.0 16014.6 0 0.0 50 15692.1 15878.6 0 0.0 51 18908.9 18664.9 0 0.0 52 16969.9 17962.5 0 0.0 53 16997.5 17332.7 0 0.0 54 19858.9 19542.1 0 0.0 55 17681.2 17203.6 0 0.0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) invoer crisis invoerXcrisis 2.114e+03 8.763e-01 -6.749e+02 5.894e-05 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1924.7 -397.0 143.2 524.4 1004.3 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.114e+03 1.217e+03 1.737 0.0883 . invoer 8.763e-01 6.689e-02 13.101 <2e-16 *** crisis -6.749e+02 2.086e+03 -0.323 0.7476 invoerXcrisis 5.894e-05 1.263e-01 0.000467 0.9996 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 687 on 51 degrees of freedom Multiple R-squared: 0.8907, Adjusted R-squared: 0.8842 F-statistic: 138.5 on 3 and 51 DF, p-value: < 2.2e-16 > 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.7191522 0.5616957 0.2808478 [2,] 0.7970640 0.4058719 0.2029360 [3,] 0.8231845 0.3536309 0.1768155 [4,] 0.7893489 0.4213022 0.2106511 [5,] 0.7304451 0.5391098 0.2695549 [6,] 0.6475586 0.7048827 0.3524414 [7,] 0.5538935 0.8922131 0.4461065 [8,] 0.4654605 0.9309210 0.5345395 [9,] 0.4038531 0.8077062 0.5961469 [10,] 0.3378109 0.6756218 0.6621891 [11,] 0.2664524 0.5329048 0.7335476 [12,] 0.2779636 0.5559273 0.7220364 [13,] 0.2295158 0.4590316 0.7704842 [14,] 0.1858500 0.3717000 0.8141500 [15,] 0.1606565 0.3213129 0.8393435 [16,] 0.1440003 0.2880005 0.8559997 [17,] 0.1738623 0.3477247 0.8261377 [18,] 0.5051688 0.9896624 0.4948312 [19,] 0.6730225 0.6539549 0.3269775 [20,] 0.6117327 0.7765346 0.3882673 [21,] 0.6038020 0.7923959 0.3961980 [22,] 0.5510628 0.8978744 0.4489372 [23,] 0.4685114 0.9370228 0.5314886 [24,] 0.3862952 0.7725905 0.6137048 [25,] 0.3253362 0.6506723 0.6746638 [26,] 0.7727030 0.4545939 0.2272970 [27,] 0.7900573 0.4198854 0.2099427 [28,] 0.7576992 0.4846015 0.2423008 [29,] 0.7487545 0.5024910 0.2512455 [30,] 0.7998456 0.4003089 0.2001544 [31,] 0.8492430 0.3015140 0.1507570 [32,] 0.8204437 0.3591126 0.1795563 [33,] 0.7613681 0.4772639 0.2386319 [34,] 0.7090955 0.5818089 0.2909045 [35,] 0.6204828 0.7590343 0.3795172 [36,] 0.5966417 0.8067165 0.4033583 [37,] 0.6966094 0.6067811 0.3033906 [38,] 0.8463753 0.3072494 0.1536247 [39,] 0.7662415 0.4675170 0.2337585 [40,] 0.6521351 0.6957297 0.3478649 [41,] 0.5075865 0.9848271 0.4924135 [42,] 0.3451929 0.6903858 0.6548071 > postscript(file="/var/www/html/freestat/rcomp/tmp/1zxwq1290673332.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/freestat/rcomp/tmp/2zxwq1290673332.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/freestat/rcomp/tmp/3rova1290673332.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/freestat/rcomp/tmp/4rova1290673332.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/freestat/rcomp/tmp/5rova1290673332.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 = 55 Frequency = 1 1 2 3 4 5 6 -721.48449 -192.50177 184.20570 -170.51657 602.85244 705.37112 7 8 9 10 11 12 835.63431 -996.33110 1004.32045 812.60348 698.99603 -260.76771 13 14 15 16 17 18 10.90273 355.56437 772.37848 416.48043 315.70802 966.92975 19 20 21 22 23 24 432.74930 -301.33966 515.05976 623.80704 -277.58116 -1435.33572 25 26 27 28 29 30 -1063.71045 202.09048 -643.47598 -383.59851 -28.42089 42.33524 31 32 33 34 35 36 276.88480 -1924.65948 -410.43452 366.18666 -856.98080 -916.07737 37 38 39 40 41 42 -792.08976 143.22127 119.72379 411.38304 175.57880 693.23708 43 44 45 46 47 48 816.64329 -798.29427 616.45018 -97.76796 533.70459 -414.91854 49 50 51 52 53 54 -987.83816 -336.56132 438.60320 -884.88348 -305.38956 619.91260 55 491.44080 > postscript(file="/var/www/html/freestat/rcomp/tmp/6kfuv1290673332.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 = 55 Frequency = 1 lag(myerror, k = 1) myerror 0 -721.48449 NA 1 -192.50177 -721.48449 2 184.20570 -192.50177 3 -170.51657 184.20570 4 602.85244 -170.51657 5 705.37112 602.85244 6 835.63431 705.37112 7 -996.33110 835.63431 8 1004.32045 -996.33110 9 812.60348 1004.32045 10 698.99603 812.60348 11 -260.76771 698.99603 12 10.90273 -260.76771 13 355.56437 10.90273 14 772.37848 355.56437 15 416.48043 772.37848 16 315.70802 416.48043 17 966.92975 315.70802 18 432.74930 966.92975 19 -301.33966 432.74930 20 515.05976 -301.33966 21 623.80704 515.05976 22 -277.58116 623.80704 23 -1435.33572 -277.58116 24 -1063.71045 -1435.33572 25 202.09048 -1063.71045 26 -643.47598 202.09048 27 -383.59851 -643.47598 28 -28.42089 -383.59851 29 42.33524 -28.42089 30 276.88480 42.33524 31 -1924.65948 276.88480 32 -410.43452 -1924.65948 33 366.18666 -410.43452 34 -856.98080 366.18666 35 -916.07737 -856.98080 36 -792.08976 -916.07737 37 143.22127 -792.08976 38 119.72379 143.22127 39 411.38304 119.72379 40 175.57880 411.38304 41 693.23708 175.57880 42 816.64329 693.23708 43 -798.29427 816.64329 44 616.45018 -798.29427 45 -97.76796 616.45018 46 533.70459 -97.76796 47 -414.91854 533.70459 48 -987.83816 -414.91854 49 -336.56132 -987.83816 50 438.60320 -336.56132 51 -884.88348 438.60320 52 -305.38956 -884.88348 53 619.91260 -305.38956 54 491.44080 619.91260 55 NA 491.44080 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -192.50177 -721.48449 [2,] 184.20570 -192.50177 [3,] -170.51657 184.20570 [4,] 602.85244 -170.51657 [5,] 705.37112 602.85244 [6,] 835.63431 705.37112 [7,] -996.33110 835.63431 [8,] 1004.32045 -996.33110 [9,] 812.60348 1004.32045 [10,] 698.99603 812.60348 [11,] -260.76771 698.99603 [12,] 10.90273 -260.76771 [13,] 355.56437 10.90273 [14,] 772.37848 355.56437 [15,] 416.48043 772.37848 [16,] 315.70802 416.48043 [17,] 966.92975 315.70802 [18,] 432.74930 966.92975 [19,] -301.33966 432.74930 [20,] 515.05976 -301.33966 [21,] 623.80704 515.05976 [22,] -277.58116 623.80704 [23,] -1435.33572 -277.58116 [24,] -1063.71045 -1435.33572 [25,] 202.09048 -1063.71045 [26,] -643.47598 202.09048 [27,] -383.59851 -643.47598 [28,] -28.42089 -383.59851 [29,] 42.33524 -28.42089 [30,] 276.88480 42.33524 [31,] -1924.65948 276.88480 [32,] -410.43452 -1924.65948 [33,] 366.18666 -410.43452 [34,] -856.98080 366.18666 [35,] -916.07737 -856.98080 [36,] -792.08976 -916.07737 [37,] 143.22127 -792.08976 [38,] 119.72379 143.22127 [39,] 411.38304 119.72379 [40,] 175.57880 411.38304 [41,] 693.23708 175.57880 [42,] 816.64329 693.23708 [43,] -798.29427 816.64329 [44,] 616.45018 -798.29427 [45,] -97.76796 616.45018 [46,] 533.70459 -97.76796 [47,] -414.91854 533.70459 [48,] -987.83816 -414.91854 [49,] -336.56132 -987.83816 [50,] 438.60320 -336.56132 [51,] -884.88348 438.60320 [52,] -305.38956 -884.88348 [53,] 619.91260 -305.38956 [54,] 491.44080 619.91260 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -192.50177 -721.48449 2 184.20570 -192.50177 3 -170.51657 184.20570 4 602.85244 -170.51657 5 705.37112 602.85244 6 835.63431 705.37112 7 -996.33110 835.63431 8 1004.32045 -996.33110 9 812.60348 1004.32045 10 698.99603 812.60348 11 -260.76771 698.99603 12 10.90273 -260.76771 13 355.56437 10.90273 14 772.37848 355.56437 15 416.48043 772.37848 16 315.70802 416.48043 17 966.92975 315.70802 18 432.74930 966.92975 19 -301.33966 432.74930 20 515.05976 -301.33966 21 623.80704 515.05976 22 -277.58116 623.80704 23 -1435.33572 -277.58116 24 -1063.71045 -1435.33572 25 202.09048 -1063.71045 26 -643.47598 202.09048 27 -383.59851 -643.47598 28 -28.42089 -383.59851 29 42.33524 -28.42089 30 276.88480 42.33524 31 -1924.65948 276.88480 32 -410.43452 -1924.65948 33 366.18666 -410.43452 34 -856.98080 366.18666 35 -916.07737 -856.98080 36 -792.08976 -916.07737 37 143.22127 -792.08976 38 119.72379 143.22127 39 411.38304 119.72379 40 175.57880 411.38304 41 693.23708 175.57880 42 816.64329 693.23708 43 -798.29427 816.64329 44 616.45018 -798.29427 45 -97.76796 616.45018 46 533.70459 -97.76796 47 -414.91854 533.70459 48 -987.83816 -414.91854 49 -336.56132 -987.83816 50 438.60320 -336.56132 51 -884.88348 438.60320 52 -305.38956 -884.88348 53 619.91260 -305.38956 54 491.44080 619.91260 > 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/freestat/rcomp/tmp/7d6by1290673332.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/freestat/rcomp/tmp/8d6by1290673332.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/freestat/rcomp/tmp/9d6by1290673332.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/freestat/rcomp/tmp/10nxt11290673332.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11rg9p1290673332.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/freestat/rcomp/tmp/12cyqd1290673332.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/freestat/rcomp/tmp/13885m1290673332.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/freestat/rcomp/tmp/14cr491290673332.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/freestat/rcomp/tmp/15x93f1290673332.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/freestat/rcomp/tmp/16iaj31290673332.tab") + } > > try(system("convert tmp/1zxwq1290673332.ps tmp/1zxwq1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/2zxwq1290673332.ps tmp/2zxwq1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/3rova1290673332.ps tmp/3rova1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/4rova1290673332.ps tmp/4rova1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/5rova1290673332.ps tmp/5rova1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/6kfuv1290673332.ps tmp/6kfuv1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/7d6by1290673332.ps tmp/7d6by1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/8d6by1290673332.ps tmp/8d6by1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/9d6by1290673332.ps tmp/9d6by1290673332.png",intern=TRUE)) character(0) > try(system("convert tmp/10nxt11290673332.ps tmp/10nxt11290673332.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.908 2.552 4.691