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. 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(519,0,517,0,510,0,509,0,501,0,507,0,569,0,580,0,578,0,565,0,547,0,555,0,562,0,561,0,555,0,544,0,537,0,543,0,594,0,611,0,613,0,611,0,594,0,595,0,591,0,589,0,584,0,573,0,567,0,569,0,621,0,629,0,628,0,612,0,595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,1,566,1,557,1,561,1,549,1,532,1,526,1,511,1,499,1,555,1,565,1,542,1,527,1,510,1,514,1,517,1,508,1,493,1,490,1,469,1,478,1,528,1,534,1,518,1,506,1),dim=c(2,70),dimnames=list(c('W','D'),1:70)) > y <- array(NA,dim=c(2,70),dimnames=list(c('W','D'),1:70)) > 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 W D 1 519 0 2 517 0 3 510 0 4 509 0 5 501 0 6 507 0 7 569 0 8 580 0 9 578 0 10 565 0 11 547 0 12 555 0 13 562 0 14 561 0 15 555 0 16 544 0 17 537 0 18 543 0 19 594 0 20 611 0 21 613 0 22 611 0 23 594 0 24 595 0 25 591 0 26 589 0 27 584 0 28 573 0 29 567 0 30 569 0 31 621 0 32 629 0 33 628 0 34 612 0 35 595 0 36 597 0 37 593 0 38 590 0 39 580 0 40 574 0 41 573 0 42 573 0 43 620 0 44 626 0 45 620 0 46 588 1 47 566 1 48 557 1 49 561 1 50 549 1 51 532 1 52 526 1 53 511 1 54 499 1 55 555 1 56 565 1 57 542 1 58 527 1 59 510 1 60 514 1 61 517 1 62 508 1 63 493 1 64 490 1 65 469 1 66 478 1 67 528 1 68 534 1 69 518 1 70 506 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D 575.13 -49.41 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -74.13 -19.22 0.78 21.37 62.28 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 575.133 4.947 116.255 < 2e-16 *** D -49.413 8.278 -5.969 9.63e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 33.19 on 68 degrees of freedom Multiple R-squared: 0.3438, Adjusted R-squared: 0.3342 F-statistic: 35.63 on 1 and 68 DF, p-value: 9.63e-08 > 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.03104549 0.06209099 0.96895451 [2,] 0.01028207 0.02056413 0.98971793 [3,] 0.47719339 0.95438678 0.52280661 [4,] 0.77549027 0.44901945 0.22450973 [5,] 0.85534065 0.28931870 0.14465935 [6,] 0.84683516 0.30632968 0.15316484 [7,] 0.80763376 0.38473248 0.19236624 [8,] 0.77204121 0.45591758 0.22795879 [9,] 0.74494833 0.51010334 0.25505167 [10,] 0.71247821 0.57504357 0.28752179 [11,] 0.67272486 0.65455028 0.32727514 [12,] 0.64603788 0.70792424 0.35396212 [13,] 0.65216789 0.69566422 0.34783211 [14,] 0.65534715 0.68930570 0.34465285 [15,] 0.76255090 0.47489820 0.23744910 [16,] 0.89008962 0.21982077 0.10991038 [17,] 0.94590953 0.10818094 0.05409047 [18,] 0.96704647 0.06590707 0.03295353 [19,] 0.96547069 0.06905861 0.03452931 [20,] 0.96287172 0.07425657 0.03712828 [21,] 0.95646623 0.08706755 0.04353377 [22,] 0.94719837 0.10560326 0.05280163 [23,] 0.93382366 0.13235268 0.06617634 [24,] 0.91865462 0.16269077 0.08134538 [25,] 0.90689411 0.18621178 0.09310589 [26,] 0.89510935 0.20978131 0.10489065 [27,] 0.92108751 0.15782499 0.07891249 [28,] 0.95041740 0.09916521 0.04958260 [29,] 0.96693630 0.06612741 0.03306370 [30,] 0.96525734 0.06948532 0.03474266 [31,] 0.95346240 0.09307520 0.04653760 [32,] 0.93909124 0.12181753 0.06090876 [33,] 0.91915077 0.16169847 0.08084923 [34,] 0.89331253 0.21337494 0.10668747 [35,] 0.86414241 0.27171518 0.13585759 [36,] 0.84026147 0.31947707 0.15973853 [37,] 0.82660030 0.34679940 0.17339970 [38,] 0.83662867 0.32674266 0.16337133 [39,] 0.82238697 0.35522607 0.17761303 [40,] 0.81223025 0.37553950 0.18776975 [41,] 0.78843897 0.42312206 0.21156103 [42,] 0.87679517 0.24640966 0.12320483 [43,] 0.89876011 0.20247977 0.10123989 [44,] 0.90559671 0.18880658 0.09440329 [45,] 0.92587474 0.14825051 0.07412526 [46,] 0.92764398 0.14471205 0.07235602 [47,] 0.90955567 0.18088865 0.09044433 [48,] 0.88194706 0.23610588 0.11805294 [49,] 0.84855770 0.30288460 0.15144230 [50,] 0.82653090 0.34693821 0.17346910 [51,] 0.85797180 0.28405640 0.14202820 [52,] 0.94647933 0.10704133 0.05352067 [53,] 0.95866444 0.08267112 0.04133556 [54,] 0.94873408 0.10253183 0.05126592 [55,] 0.91699338 0.16601323 0.08300662 [56,] 0.87282246 0.25435508 0.12717754 [57,] 0.81840280 0.36319441 0.18159720 [58,] 0.72949065 0.54101870 0.27050935 [59,] 0.62968278 0.74063444 0.37031722 [60,] 0.52289722 0.95420555 0.47710278 [61,] 0.63422000 0.73155999 0.36578000 > postscript(file="/var/www/html/rcomp/tmp/14yjx1227528274.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/2gbcp1227528274.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/32cwz1227528274.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/4gn3v1227528274.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/5flqs1227528274.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 = 70 Frequency = 1 1 2 3 4 5 6 7 -56.133333 -58.133333 -65.133333 -66.133333 -74.133333 -68.133333 -6.133333 8 9 10 11 12 13 14 4.866667 2.866667 -10.133333 -28.133333 -20.133333 -13.133333 -14.133333 15 16 17 18 19 20 21 -20.133333 -31.133333 -38.133333 -32.133333 18.866667 35.866667 37.866667 22 23 24 25 26 27 28 35.866667 18.866667 19.866667 15.866667 13.866667 8.866667 -2.133333 29 30 31 32 33 34 35 -8.133333 -6.133333 45.866667 53.866667 52.866667 36.866667 19.866667 36 37 38 39 40 41 42 21.866667 17.866667 14.866667 4.866667 -1.133333 -2.133333 -2.133333 43 44 45 46 47 48 49 44.866667 50.866667 44.866667 62.280000 40.280000 31.280000 35.280000 50 51 52 53 54 55 56 23.280000 6.280000 0.280000 -14.720000 -26.720000 29.280000 39.280000 57 58 59 60 61 62 63 16.280000 1.280000 -15.720000 -11.720000 -8.720000 -17.720000 -32.720000 64 65 66 67 68 69 70 -35.720000 -56.720000 -47.720000 2.280000 8.280000 -7.720000 -19.720000 > postscript(file="/var/www/html/rcomp/tmp/6ztye1227528275.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 = 70 Frequency = 1 lag(myerror, k = 1) myerror 0 -56.133333 NA 1 -58.133333 -56.133333 2 -65.133333 -58.133333 3 -66.133333 -65.133333 4 -74.133333 -66.133333 5 -68.133333 -74.133333 6 -6.133333 -68.133333 7 4.866667 -6.133333 8 2.866667 4.866667 9 -10.133333 2.866667 10 -28.133333 -10.133333 11 -20.133333 -28.133333 12 -13.133333 -20.133333 13 -14.133333 -13.133333 14 -20.133333 -14.133333 15 -31.133333 -20.133333 16 -38.133333 -31.133333 17 -32.133333 -38.133333 18 18.866667 -32.133333 19 35.866667 18.866667 20 37.866667 35.866667 21 35.866667 37.866667 22 18.866667 35.866667 23 19.866667 18.866667 24 15.866667 19.866667 25 13.866667 15.866667 26 8.866667 13.866667 27 -2.133333 8.866667 28 -8.133333 -2.133333 29 -6.133333 -8.133333 30 45.866667 -6.133333 31 53.866667 45.866667 32 52.866667 53.866667 33 36.866667 52.866667 34 19.866667 36.866667 35 21.866667 19.866667 36 17.866667 21.866667 37 14.866667 17.866667 38 4.866667 14.866667 39 -1.133333 4.866667 40 -2.133333 -1.133333 41 -2.133333 -2.133333 42 44.866667 -2.133333 43 50.866667 44.866667 44 44.866667 50.866667 45 62.280000 44.866667 46 40.280000 62.280000 47 31.280000 40.280000 48 35.280000 31.280000 49 23.280000 35.280000 50 6.280000 23.280000 51 0.280000 6.280000 52 -14.720000 0.280000 53 -26.720000 -14.720000 54 29.280000 -26.720000 55 39.280000 29.280000 56 16.280000 39.280000 57 1.280000 16.280000 58 -15.720000 1.280000 59 -11.720000 -15.720000 60 -8.720000 -11.720000 61 -17.720000 -8.720000 62 -32.720000 -17.720000 63 -35.720000 -32.720000 64 -56.720000 -35.720000 65 -47.720000 -56.720000 66 2.280000 -47.720000 67 8.280000 2.280000 68 -7.720000 8.280000 69 -19.720000 -7.720000 70 NA -19.720000 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -58.133333 -56.133333 [2,] -65.133333 -58.133333 [3,] -66.133333 -65.133333 [4,] -74.133333 -66.133333 [5,] -68.133333 -74.133333 [6,] -6.133333 -68.133333 [7,] 4.866667 -6.133333 [8,] 2.866667 4.866667 [9,] -10.133333 2.866667 [10,] -28.133333 -10.133333 [11,] -20.133333 -28.133333 [12,] -13.133333 -20.133333 [13,] -14.133333 -13.133333 [14,] -20.133333 -14.133333 [15,] -31.133333 -20.133333 [16,] -38.133333 -31.133333 [17,] -32.133333 -38.133333 [18,] 18.866667 -32.133333 [19,] 35.866667 18.866667 [20,] 37.866667 35.866667 [21,] 35.866667 37.866667 [22,] 18.866667 35.866667 [23,] 19.866667 18.866667 [24,] 15.866667 19.866667 [25,] 13.866667 15.866667 [26,] 8.866667 13.866667 [27,] -2.133333 8.866667 [28,] -8.133333 -2.133333 [29,] -6.133333 -8.133333 [30,] 45.866667 -6.133333 [31,] 53.866667 45.866667 [32,] 52.866667 53.866667 [33,] 36.866667 52.866667 [34,] 19.866667 36.866667 [35,] 21.866667 19.866667 [36,] 17.866667 21.866667 [37,] 14.866667 17.866667 [38,] 4.866667 14.866667 [39,] -1.133333 4.866667 [40,] -2.133333 -1.133333 [41,] -2.133333 -2.133333 [42,] 44.866667 -2.133333 [43,] 50.866667 44.866667 [44,] 44.866667 50.866667 [45,] 62.280000 44.866667 [46,] 40.280000 62.280000 [47,] 31.280000 40.280000 [48,] 35.280000 31.280000 [49,] 23.280000 35.280000 [50,] 6.280000 23.280000 [51,] 0.280000 6.280000 [52,] -14.720000 0.280000 [53,] -26.720000 -14.720000 [54,] 29.280000 -26.720000 [55,] 39.280000 29.280000 [56,] 16.280000 39.280000 [57,] 1.280000 16.280000 [58,] -15.720000 1.280000 [59,] -11.720000 -15.720000 [60,] -8.720000 -11.720000 [61,] -17.720000 -8.720000 [62,] -32.720000 -17.720000 [63,] -35.720000 -32.720000 [64,] -56.720000 -35.720000 [65,] -47.720000 -56.720000 [66,] 2.280000 -47.720000 [67,] 8.280000 2.280000 [68,] -7.720000 8.280000 [69,] -19.720000 -7.720000 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -58.133333 -56.133333 2 -65.133333 -58.133333 3 -66.133333 -65.133333 4 -74.133333 -66.133333 5 -68.133333 -74.133333 6 -6.133333 -68.133333 7 4.866667 -6.133333 8 2.866667 4.866667 9 -10.133333 2.866667 10 -28.133333 -10.133333 11 -20.133333 -28.133333 12 -13.133333 -20.133333 13 -14.133333 -13.133333 14 -20.133333 -14.133333 15 -31.133333 -20.133333 16 -38.133333 -31.133333 17 -32.133333 -38.133333 18 18.866667 -32.133333 19 35.866667 18.866667 20 37.866667 35.866667 21 35.866667 37.866667 22 18.866667 35.866667 23 19.866667 18.866667 24 15.866667 19.866667 25 13.866667 15.866667 26 8.866667 13.866667 27 -2.133333 8.866667 28 -8.133333 -2.133333 29 -6.133333 -8.133333 30 45.866667 -6.133333 31 53.866667 45.866667 32 52.866667 53.866667 33 36.866667 52.866667 34 19.866667 36.866667 35 21.866667 19.866667 36 17.866667 21.866667 37 14.866667 17.866667 38 4.866667 14.866667 39 -1.133333 4.866667 40 -2.133333 -1.133333 41 -2.133333 -2.133333 42 44.866667 -2.133333 43 50.866667 44.866667 44 44.866667 50.866667 45 62.280000 44.866667 46 40.280000 62.280000 47 31.280000 40.280000 48 35.280000 31.280000 49 23.280000 35.280000 50 6.280000 23.280000 51 0.280000 6.280000 52 -14.720000 0.280000 53 -26.720000 -14.720000 54 29.280000 -26.720000 55 39.280000 29.280000 56 16.280000 39.280000 57 1.280000 16.280000 58 -15.720000 1.280000 59 -11.720000 -15.720000 60 -8.720000 -11.720000 61 -17.720000 -8.720000 62 -32.720000 -17.720000 63 -35.720000 -32.720000 64 -56.720000 -35.720000 65 -47.720000 -56.720000 66 2.280000 -47.720000 67 8.280000 2.280000 68 -7.720000 8.280000 69 -19.720000 -7.720000 > 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/7v3kx1227528275.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/8dzq31227528275.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/9vtcw1227528275.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/10cddo1227528275.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/11zddh1227528275.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/12lvl71227528275.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/1326j11227528275.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/14d8kt1227528275.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/15gkiz1227528275.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/16xp891227528275.tab") + } > > system("convert tmp/14yjx1227528274.ps tmp/14yjx1227528274.png") > system("convert tmp/2gbcp1227528274.ps tmp/2gbcp1227528274.png") > system("convert tmp/32cwz1227528274.ps tmp/32cwz1227528274.png") > system("convert tmp/4gn3v1227528274.ps tmp/4gn3v1227528274.png") > system("convert tmp/5flqs1227528274.ps tmp/5flqs1227528274.png") > system("convert tmp/6ztye1227528275.ps tmp/6ztye1227528275.png") > system("convert tmp/7v3kx1227528275.ps tmp/7v3kx1227528275.png") > system("convert tmp/8dzq31227528275.ps tmp/8dzq31227528275.png") > system("convert tmp/9vtcw1227528275.ps tmp/9vtcw1227528275.png") > system("convert tmp/10cddo1227528275.ps tmp/10cddo1227528275.png") > > > proc.time() user system elapsed 2.516 1.539 3.002