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(562,13.9,561,15.9,555,18.2,544,19.7,537,20.1,543,19.9,594,20,611,22.6,613,20.6,611,20.1,594,20.2,595,21.8,591,22,589,19.5,584,17.5,573,18.2,567,18.8,569,19.7,621,18.8,629,18.5,628,18.7,612,18.5,595,19.3,597,18.9,593,21.4,590,22.5,580,25,574,22.9,573,22.9,573,21.3,620,22.3,626,20.9,620,19.9,588,20.2,566,19.8,557,17.7,561,18.1,549,17.6,532,18.2,526,16,511,16.3,499,17.3,555,19,565,18.6,542,18,527,17.9,510,17.8,514,18.5,517,17.4,508,19,493,17.4,490,20.6,469,18.5,478,20,528,18.8,534,18.8,518,19.7,506,15.3,502,10.6,516,6.1,528,0.9),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),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 Y X 1 562 13.9 2 561 15.9 3 555 18.2 4 544 19.7 5 537 20.1 6 543 19.9 7 594 20.0 8 611 22.6 9 613 20.6 10 611 20.1 11 594 20.2 12 595 21.8 13 591 22.0 14 589 19.5 15 584 17.5 16 573 18.2 17 567 18.8 18 569 19.7 19 621 18.8 20 629 18.5 21 628 18.7 22 612 18.5 23 595 19.3 24 597 18.9 25 593 21.4 26 590 22.5 27 580 25.0 28 574 22.9 29 573 22.9 30 573 21.3 31 620 22.3 32 626 20.9 33 620 19.9 34 588 20.2 35 566 19.8 36 557 17.7 37 561 18.1 38 549 17.6 39 532 18.2 40 526 16.0 41 511 16.3 42 499 17.3 43 555 19.0 44 565 18.6 45 542 18.0 46 527 17.9 47 510 17.8 48 514 18.5 49 517 17.4 50 508 19.0 51 493 17.4 52 490 20.6 53 469 18.5 54 478 20.0 55 528 18.8 56 534 18.8 57 518 19.7 58 506 15.3 59 502 10.6 60 516 6.1 61 528 0.9 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 474.520 4.554 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -89.774 -26.140 1.869 27.484 70.226 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 474.520 26.060 18.209 < 2e-16 *** X 4.554 1.375 3.311 0.00159 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 38.73 on 59 degrees of freedom Multiple R-squared: 0.1567, Adjusted R-squared: 0.1424 F-statistic: 10.96 on 1 and 59 DF, p-value: 0.001590 > 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.0029933030 0.0059866059 0.99700670 [2,] 0.0003143823 0.0006287646 0.99968562 [3,] 0.0667740025 0.1335480050 0.93322600 [4,] 0.1457555647 0.2915111294 0.85424444 [5,] 0.1805198493 0.3610396987 0.81948015 [6,] 0.1849333504 0.3698667007 0.81506665 [7,] 0.1302397591 0.2604795183 0.86976024 [8,] 0.0826842739 0.1653685478 0.91731573 [9,] 0.0493985559 0.0987971118 0.95060144 [10,] 0.0310960079 0.0621920157 0.96890399 [11,] 0.0208907221 0.0417814443 0.97910928 [12,] 0.0114322990 0.0228645980 0.98856770 [13,] 0.0062009090 0.0124018181 0.99379909 [14,] 0.0033433418 0.0066866835 0.99665666 [15,] 0.0087165913 0.0174331825 0.99128341 [16,] 0.0279014305 0.0558028611 0.97209857 [17,] 0.0615776613 0.1231553227 0.93842234 [18,] 0.0753034799 0.1506069597 0.92469652 [19,] 0.0628692846 0.1257385691 0.93713072 [20,] 0.0566738966 0.1133477932 0.94332610 [21,] 0.0443019571 0.0886039141 0.95569804 [22,] 0.0336421861 0.0672843723 0.96635781 [23,] 0.0260873440 0.0521746879 0.97391266 [24,] 0.0195362963 0.0390725926 0.98046370 [25,] 0.0143400482 0.0286800965 0.98565995 [26,] 0.0104762727 0.0209525455 0.98952373 [27,] 0.0224935745 0.0449871491 0.97750643 [28,] 0.0851535323 0.1703070647 0.91484647 [29,] 0.2856851531 0.5713703062 0.71431485 [30,] 0.4141290765 0.8282581531 0.58587092 [31,] 0.4848015025 0.9696030050 0.51519850 [32,] 0.5367166010 0.9265667980 0.46328340 [33,] 0.6216732944 0.7566534112 0.37832671 [34,] 0.6718670522 0.6562658956 0.32813295 [35,] 0.7051885536 0.5896228929 0.29481145 [36,] 0.7024768968 0.5950462064 0.29752310 [37,] 0.7175747903 0.5648504194 0.28242521 [38,] 0.7736748353 0.4526503294 0.22632516 [39,] 0.8315249578 0.3369500845 0.16847504 [40,] 0.9456916931 0.1086166138 0.05430831 [41,] 0.9669184972 0.0661630056 0.03308150 [42,] 0.9678745661 0.0642508677 0.03212543 [43,] 0.9590187957 0.0819624087 0.04098120 [44,] 0.9490678879 0.1018642243 0.05093211 [45,] 0.9323125525 0.1353748951 0.06768745 [46,] 0.9119645083 0.1760709833 0.08803549 [47,] 0.8870195245 0.2259609510 0.11298048 [48,] 0.8739960660 0.2520078680 0.12600393 [49,] 0.9473091246 0.1053817508 0.05269088 [50,] 0.9888578260 0.0222843480 0.01114217 [51,] 0.9716418754 0.0567162492 0.02835812 [52,] 0.9734878729 0.0530242542 0.02651213 > postscript(file="/var/www/html/rcomp/tmp/1d4rs1258757154.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/2bwit1258757154.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/3m4la1258757154.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/47dgp1258757154.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/513441258757154.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 7 24.175581 14.067032 -2.407798 -20.239210 -29.060920 -22.150065 28.394508 8 9 10 11 12 13 14 33.553395 44.661943 44.939080 27.483653 21.196814 16.285959 25.671645 15 16 17 18 19 20 21 29.780194 15.592202 6.859637 4.760790 60.859637 70.225919 68.315064 22 23 24 25 26 27 28 53.225919 32.582500 36.404210 21.018524 13.008822 -8.376864 -4.812888 29 30 31 32 33 34 35 -5.812888 1.473951 43.919677 56.295661 54.849935 21.483653 1.305363 36 37 38 39 40 41 42 1.869339 4.047629 -5.675234 -25.407798 -21.388395 -37.754677 -54.308952 43 44 45 46 47 48 49 -6.051218 5.770492 -14.496944 -29.041516 -45.586089 -44.774081 -36.764379 50 51 52 53 54 55 56 -53.051218 -60.764379 -78.338057 -89.774081 -87.605492 -32.140363 -26.140363 57 58 59 60 61 -46.239210 -38.200403 -20.795314 13.698921 49.381147 > postscript(file="/var/www/html/rcomp/tmp/682oe1258757154.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 24.175581 NA 1 14.067032 24.175581 2 -2.407798 14.067032 3 -20.239210 -2.407798 4 -29.060920 -20.239210 5 -22.150065 -29.060920 6 28.394508 -22.150065 7 33.553395 28.394508 8 44.661943 33.553395 9 44.939080 44.661943 10 27.483653 44.939080 11 21.196814 27.483653 12 16.285959 21.196814 13 25.671645 16.285959 14 29.780194 25.671645 15 15.592202 29.780194 16 6.859637 15.592202 17 4.760790 6.859637 18 60.859637 4.760790 19 70.225919 60.859637 20 68.315064 70.225919 21 53.225919 68.315064 22 32.582500 53.225919 23 36.404210 32.582500 24 21.018524 36.404210 25 13.008822 21.018524 26 -8.376864 13.008822 27 -4.812888 -8.376864 28 -5.812888 -4.812888 29 1.473951 -5.812888 30 43.919677 1.473951 31 56.295661 43.919677 32 54.849935 56.295661 33 21.483653 54.849935 34 1.305363 21.483653 35 1.869339 1.305363 36 4.047629 1.869339 37 -5.675234 4.047629 38 -25.407798 -5.675234 39 -21.388395 -25.407798 40 -37.754677 -21.388395 41 -54.308952 -37.754677 42 -6.051218 -54.308952 43 5.770492 -6.051218 44 -14.496944 5.770492 45 -29.041516 -14.496944 46 -45.586089 -29.041516 47 -44.774081 -45.586089 48 -36.764379 -44.774081 49 -53.051218 -36.764379 50 -60.764379 -53.051218 51 -78.338057 -60.764379 52 -89.774081 -78.338057 53 -87.605492 -89.774081 54 -32.140363 -87.605492 55 -26.140363 -32.140363 56 -46.239210 -26.140363 57 -38.200403 -46.239210 58 -20.795314 -38.200403 59 13.698921 -20.795314 60 49.381147 13.698921 61 NA 49.381147 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 14.067032 24.175581 [2,] -2.407798 14.067032 [3,] -20.239210 -2.407798 [4,] -29.060920 -20.239210 [5,] -22.150065 -29.060920 [6,] 28.394508 -22.150065 [7,] 33.553395 28.394508 [8,] 44.661943 33.553395 [9,] 44.939080 44.661943 [10,] 27.483653 44.939080 [11,] 21.196814 27.483653 [12,] 16.285959 21.196814 [13,] 25.671645 16.285959 [14,] 29.780194 25.671645 [15,] 15.592202 29.780194 [16,] 6.859637 15.592202 [17,] 4.760790 6.859637 [18,] 60.859637 4.760790 [19,] 70.225919 60.859637 [20,] 68.315064 70.225919 [21,] 53.225919 68.315064 [22,] 32.582500 53.225919 [23,] 36.404210 32.582500 [24,] 21.018524 36.404210 [25,] 13.008822 21.018524 [26,] -8.376864 13.008822 [27,] -4.812888 -8.376864 [28,] -5.812888 -4.812888 [29,] 1.473951 -5.812888 [30,] 43.919677 1.473951 [31,] 56.295661 43.919677 [32,] 54.849935 56.295661 [33,] 21.483653 54.849935 [34,] 1.305363 21.483653 [35,] 1.869339 1.305363 [36,] 4.047629 1.869339 [37,] -5.675234 4.047629 [38,] -25.407798 -5.675234 [39,] -21.388395 -25.407798 [40,] -37.754677 -21.388395 [41,] -54.308952 -37.754677 [42,] -6.051218 -54.308952 [43,] 5.770492 -6.051218 [44,] -14.496944 5.770492 [45,] -29.041516 -14.496944 [46,] -45.586089 -29.041516 [47,] -44.774081 -45.586089 [48,] -36.764379 -44.774081 [49,] -53.051218 -36.764379 [50,] -60.764379 -53.051218 [51,] -78.338057 -60.764379 [52,] -89.774081 -78.338057 [53,] -87.605492 -89.774081 [54,] -32.140363 -87.605492 [55,] -26.140363 -32.140363 [56,] -46.239210 -26.140363 [57,] -38.200403 -46.239210 [58,] -20.795314 -38.200403 [59,] 13.698921 -20.795314 [60,] 49.381147 13.698921 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 14.067032 24.175581 2 -2.407798 14.067032 3 -20.239210 -2.407798 4 -29.060920 -20.239210 5 -22.150065 -29.060920 6 28.394508 -22.150065 7 33.553395 28.394508 8 44.661943 33.553395 9 44.939080 44.661943 10 27.483653 44.939080 11 21.196814 27.483653 12 16.285959 21.196814 13 25.671645 16.285959 14 29.780194 25.671645 15 15.592202 29.780194 16 6.859637 15.592202 17 4.760790 6.859637 18 60.859637 4.760790 19 70.225919 60.859637 20 68.315064 70.225919 21 53.225919 68.315064 22 32.582500 53.225919 23 36.404210 32.582500 24 21.018524 36.404210 25 13.008822 21.018524 26 -8.376864 13.008822 27 -4.812888 -8.376864 28 -5.812888 -4.812888 29 1.473951 -5.812888 30 43.919677 1.473951 31 56.295661 43.919677 32 54.849935 56.295661 33 21.483653 54.849935 34 1.305363 21.483653 35 1.869339 1.305363 36 4.047629 1.869339 37 -5.675234 4.047629 38 -25.407798 -5.675234 39 -21.388395 -25.407798 40 -37.754677 -21.388395 41 -54.308952 -37.754677 42 -6.051218 -54.308952 43 5.770492 -6.051218 44 -14.496944 5.770492 45 -29.041516 -14.496944 46 -45.586089 -29.041516 47 -44.774081 -45.586089 48 -36.764379 -44.774081 49 -53.051218 -36.764379 50 -60.764379 -53.051218 51 -78.338057 -60.764379 52 -89.774081 -78.338057 53 -87.605492 -89.774081 54 -32.140363 -87.605492 55 -26.140363 -32.140363 56 -46.239210 -26.140363 57 -38.200403 -46.239210 58 -20.795314 -38.200403 59 13.698921 -20.795314 60 49.381147 13.698921 > 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/7ugym1258757154.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/8b64t1258757154.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/9bsv91258757154.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/10pebh1258757154.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/11sh0g1258757154.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/12e4zu1258757154.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/139ff71258757154.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/145qtz1258757154.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/15p6uw1258757154.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/16m7dn1258757154.tab") + } > > system("convert tmp/1d4rs1258757154.ps tmp/1d4rs1258757154.png") > system("convert tmp/2bwit1258757154.ps tmp/2bwit1258757154.png") > system("convert tmp/3m4la1258757154.ps tmp/3m4la1258757154.png") > system("convert tmp/47dgp1258757154.ps tmp/47dgp1258757154.png") > system("convert tmp/513441258757154.ps tmp/513441258757154.png") > system("convert tmp/682oe1258757154.ps tmp/682oe1258757154.png") > system("convert tmp/7ugym1258757154.ps tmp/7ugym1258757154.png") > system("convert tmp/8b64t1258757154.ps tmp/8b64t1258757154.png") > system("convert tmp/9bsv91258757154.ps tmp/9bsv91258757154.png") > system("convert tmp/10pebh1258757154.ps tmp/10pebh1258757154.png") > > > proc.time() user system elapsed 2.432 1.525 3.132