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(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,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,0,469,1,478,1,528,1,534,1,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1),dim=c(2,61),dimnames=list(c('Yt','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Yt','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 = '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 Yt X t 1 543 0 1 2 594 0 2 3 611 0 3 4 613 0 4 5 611 0 5 6 594 0 6 7 595 0 7 8 591 0 8 9 589 0 9 10 584 0 10 11 573 0 11 12 567 0 12 13 569 0 13 14 621 0 14 15 629 0 15 16 628 0 16 17 612 0 17 18 595 0 18 19 597 0 19 20 593 0 20 21 590 0 21 22 580 0 22 23 574 0 23 24 573 0 24 25 573 0 25 26 620 0 26 27 626 0 27 28 620 0 28 29 588 0 29 30 566 0 30 31 557 0 31 32 561 0 32 33 549 0 33 34 532 0 34 35 526 0 35 36 511 0 36 37 499 0 37 38 555 0 38 39 565 0 39 40 542 0 40 41 527 0 41 42 510 0 42 43 514 0 43 44 517 0 44 45 508 0 45 46 493 0 46 47 490 0 47 48 469 1 48 49 478 1 49 50 528 1 50 51 534 1 51 52 518 1 52 53 506 1 53 54 502 1 54 55 516 1 55 56 528 1 56 57 533 1 57 58 536 1 58 59 537 1 59 60 524 1 60 61 536 1 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X t 616.552 7.384 -1.953 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -71.599 -18.151 1.712 15.507 62.178 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 616.5519 8.1131 75.995 < 2e-16 *** X 7.3844 12.2829 0.601 0.55 t -1.9530 0.2934 -6.657 1.1e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 27.64 on 58 degrees of freedom Multiple R-squared: 0.588, Adjusted R-squared: 0.5738 F-statistic: 41.39 on 2 and 58 DF, p-value: 6.801e-12 > 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.60356177 0.792876458 0.396438229 [2,] 0.53807811 0.923843777 0.461921888 [3,] 0.46779937 0.935598745 0.532200627 [4,] 0.38808245 0.776164899 0.611917550 [5,] 0.32466560 0.649331200 0.675334400 [6,] 0.31101346 0.622026917 0.688986542 [7,] 0.31051017 0.621020344 0.689489828 [8,] 0.28662452 0.573249035 0.713375482 [9,] 0.38775684 0.775513674 0.612243163 [10,] 0.45420250 0.908404998 0.545797501 [11,] 0.44662677 0.893253541 0.553373229 [12,] 0.36227123 0.724542469 0.637728766 [13,] 0.29857351 0.597147012 0.701426494 [14,] 0.23473335 0.469466694 0.765266653 [15,] 0.18464984 0.369299685 0.815350158 [16,] 0.14450574 0.289011479 0.855494260 [17,] 0.12589399 0.251787974 0.874106013 [18,] 0.11543905 0.230878093 0.884560954 [19,] 0.09978365 0.199567309 0.900216345 [20,] 0.08057013 0.161140256 0.919429872 [21,] 0.10430627 0.208612544 0.895693728 [22,] 0.18304848 0.366096967 0.816951517 [23,] 0.31585538 0.631710766 0.684144617 [24,] 0.36323753 0.726475056 0.636762472 [25,] 0.42142462 0.842849242 0.578575379 [26,] 0.48753348 0.975066964 0.512466518 [27,] 0.55824254 0.883514930 0.441757465 [28,] 0.62895453 0.742090945 0.371045472 [29,] 0.69317504 0.613649911 0.306824955 [30,] 0.73013066 0.539738679 0.269869339 [31,] 0.77345124 0.453097516 0.226548758 [32,] 0.82923824 0.341523525 0.170761763 [33,] 0.85902139 0.281957214 0.140978607 [34,] 0.95801829 0.083963427 0.041981713 [35,] 0.98118936 0.037621273 0.018810637 [36,] 0.98740727 0.025185458 0.012592729 [37,] 0.98498311 0.030033786 0.015016893 [38,] 0.98314300 0.033714003 0.016857002 [39,] 0.98484201 0.030315981 0.015157990 [40,] 0.98281939 0.034361216 0.017180608 [41,] 0.97341633 0.053167334 0.026583667 [42,] 0.95741559 0.085168828 0.042584414 [43,] 0.97386711 0.052265778 0.026132889 [44,] 0.99340121 0.013197580 0.006598790 [45,] 0.99164621 0.016707572 0.008353786 [46,] 0.99729652 0.005406952 0.002703476 [47,] 0.99532707 0.009345855 0.004672928 [48,] 0.98549801 0.029003988 0.014501994 [49,] 0.98679085 0.026418303 0.013209151 [50,] 0.98032092 0.039358167 0.019679083 > postscript(file="/var/www/html/rcomp/tmp/1snmy1258740885.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/2axol1258740885.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/3u0ab1258740885.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/48slz1258740885.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/5hr961258740885.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 -71.5989402 -18.6459798 0.3069806 4.2599410 4.2129014 -10.8341382 7 8 9 10 11 12 -7.8811778 -9.9282174 -9.9752570 -13.0222966 -22.0693362 -26.1163758 13 14 15 16 17 18 -22.1634154 31.7895450 41.7425054 42.6954658 28.6484262 13.6013866 19 20 21 22 23 24 17.5543470 15.5073073 14.4602677 6.4132281 2.3661885 3.3191489 25 26 27 28 29 30 5.2721093 54.2250697 62.1780301 58.1309905 28.0839509 8.0369113 31 32 33 34 35 36 0.9898717 6.9428321 -3.1042075 -18.1512471 -22.1982867 -35.2453263 37 38 39 40 41 42 -45.2923659 12.6605945 24.6135549 3.5665153 -9.4805243 -24.5275639 43 44 45 46 47 48 -18.5746035 -13.6216431 -20.6686827 -33.7157223 -34.7627619 -61.1942426 49 50 51 52 53 54 -50.2412822 1.7116782 9.6646386 -4.3824010 -14.4294406 -16.4764802 55 56 57 58 59 60 -0.5235198 13.4294406 20.3824010 25.3353614 28.2883218 17.2412822 61 31.1942426 > postscript(file="/var/www/html/rcomp/tmp/6dk901258740885.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 -71.5989402 NA 1 -18.6459798 -71.5989402 2 0.3069806 -18.6459798 3 4.2599410 0.3069806 4 4.2129014 4.2599410 5 -10.8341382 4.2129014 6 -7.8811778 -10.8341382 7 -9.9282174 -7.8811778 8 -9.9752570 -9.9282174 9 -13.0222966 -9.9752570 10 -22.0693362 -13.0222966 11 -26.1163758 -22.0693362 12 -22.1634154 -26.1163758 13 31.7895450 -22.1634154 14 41.7425054 31.7895450 15 42.6954658 41.7425054 16 28.6484262 42.6954658 17 13.6013866 28.6484262 18 17.5543470 13.6013866 19 15.5073073 17.5543470 20 14.4602677 15.5073073 21 6.4132281 14.4602677 22 2.3661885 6.4132281 23 3.3191489 2.3661885 24 5.2721093 3.3191489 25 54.2250697 5.2721093 26 62.1780301 54.2250697 27 58.1309905 62.1780301 28 28.0839509 58.1309905 29 8.0369113 28.0839509 30 0.9898717 8.0369113 31 6.9428321 0.9898717 32 -3.1042075 6.9428321 33 -18.1512471 -3.1042075 34 -22.1982867 -18.1512471 35 -35.2453263 -22.1982867 36 -45.2923659 -35.2453263 37 12.6605945 -45.2923659 38 24.6135549 12.6605945 39 3.5665153 24.6135549 40 -9.4805243 3.5665153 41 -24.5275639 -9.4805243 42 -18.5746035 -24.5275639 43 -13.6216431 -18.5746035 44 -20.6686827 -13.6216431 45 -33.7157223 -20.6686827 46 -34.7627619 -33.7157223 47 -61.1942426 -34.7627619 48 -50.2412822 -61.1942426 49 1.7116782 -50.2412822 50 9.6646386 1.7116782 51 -4.3824010 9.6646386 52 -14.4294406 -4.3824010 53 -16.4764802 -14.4294406 54 -0.5235198 -16.4764802 55 13.4294406 -0.5235198 56 20.3824010 13.4294406 57 25.3353614 20.3824010 58 28.2883218 25.3353614 59 17.2412822 28.2883218 60 31.1942426 17.2412822 61 NA 31.1942426 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -18.6459798 -71.5989402 [2,] 0.3069806 -18.6459798 [3,] 4.2599410 0.3069806 [4,] 4.2129014 4.2599410 [5,] -10.8341382 4.2129014 [6,] -7.8811778 -10.8341382 [7,] -9.9282174 -7.8811778 [8,] -9.9752570 -9.9282174 [9,] -13.0222966 -9.9752570 [10,] -22.0693362 -13.0222966 [11,] -26.1163758 -22.0693362 [12,] -22.1634154 -26.1163758 [13,] 31.7895450 -22.1634154 [14,] 41.7425054 31.7895450 [15,] 42.6954658 41.7425054 [16,] 28.6484262 42.6954658 [17,] 13.6013866 28.6484262 [18,] 17.5543470 13.6013866 [19,] 15.5073073 17.5543470 [20,] 14.4602677 15.5073073 [21,] 6.4132281 14.4602677 [22,] 2.3661885 6.4132281 [23,] 3.3191489 2.3661885 [24,] 5.2721093 3.3191489 [25,] 54.2250697 5.2721093 [26,] 62.1780301 54.2250697 [27,] 58.1309905 62.1780301 [28,] 28.0839509 58.1309905 [29,] 8.0369113 28.0839509 [30,] 0.9898717 8.0369113 [31,] 6.9428321 0.9898717 [32,] -3.1042075 6.9428321 [33,] -18.1512471 -3.1042075 [34,] -22.1982867 -18.1512471 [35,] -35.2453263 -22.1982867 [36,] -45.2923659 -35.2453263 [37,] 12.6605945 -45.2923659 [38,] 24.6135549 12.6605945 [39,] 3.5665153 24.6135549 [40,] -9.4805243 3.5665153 [41,] -24.5275639 -9.4805243 [42,] -18.5746035 -24.5275639 [43,] -13.6216431 -18.5746035 [44,] -20.6686827 -13.6216431 [45,] -33.7157223 -20.6686827 [46,] -34.7627619 -33.7157223 [47,] -61.1942426 -34.7627619 [48,] -50.2412822 -61.1942426 [49,] 1.7116782 -50.2412822 [50,] 9.6646386 1.7116782 [51,] -4.3824010 9.6646386 [52,] -14.4294406 -4.3824010 [53,] -16.4764802 -14.4294406 [54,] -0.5235198 -16.4764802 [55,] 13.4294406 -0.5235198 [56,] 20.3824010 13.4294406 [57,] 25.3353614 20.3824010 [58,] 28.2883218 25.3353614 [59,] 17.2412822 28.2883218 [60,] 31.1942426 17.2412822 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -18.6459798 -71.5989402 2 0.3069806 -18.6459798 3 4.2599410 0.3069806 4 4.2129014 4.2599410 5 -10.8341382 4.2129014 6 -7.8811778 -10.8341382 7 -9.9282174 -7.8811778 8 -9.9752570 -9.9282174 9 -13.0222966 -9.9752570 10 -22.0693362 -13.0222966 11 -26.1163758 -22.0693362 12 -22.1634154 -26.1163758 13 31.7895450 -22.1634154 14 41.7425054 31.7895450 15 42.6954658 41.7425054 16 28.6484262 42.6954658 17 13.6013866 28.6484262 18 17.5543470 13.6013866 19 15.5073073 17.5543470 20 14.4602677 15.5073073 21 6.4132281 14.4602677 22 2.3661885 6.4132281 23 3.3191489 2.3661885 24 5.2721093 3.3191489 25 54.2250697 5.2721093 26 62.1780301 54.2250697 27 58.1309905 62.1780301 28 28.0839509 58.1309905 29 8.0369113 28.0839509 30 0.9898717 8.0369113 31 6.9428321 0.9898717 32 -3.1042075 6.9428321 33 -18.1512471 -3.1042075 34 -22.1982867 -18.1512471 35 -35.2453263 -22.1982867 36 -45.2923659 -35.2453263 37 12.6605945 -45.2923659 38 24.6135549 12.6605945 39 3.5665153 24.6135549 40 -9.4805243 3.5665153 41 -24.5275639 -9.4805243 42 -18.5746035 -24.5275639 43 -13.6216431 -18.5746035 44 -20.6686827 -13.6216431 45 -33.7157223 -20.6686827 46 -34.7627619 -33.7157223 47 -61.1942426 -34.7627619 48 -50.2412822 -61.1942426 49 1.7116782 -50.2412822 50 9.6646386 1.7116782 51 -4.3824010 9.6646386 52 -14.4294406 -4.3824010 53 -16.4764802 -14.4294406 54 -0.5235198 -16.4764802 55 13.4294406 -0.5235198 56 20.3824010 13.4294406 57 25.3353614 20.3824010 58 28.2883218 25.3353614 59 17.2412822 28.2883218 60 31.1942426 17.2412822 > 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/7n3a51258740885.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/8pkrj1258740885.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/9813w1258740885.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/10zn5u1258740885.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/11t4wb1258740885.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/12351f1258740885.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/13rtp51258740885.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/147a3o1258740885.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/15hbj51258740885.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/167wmn1258740885.tab") + } > > system("convert tmp/1snmy1258740885.ps tmp/1snmy1258740885.png") > system("convert tmp/2axol1258740885.ps tmp/2axol1258740885.png") > system("convert tmp/3u0ab1258740885.ps tmp/3u0ab1258740885.png") > system("convert tmp/48slz1258740885.ps tmp/48slz1258740885.png") > system("convert tmp/5hr961258740885.ps tmp/5hr961258740885.png") > system("convert tmp/6dk901258740885.ps tmp/6dk901258740885.png") > system("convert tmp/7n3a51258740885.ps tmp/7n3a51258740885.png") > system("convert tmp/8pkrj1258740885.ps tmp/8pkrj1258740885.png") > system("convert tmp/9813w1258740885.ps tmp/9813w1258740885.png") > system("convert tmp/10zn5u1258740885.ps tmp/10zn5u1258740885.png") > > > proc.time() user system elapsed 2.439 1.582 3.062