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(564,-0.9,581,-1,597,-0.7,587,-1.7,536,-1,524,-0.2,537,0.7,536,0.6,533,1.9,528,2.1,516,2.7,502,3.2,506,4.8,518,5.5,534,5.4,528,5.9,478,5.8,469,5.1,490,4.1,493,4.4,508,3.6,517,3.5,514,3.1,510,2.9,527,2.2,542,1.4,565,1.2,555,1.3,499,1.3,511,1.3,526,1.8,532,1.8,549,1.8,561,1.7,557,2.1,566,2,588,1.7,620,1.9,626,2.3,620,2.4,573,2.5,573,2.8,574,2.6,580,2.2,590,2.8,593,2.8,597,2.8,595,2.3,612,2.2,628,3,629,2.9,621,2.7,569,2.7,567,2.3,573,2.4,584,2.8,589,2.3,591,2,595,1.9,594,2.3),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 564 -0.9 1 0 0 0 0 0 0 0 0 0 0 2 581 -1.0 0 1 0 0 0 0 0 0 0 0 0 3 597 -0.7 0 0 1 0 0 0 0 0 0 0 0 4 587 -1.7 0 0 0 1 0 0 0 0 0 0 0 5 536 -1.0 0 0 0 0 1 0 0 0 0 0 0 6 524 -0.2 0 0 0 0 0 1 0 0 0 0 0 7 537 0.7 0 0 0 0 0 0 1 0 0 0 0 8 536 0.6 0 0 0 0 0 0 0 1 0 0 0 9 533 1.9 0 0 0 0 0 0 0 0 1 0 0 10 528 2.1 0 0 0 0 0 0 0 0 0 1 0 11 516 2.7 0 0 0 0 0 0 0 0 0 0 1 12 502 3.2 0 0 0 0 0 0 0 0 0 0 0 13 506 4.8 1 0 0 0 0 0 0 0 0 0 0 14 518 5.5 0 1 0 0 0 0 0 0 0 0 0 15 534 5.4 0 0 1 0 0 0 0 0 0 0 0 16 528 5.9 0 0 0 1 0 0 0 0 0 0 0 17 478 5.8 0 0 0 0 1 0 0 0 0 0 0 18 469 5.1 0 0 0 0 0 1 0 0 0 0 0 19 490 4.1 0 0 0 0 0 0 1 0 0 0 0 20 493 4.4 0 0 0 0 0 0 0 1 0 0 0 21 508 3.6 0 0 0 0 0 0 0 0 1 0 0 22 517 3.5 0 0 0 0 0 0 0 0 0 1 0 23 514 3.1 0 0 0 0 0 0 0 0 0 0 1 24 510 2.9 0 0 0 0 0 0 0 0 0 0 0 25 527 2.2 1 0 0 0 0 0 0 0 0 0 0 26 542 1.4 0 1 0 0 0 0 0 0 0 0 0 27 565 1.2 0 0 1 0 0 0 0 0 0 0 0 28 555 1.3 0 0 0 1 0 0 0 0 0 0 0 29 499 1.3 0 0 0 0 1 0 0 0 0 0 0 30 511 1.3 0 0 0 0 0 1 0 0 0 0 0 31 526 1.8 0 0 0 0 0 0 1 0 0 0 0 32 532 1.8 0 0 0 0 0 0 0 1 0 0 0 33 549 1.8 0 0 0 0 0 0 0 0 1 0 0 34 561 1.7 0 0 0 0 0 0 0 0 0 1 0 35 557 2.1 0 0 0 0 0 0 0 0 0 0 1 36 566 2.0 0 0 0 0 0 0 0 0 0 0 0 37 588 1.7 1 0 0 0 0 0 0 0 0 0 0 38 620 1.9 0 1 0 0 0 0 0 0 0 0 0 39 626 2.3 0 0 1 0 0 0 0 0 0 0 0 40 620 2.4 0 0 0 1 0 0 0 0 0 0 0 41 573 2.5 0 0 0 0 1 0 0 0 0 0 0 42 573 2.8 0 0 0 0 0 1 0 0 0 0 0 43 574 2.6 0 0 0 0 0 0 1 0 0 0 0 44 580 2.2 0 0 0 0 0 0 0 1 0 0 0 45 590 2.8 0 0 0 0 0 0 0 0 1 0 0 46 593 2.8 0 0 0 0 0 0 0 0 0 1 0 47 597 2.8 0 0 0 0 0 0 0 0 0 0 1 48 595 2.3 0 0 0 0 0 0 0 0 0 0 0 49 612 2.2 1 0 0 0 0 0 0 0 0 0 0 50 628 3.0 0 1 0 0 0 0 0 0 0 0 0 51 629 2.9 0 0 1 0 0 0 0 0 0 0 0 52 621 2.7 0 0 0 1 0 0 0 0 0 0 0 53 569 2.7 0 0 0 0 1 0 0 0 0 0 0 54 567 2.3 0 0 0 0 0 1 0 0 0 0 0 55 573 2.4 0 0 0 0 0 0 1 0 0 0 0 56 584 2.8 0 0 0 0 0 0 0 1 0 0 0 57 589 2.3 0 0 0 0 0 0 0 0 1 0 0 58 591 2.0 0 0 0 0 0 0 0 0 0 1 0 59 595 1.9 0 0 0 0 0 0 0 0 0 0 1 60 594 2.3 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 574.16240 -8.17417 1.58595 21.29381 34.18426 25.36685 M5 M6 M7 M8 M9 M10 -24.68877 -26.88877 -15.19832 -9.87135 -0.09045 3.61910 M11 2.23652 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -46.01 -31.12 -17.32 38.21 57.07 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 574.16240 18.99184 30.232 <2e-16 *** X -8.17417 3.15510 -2.591 0.0127 * M1 1.58595 24.40974 0.065 0.9485 M2 21.29381 24.37971 0.873 0.3869 M3 34.18426 24.37113 1.403 0.1673 M4 25.36685 24.38624 1.040 0.3036 M5 -24.68877 24.36623 -1.013 0.3161 M6 -26.88877 24.36623 -1.104 0.2754 M7 -15.19832 24.36010 -0.624 0.5357 M8 -9.87135 24.35683 -0.405 0.6871 M9 -0.09045 24.35095 -0.004 0.9971 M10 3.61910 24.35315 0.149 0.8825 M11 2.23652 24.35029 0.092 0.9272 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 38.5 on 47 degrees of freedom Multiple R-squared: 0.3041, Adjusted R-squared: 0.1264 F-statistic: 1.712 on 12 and 47 DF, p-value: 0.09454 > 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,] 4.150375e-03 8.300749e-03 9.958496e-01 [2,] 5.833512e-04 1.166702e-03 9.994166e-01 [3,] 1.086632e-04 2.173264e-04 9.998913e-01 [4,] 9.225958e-05 1.845192e-04 9.999077e-01 [5,] 2.888106e-05 5.776211e-05 9.999711e-01 [6,] 1.363702e-05 2.727404e-05 9.999864e-01 [7,] 6.773369e-06 1.354674e-05 9.999932e-01 [8,] 5.643017e-06 1.128603e-05 9.999944e-01 [9,] 2.561005e-05 5.122009e-05 9.999744e-01 [10,] 2.408323e-04 4.816645e-04 9.997592e-01 [11,] 1.595544e-03 3.191089e-03 9.984045e-01 [12,] 1.476263e-03 2.952527e-03 9.985237e-01 [13,] 1.346021e-03 2.692042e-03 9.986540e-01 [14,] 4.922094e-03 9.844187e-03 9.950779e-01 [15,] 3.422544e-03 6.845088e-03 9.965775e-01 [16,] 4.557430e-03 9.114860e-03 9.954426e-01 [17,] 1.504648e-02 3.009296e-02 9.849535e-01 [18,] 6.292488e-02 1.258498e-01 9.370751e-01 [19,] 2.289937e-01 4.579875e-01 7.710063e-01 [20,] 8.940696e-01 2.118609e-01 1.059304e-01 [21,] 9.995308e-01 9.384955e-04 4.692477e-04 [22,] 1.000000e+00 1.769292e-08 8.846462e-09 [23,] 1.000000e+00 8.418129e-09 4.209064e-09 [24,] 1.000000e+00 3.610547e-08 1.805273e-08 [25,] 9.999999e-01 2.155284e-07 1.077642e-07 [26,] 9.999999e-01 2.283215e-07 1.141607e-07 [27,] 9.999999e-01 1.153212e-07 5.766062e-08 [28,] 9.999983e-01 3.419316e-06 1.709658e-06 [29,] 9.999967e-01 6.642438e-06 3.321219e-06 > postscript(file="/var/www/html/rcomp/tmp/10sok1260902863.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/2kb471260902863.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/3ush71260902863.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/40m9d1260902863.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/5ieqx1260902863.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 7 -19.105107 -22.630392 -17.068590 -26.425347 -21.647809 -24.908470 -16.242163 8 9 10 11 12 13 14 -23.386547 -25.541021 -32.615736 -38.328649 -46.005045 -30.512311 -32.498257 15 16 17 18 19 20 21 -30.206125 -23.301620 -24.063422 -36.585344 -35.449969 -35.324684 -36.644924 22 23 24 25 26 27 28 -32.171891 -37.058979 -40.457297 -30.765165 -42.012373 -33.537658 -33.902823 29 30 31 32 33 34 35 -39.847208 -25.647208 -18.250571 -17.577538 -10.358439 -2.885406 -2.233153 36 37 38 39 40 41 42 8.185946 26.147748 40.074715 36.453934 40.088769 43.961802 48.614054 43 44 45 46 47 48 49 36.288769 33.692132 38.815736 38.106186 43.488769 39.638198 54.234835 50 51 52 53 54 55 56 57.066307 44.358439 43.541021 41.596637 38.526967 33.653934 42.596637 57 58 59 60 33.728649 29.566847 34.132012 38.638198 > postscript(file="/var/www/html/rcomp/tmp/6213k1260902863.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -19.105107 NA 1 -22.630392 -19.105107 2 -17.068590 -22.630392 3 -26.425347 -17.068590 4 -21.647809 -26.425347 5 -24.908470 -21.647809 6 -16.242163 -24.908470 7 -23.386547 -16.242163 8 -25.541021 -23.386547 9 -32.615736 -25.541021 10 -38.328649 -32.615736 11 -46.005045 -38.328649 12 -30.512311 -46.005045 13 -32.498257 -30.512311 14 -30.206125 -32.498257 15 -23.301620 -30.206125 16 -24.063422 -23.301620 17 -36.585344 -24.063422 18 -35.449969 -36.585344 19 -35.324684 -35.449969 20 -36.644924 -35.324684 21 -32.171891 -36.644924 22 -37.058979 -32.171891 23 -40.457297 -37.058979 24 -30.765165 -40.457297 25 -42.012373 -30.765165 26 -33.537658 -42.012373 27 -33.902823 -33.537658 28 -39.847208 -33.902823 29 -25.647208 -39.847208 30 -18.250571 -25.647208 31 -17.577538 -18.250571 32 -10.358439 -17.577538 33 -2.885406 -10.358439 34 -2.233153 -2.885406 35 8.185946 -2.233153 36 26.147748 8.185946 37 40.074715 26.147748 38 36.453934 40.074715 39 40.088769 36.453934 40 43.961802 40.088769 41 48.614054 43.961802 42 36.288769 48.614054 43 33.692132 36.288769 44 38.815736 33.692132 45 38.106186 38.815736 46 43.488769 38.106186 47 39.638198 43.488769 48 54.234835 39.638198 49 57.066307 54.234835 50 44.358439 57.066307 51 43.541021 44.358439 52 41.596637 43.541021 53 38.526967 41.596637 54 33.653934 38.526967 55 42.596637 33.653934 56 33.728649 42.596637 57 29.566847 33.728649 58 34.132012 29.566847 59 38.638198 34.132012 60 NA 38.638198 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -22.630392 -19.105107 [2,] -17.068590 -22.630392 [3,] -26.425347 -17.068590 [4,] -21.647809 -26.425347 [5,] -24.908470 -21.647809 [6,] -16.242163 -24.908470 [7,] -23.386547 -16.242163 [8,] -25.541021 -23.386547 [9,] -32.615736 -25.541021 [10,] -38.328649 -32.615736 [11,] -46.005045 -38.328649 [12,] -30.512311 -46.005045 [13,] -32.498257 -30.512311 [14,] -30.206125 -32.498257 [15,] -23.301620 -30.206125 [16,] -24.063422 -23.301620 [17,] -36.585344 -24.063422 [18,] -35.449969 -36.585344 [19,] -35.324684 -35.449969 [20,] -36.644924 -35.324684 [21,] -32.171891 -36.644924 [22,] -37.058979 -32.171891 [23,] -40.457297 -37.058979 [24,] -30.765165 -40.457297 [25,] -42.012373 -30.765165 [26,] -33.537658 -42.012373 [27,] -33.902823 -33.537658 [28,] -39.847208 -33.902823 [29,] -25.647208 -39.847208 [30,] -18.250571 -25.647208 [31,] -17.577538 -18.250571 [32,] -10.358439 -17.577538 [33,] -2.885406 -10.358439 [34,] -2.233153 -2.885406 [35,] 8.185946 -2.233153 [36,] 26.147748 8.185946 [37,] 40.074715 26.147748 [38,] 36.453934 40.074715 [39,] 40.088769 36.453934 [40,] 43.961802 40.088769 [41,] 48.614054 43.961802 [42,] 36.288769 48.614054 [43,] 33.692132 36.288769 [44,] 38.815736 33.692132 [45,] 38.106186 38.815736 [46,] 43.488769 38.106186 [47,] 39.638198 43.488769 [48,] 54.234835 39.638198 [49,] 57.066307 54.234835 [50,] 44.358439 57.066307 [51,] 43.541021 44.358439 [52,] 41.596637 43.541021 [53,] 38.526967 41.596637 [54,] 33.653934 38.526967 [55,] 42.596637 33.653934 [56,] 33.728649 42.596637 [57,] 29.566847 33.728649 [58,] 34.132012 29.566847 [59,] 38.638198 34.132012 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -22.630392 -19.105107 2 -17.068590 -22.630392 3 -26.425347 -17.068590 4 -21.647809 -26.425347 5 -24.908470 -21.647809 6 -16.242163 -24.908470 7 -23.386547 -16.242163 8 -25.541021 -23.386547 9 -32.615736 -25.541021 10 -38.328649 -32.615736 11 -46.005045 -38.328649 12 -30.512311 -46.005045 13 -32.498257 -30.512311 14 -30.206125 -32.498257 15 -23.301620 -30.206125 16 -24.063422 -23.301620 17 -36.585344 -24.063422 18 -35.449969 -36.585344 19 -35.324684 -35.449969 20 -36.644924 -35.324684 21 -32.171891 -36.644924 22 -37.058979 -32.171891 23 -40.457297 -37.058979 24 -30.765165 -40.457297 25 -42.012373 -30.765165 26 -33.537658 -42.012373 27 -33.902823 -33.537658 28 -39.847208 -33.902823 29 -25.647208 -39.847208 30 -18.250571 -25.647208 31 -17.577538 -18.250571 32 -10.358439 -17.577538 33 -2.885406 -10.358439 34 -2.233153 -2.885406 35 8.185946 -2.233153 36 26.147748 8.185946 37 40.074715 26.147748 38 36.453934 40.074715 39 40.088769 36.453934 40 43.961802 40.088769 41 48.614054 43.961802 42 36.288769 48.614054 43 33.692132 36.288769 44 38.815736 33.692132 45 38.106186 38.815736 46 43.488769 38.106186 47 39.638198 43.488769 48 54.234835 39.638198 49 57.066307 54.234835 50 44.358439 57.066307 51 43.541021 44.358439 52 41.596637 43.541021 53 38.526967 41.596637 54 33.653934 38.526967 55 42.596637 33.653934 56 33.728649 42.596637 57 29.566847 33.728649 58 34.132012 29.566847 59 38.638198 34.132012 > 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/7igjs1260902863.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/8356s1260902863.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/9cwlp1260902863.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/10ff5d1260902863.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/115idk1260902863.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/123c2b1260902863.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/138vjg1260902863.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/140rop1260902863.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/15m0ko1260902863.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/16hh471260902863.tab") + } > > try(system("convert tmp/10sok1260902863.ps tmp/10sok1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/2kb471260902863.ps tmp/2kb471260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/3ush71260902863.ps tmp/3ush71260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/40m9d1260902863.ps tmp/40m9d1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/5ieqx1260902863.ps tmp/5ieqx1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/6213k1260902863.ps tmp/6213k1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/7igjs1260902863.ps tmp/7igjs1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/8356s1260902863.ps tmp/8356s1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/9cwlp1260902863.ps tmp/9cwlp1260902863.png",intern=TRUE)) character(0) > try(system("convert tmp/10ff5d1260902863.ps tmp/10ff5d1260902863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.420 1.567 3.520